Commit Graph

685 Commits

Author SHA1 Message Date
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Davide Italiano
2e78fdf58f Fix a bunch of pessimizing moves which prevent copy elision. 2015-12-11 19:09:13 +00:00
Dmitri Gribenko
109d8e6402 FreeBSD toolchain: remove code duplication 2015-12-04 22:51:20 -08:00
Landon Fuller
daa97e0079 Adopt suggested 'GenericUnix' toolchain class name. 2015-12-04 17:30:42 -07:00
Landon Fuller
83b706df8a Merge branch 'master' into landonf/freebsd-patchset-1 2015-12-04 17:11:54 -07:00
Dmitri Gribenko
a3c92e1b0d Remove build options for conditionally enabling targets
* We don't have a use-case for this.

* Swift, like Clang, is fundamentally a cross-compiler, and there is no
  known reason to artificially limit it.
2015-12-04 16:04:35 -08:00
Landon Fuller
0aeef6fec3 Merge branch 'master' into landonf/freebsd-patchset-1 2015-12-04 14:22:28 -07:00
Landon Fuller
d7721781bc Unify the identical Linux/FreeBSD definitions.
When these diverge, we can use the Unix toolchain as
a common baseclass for both.
2015-12-04 14:14:02 -07:00
Jordan Rose
528298c12b [Driver] Add the notion of "extra environment variables" to Jobs.
This is groundwork for setting [DY]LD_LIBRARY_PATH ahead of time when
invoking the interpreter, which is rdar://problem/23588774. The next
commit will set up the appropriate variable and use -driver-print-jobs
to test it; the following commit will apply the environment variable
when running a job.
2015-12-04 12:18:46 -08:00
Jordan Rose
6d9b5cb8ed [Driver] Factor interpret-script mode out into a separate Action.
This makes it easier to make interpreter modes behave differently from
compilation modes. Obviously that's a trade-off, since the two modes also
share plenty, but given how few of the existing CompileJobAction checks had
to be modified for the new InterpretJobAction, I think this is the right
way to go.

Groundwork for setting [DY]LD_LIBRARY_PATH ahead of time when invoking the
interpreter, which is rdar://problem/23588774.
2015-12-04 12:18:45 -08:00
Landon Fuller
a7ec794287 Add basic build system and Driver support for FreeBSD targets/hosts. 2015-12-04 12:24:46 -07:00
Brian Dunlay
f8fb44273c Fix Typos
Arguments for this pr are appropriately unnecessary.
2015-12-03 15:55:09 -08:00
Dmitri Gribenko
4324e7c903 Remove conditional compilation of tvOS 2015-12-01 14:43:45 -07:00
Jordan Rose
35e109140d [Driver] Rebuild a file if its primary output is missing.
(But don't bother to rebuild any of its dependents.)

rdar://problem/23040999

Swift SVN r32933
2015-10-28 01:13:50 +00:00
Michael Gottesman
c03adef030 Fix "Adjust to InputArgList being a move-only type"
DerivedArgList has a pointer to the InputArgList it came from, so we can't
just std::move it around. Put most of the driver back the way it was, with
small changes to clarify ownership.

Swift SVN r31811
2015-09-09 04:37:29 +00:00
Michael Gottesman
d6cdce1013 Adjust to InputArgList being a move-only type
Swift SVN r31800
2015-09-09 04:37:17 +00:00
Adrian Prantl
0de0d43773 Introduce a -modulewrap driver action that wraps a (merged) .swiftmodule
inside a swift ast section in an object file so it can be passed to the
linker. The driver automatically wraps merged swiftmodules iff the target
is ELF.

rdar://problem/22407666

Swift SVN r31641
2015-09-02 21:56:25 +00:00
Jordan Rose
ff07c90af0 [Driver] Fix comments. NFC.
Swift SVN r31564
2015-08-28 23:19:08 +00:00
Jordan Rose
de2ecbb80e [Driver] Remove the notion of Tools, turn ToolChain into an Action visitor.
The "Tool" abstraction wasn't buying us enough to deserve the added
complexity. Now a ToolChain turns Actions into Jobs, and every helper
tool is searched for relative to Swift first. Much simpler.

Swift SVN r31563
2015-08-28 23:12:33 +00:00
Jordan Rose
7c5d0f7a89 Revert "On Linux, "/" is a perfectly reasonable default SDK."
This reverts r31534 and r31541. Apparently this already worked fine,
so just leave things the way they were.

Swift SVN r31547
2015-08-27 22:04:20 +00:00
Jordan Rose
2b325a1091 [Driver] Remove some essentially-unused helpers from ToolChain. NFC.
Swift SVN r31546
2015-08-27 22:04:16 +00:00
Jordan Rose
c1ab32e7f2 On Linux, "/" is a perfectly reasonable default SDK.
Swift SVN r31534
2015-08-27 18:47:24 +00:00
Jordan Rose
59ddbef71d [Driver] Don't pass swiftmodule files directly through to the linker.
...beacuse if we don't think we need a module, we'll just drop the files
on the floor. Better to error about them being unused.

Swift SVN r31377
2015-08-21 02:31:02 +00:00
Jordan Rose
208f647bd5 [Driver] Be more explicit about the inputs to the merge-module action.
Previously we treated this the same as the inputs to the linker, but this
was problematic for a few reasons:
- Backend jobs don't produce
- .o inputs never produce .swiftmodule files (obviously).

So now we:
- explicitly track what can produce a swiftmodule
- don't run module merging if there's nothing to merge
- allow linking without a swiftmodule even under -g

Which gets us closer to being able to run the entire test suite with -g.

rdar://problem/22332569

Swift SVN r31376
2015-08-21 02:30:52 +00:00
Jordan Rose
f5b1efb354 Move client-affecting configuration options into a generated Config.h.
This way they can be used from other projects, like LLDB. The downside
is we now have to make sure the header is included consistently in all
the places we care about, but I think in practice that won't be a problem,
especially not with tests.

rdar://problem/22240127

Swift SVN r31173
2015-08-12 17:50:13 +00:00
Jordan Rose
963c442b44 [Driver] Add support for interface-hash.
Dependents of modified files are no longer rebuilt by default, only if it turns
out that file's interface has changed. There is a flag
-driver-always-rebuild-dependents to override this, but we expect it to only be
used for testing. (Most of the existing dependency tests pick up this option;
the two new tests have "interface-hash" in the name.)

This is the second half of ChrisW's work on interface hashing.

rdar://problem/15352929

Swift SVN r30478
2015-07-22 00:14:01 +00:00
Jordan Rose
fbb8d3f9a8 Add "interface hash" for improved incremental builds.
Compute the hash of all interface tokens when parsing; write the
interface hash to the swiftdeps file, or if the -dump-interface-hash
option is passed to the frontend. This hash will be used in incremental
mode to determine whether a file's interface has changed, and therefore
whether dependent files need to be rebuilt in response to the change.

Committed on ChrisW's behalf while he gets his setup unborked.

rdar://problem/15352929

Swift SVN r30477
2015-07-22 00:13:54 +00:00
Devin Coughlin
ea18bc0c0b Rename -dump-trc option to -dump-type-refinement-contexts
As Jordan notes, 'TRC' is not a commonly-known acronym for most Swift compiler developers.

Swift SVN r30414
2015-07-20 21:47:49 +00:00
Devin Coughlin
b427975c39 Add a -dump-trc frontend option to print the type refinement context hierarchy
This is useful for debugging and testing.

Swift SVN r30383
2015-07-19 05:53:27 +00:00
Jordan Rose
96c19e5473 [Driver] Don't crash when the .swiftdeps file formats change.
The parsing code should really be more forgiving anyway, but there's no reason
to even try to read the swiftdeps files if we're rebuilding everything anyway.

Swift SVN r30281
2015-07-16 23:36:13 +00:00
Slava Pestov
d072199251 Driver: getToolChain()'s DarwinArchName parameter was never set, remove it together with some associated dead code, NFC
Swift SVN r30255
2015-07-16 07:08:39 +00:00
Jordan Rose
45189f9feb [Driver] Add a basic tracing mode to determine why files are getting rebuilt.
Enabled with -driver-show-incremental. For debugging purposes only.

Swift SVN r29804
2015-06-30 19:31:07 +00:00
Dmitri Hrybenko
502d0d5120 Adjust to the new ParseArgs API
Swift SVN r29701
2015-06-25 22:01:40 +00:00
Jordan Rose
036b083138 [Driver] Eliminate the JobList class.
This was just a wrapper around SmallVector that optionally owned the Job pointers
in it. Now that all Jobs are owned by the Compilation, we don't have to worry
about this any more.

No functionality change.

Swift SVN r29668
2015-06-25 15:45:45 +00:00
Jordan Rose
482cfac8a1 [Driver] Store all Jobs in a flat list in the Compilation object.
The Compilation is now the only owner of the Jobs.

No end-user functionality change.

Swift SVN r29667
2015-06-25 15:45:43 +00:00
Jordan Rose
6fce6d331d [Driver] Better separation of concerns in the Tool hierarchy.
No intended functionality change.

Swift SVN r29666
2015-06-25 15:45:41 +00:00
Jordan Rose
2b7b78d162 [Driver] A .swift file should be rebuilt if its mtime has changed.
...not if it's newer than its output .o file. This handles cases where the
object file is generated too quickly (rdar://problem/19404140) or when you
revert to a previous version of the file, mtime intact (rdar://problem/19720146).

There's a lot of test churn here; the only real new test is the backwards
mtime update in one-way.swift.

Swift SVN r29584
2015-06-24 00:06:58 +00:00
Jordan Rose
4875a1279d [Driver] Stop pretending that incremental builds work without build records.
They mostly did (r28750 was incorrect about this) but we should be testing
real configurations. Now that the tests have been updated, remove this.

(Eventually we'll need to design incremental builds without an output file
map, so that they work with simpler build systems like Ninja.)

Swift SVN r28777
2015-05-19 18:25:52 +00:00
Jordan Rose
4dacca912d [Driver] Don't full-rebuild when a new file is added.
Continue to full-rebuild when a file is removed, because we don't know what
was depending on it.

Swift SVN r28776
2015-05-19 18:25:51 +00:00
Dmitri Hrybenko
ea17483633 Add CMake options and #ifs to hide tvOS
Swift SVN r28752
2015-05-19 05:15:52 +00:00
Jordan Rose
b5b787b909 [Driver] Reordering inputs should not force a rebuild.
For that matter, adding and removing inputs should not force a rebuild
either. Those need to be taken care of by more specific cases.

Swift SVN r28751
2015-05-19 05:08:11 +00:00
Erik Eckstein
50423166aa Driver: fix a few things to get -embed-bitcode working with multi-threaded compilation.
Swift SVN r28517
2015-05-13 17:52:57 +00:00
Manman Ren
249239e14d [Bitcode Driver] make sure -embed-bitcode works with -force-single-frontend-invocation.
With both force-single-frontend-invocation and embed-bitcode, we create
CompileJobAction and BackendJobAction, similar to how we handle embed-bitcode
with StandarCompile.

This commit should only affect Bitcode mode.

rdar://20796819


Swift SVN r28129
2015-05-04 19:40:54 +00:00
Jordan Rose
b33994fabd [Driver] Bump required versions of the SDKs.
rdar://problem/20408977

Swift SVN r28043
2015-05-01 18:16:13 +00:00
Argyrios Kyrtzidis
8b250d6d35 [driver] Remove the 'swift-fixit' symlink and introduce '-emit-fixits-path' frontend option that
writes compiler fixits as source edits.

Driver option '-fixit-code' adds '-emit-fixits-path' for all the frontend invocations.

Swift SVN r27208
2015-04-10 17:33:29 +00:00
Argyrios Kyrtzidis
6ee8f9b9b7 [driver] Add option "-fixit-code" which delegates to 'swift-fixit'.
Swift SVN r27142
2015-04-08 22:20:34 +00:00
Argyrios Kyrtzidis
623b9827b4 [driver] Separate "delegate to the migrator with swift-update" and "get compiler fixits with swift-fixit" functionalities.
Swift SVN r27139
2015-04-08 22:02:23 +00:00
David Farler
544ef4002d Merge tvOS and watchOS Support
- Add frontend and standard library build support for tvOS.
- Add frontend support for watchOS.

watchOS standard library builds are still disabled during SDK bring-up.

To build for TVOS, specify --tvos to build-script.
To build for watchOS, specify --watchos to build-script (not yet supported).

This patch does not include turning on full tests for TVOS or watchOS, and
will be included in a follow-up patch.

Swift SVN r26278
2015-03-18 21:35:07 +00:00
Erik Eckstein
f3ff3db85f Driver: small corrections according to Jordan's feedback
Swift SVN r26267
2015-03-18 17:43:47 +00:00
Erik Eckstein
5537cf84ca Driver: Support -num-threads <n> option.
Together with -wmo it enables multi-threaded compilation.
I didn't want to reuse the -j option for this, because -num-threads (even if n == 1) does change the generated code.
For details see commit message of r25930.



Swift SVN r26258
2015-03-18 10:05:11 +00:00