Commit Graph

1784 Commits

Author SHA1 Message Date
Jordan Rose
298124a272 [Driver] Emit valid YAML. Use spaces instead of tabs.
rdar://problem/21753365

Swift SVN r31238
2015-08-14 01:32:56 +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
1473828eac [Driver] Don't crash on a bad swiftdeps file.
Normally we don't get here because the build record will be out of date,
but if we don't actually rebuild all the files we'll crash on the /next/
build.

Swift SVN r30889
2015-07-31 23:21:34 +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
2ad0ffd6e4 Dependencies: teach the Driver about the new member-based dependencies.
If file A extends a common type (say, Dictionary), but only adds new members,
other files using Dictionary don't need to be recompiled if they definitively
don't use those members. That should be working now.

Swift SVN r30286
2015-07-16 23:36:33 +00:00
Jordan Rose
c79952389c Dependencies: rename entries in the .swiftdeps file to something sensible.
- (depends|provides)-top-level for top-level names.
- (depends|provides)-nominal for access into nominal types.
- (depends|provides)-dynamic-lookup for @objc members available on AnyObject.
- depends-external for cross-module file-based dependencies.

No functionality change.

Swift SVN r30283
2015-07-16 23:36:26 +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
40cd9e479b [Driver] Always quote file paths in the build record.
rdar://problem/21753365

Swift SVN r30054
2015-07-10 01:39:12 +00:00
Jordan Rose
80b734d014 [Driver] -driver-show-incremental: avoid showing duplicates.
Swift SVN r29819
2015-06-30 23:12:43 +00:00
Jordan Rose
6275c78a69 [Driver] -driver-show-incremental: fix printing of protocols.
Actually use the existential-like name we constructed.

Swift SVN r29818
2015-06-30 23:12:41 +00:00
Jordan Rose
83f9ed43c3 [Driver] Don't assert when some files /don't/ get rebuilt but we still merge modules.
...or do anything else that depends on the compile commands that get skipped.

Fix-up to rdar://problem/21129029

Swift SVN r29816
2015-06-30 22:37:22 +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
Jordan Rose
9a39d71d1a [Driver] Add Job::dump.
No functionality change.

Swift SVN r29803
2015-06-30 19:31:05 +00:00
Jordan Rose
753ca13a83 [Driver] Don't assert that all Compile jobs have only one input.
...whole-module compilations obviously don't. This should fix the
PlaygroundLogger build assertion.

Swift SVN r29716
2015-06-26 00:51:39 +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
4af8295600 [Driver] Put all jobs in a single task queue.
Previously, we would process all of a job's dependencies separately before
even scheduling it, and we wouldn't interleave dependencies from different
jobs. This meant (a) more overhead than necessary, and more importantly
(b) -embed-bitcode builds weren't being parallelized.

rdar://problem/21129029

Swift SVN r29665
2015-06-25 15:45:36 +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
e40dc7fc7a [bitcode] Pass -bitcode_bundle to the linker when linking via swiftc.
...and either -embed-bitcode or -embed-bitcode-marker is passed. This is
the same behavior as Clang.

rdar://problem/20246442

Swift SVN r29387
2015-06-15 20:57:38 +00:00
Jordan Rose
6b59ff8dc5 [bitcode] Don't allow -Xcc or -Xllvm arguments to bitcode backend jobs.
This is consistent with Clang, which rejects -mllvm options. All options
Clang /does/ accept should be covered by normal Swift flags.

rdar://problem/21245117

Swift SVN r29386
2015-06-15 20:57:31 +00:00
Jordan Rose
af49aa65e0 [Driver] Don't crash when a new file is added to the build.
This was supposed to be part of r28776, but the test got truncated and then
I forgot to commit it.

rdar://problem/21012796

Swift SVN r29039
2015-05-26 23:13:37 +00:00
Erik Eckstein
b6d3472d5e Driver: fix a crash with -wmo, -num-threads, -embed-bitcode and -parseable-output.
Fixes rdar://problem/21072204




Swift SVN r28911
2015-05-22 11:19:07 +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
Jordan Rose
31b309906e [Driver] Always write a build record, even if there's only one input.
Don't just exec() a subprocess if there's more work to do when the build
finishes.

Swift SVN r28775
2015-05-19 18:25:49 +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
ac15eedafb [Bitcode Driver] we allow -parse-stdlib in BackendJobAction.
Testing case will be checked in soon.

rdar://20796819


Swift SVN r28146
2015-05-05 02:36:54 +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
David Farler
91c64fdbb1 Stop re-exporting the Objective-C library
and link it properly. This is needed to embed LLVM bitcode sections
in the standard library and overlays. The linker doesn't support
embedded bitcode and reexport flags (among others).

rdar://problem/20750099

Swift SVN r28052
2015-05-01 22:24:14 +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
Manman Ren
142f41ffb2 [Bitcode Driver] implement whitelist of compiler options for Swift.
Only white-listed options are allowed to be embedded.

This commit only affects embed_bitcode option.

rdar://20040420


Swift SVN r28004
2015-04-30 23:11:00 +00:00
Dmitri Hrybenko
c53cbc63e7 stdlib: when linking arclite, link in CoreFoundation
Arclite now depends on CoreFoundation.

rdar://problem/20735508

Swift SVN r27884
2015-04-28 22:09:59 +00:00
Manman Ren
7ae5ba82df [Bitcode Driver] make sure -embed-bitcode works with -emit-module.
With both emit-module and embed-bitcode, MergeModule will get the swiftmodule
inputs from CompileJobAction instead of BackendJobAction.

This commit should only affect Bitcode mode since it only touches how we handle
BackendJobAction which is used for Bitcode mode.

rdar://20678489


Swift SVN r27878
2015-04-28 18:43:32 +00:00
Doug Gregor
2c909b4d36 Remove Objective-C selector splitting options.
We're not going this way.

Swift SVN r27717
2015-04-25 03:59:00 +00:00
Erik Eckstein
e9d761e15b Driver: fix a crash with -wmo, -num-threads and -parseable-output.
rdar://problem/20652017



Swift SVN r27633
2015-04-23 10:23:16 +00:00
Nadav Rotem
26c62643de Silence a warning that shows up in Release builds.
Swift SVN r27333
2015-04-15 21:38:20 +00:00
Argyrios Kyrtzidis
3fd55cf69f [driver] Factor out some common code, NFC.
Swift SVN r27221
2015-04-10 23:00:31 +00:00
Argyrios Kyrtzidis
f97926f72e [driver] If '-update-code' is enabled, use 'swift-update' for the module merging action as well.
Swift SVN r27211
2015-04-10 18:26:55 +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
48abdd0881 [driver] Add some missing cases.
Swift SVN r27141
2015-04-08 22:14:00 +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