Commit Graph

202 Commits

Author SHA1 Message Date
Graydon Hoare
b8c26ef5cd [Driver] Move more temp Job sets to PerformJobsState. 2017-02-28 15:17:24 -08:00
Graydon Hoare
e81d0f4ca1 [Driver] Pass Tracer to markTransitive everywhere. 2017-02-28 15:17:24 -08:00
Graydon Hoare
053c3f8e9e [Driver] Move DepGraph and MarkTracer to PerformJobsState. 2017-02-28 15:17:23 -08:00
Graydon Hoare
aee4c83467 [Driver] Move markFinished to PerformJobsState, add logging. 2017-02-28 15:17:23 -08:00
Graydon Hoare
de2c05fa8b [Driver] Extract scheduleCommandIfNecessary and add logging. 2017-02-28 15:17:23 -08:00
Graydon Hoare
a13a0dfbba [Driver] Factor out some Job-logging support. 2017-02-28 15:17:22 -08:00
Graydon Hoare
01655789a0 [Driver] Move some function-local state into PerformJobState. 2017-02-28 13:22:20 -08:00
Hugh Bellamy
fdf261327a Return an error result if we can't set the environment variables in performSingleCommand 2017-02-15 09:30:24 +07:00
Hugh Bellamy
fc9d3bdb47 Simplify Windows Compilation::performSingleCommand implementation 2017-02-13 20:00:01 +07:00
Hugh Bellamy
f001b7562b Use relatively new LLVM_FALLLTHROUGH instead of our own SWIFT_FALLTHROUGH 2017-02-12 10:47:03 +07:00
Robert Widmann
3eba4fd3ab Merge pull request #6787 from matthewcarroll/SR-3175-Include-signal-number-in-parseable-output-message
SR-3175: Include the terminating signal number in the driver output
2017-01-18 11:00:59 -07:00
Bob Wilson
34514513fd Merge remote-tracking branch 'origin/master' into master-next 2017-01-15 17:34:17 -08:00
Matthew Carroll
c1be989c61 Fix code style 2017-01-14 12:26:14 -05:00
Graydon Hoare
3b0b8c3270 [Bridging PCH] Auto-generate and use temporary bridging PCHs from driver. 2017-01-13 15:18:40 -08:00
Matthew Carroll
5497bfb7b4 SR-3175: Include the terminating signal number in the driver output
* Add the signal number of the terminated task to the output of the driver on platforms for which the signal number is available. The new key in the parseable driver output is "signal".
* Add a test to verify that the signal number is emitted.
* Add documentation for the new "signal" key emitted in the parseable driver output.

https://bugs.swift.org/browse/SR-3175
2017-01-13 13:48:41 -05:00
Bob Wilson
c765d5e3a5 Merge remote-tracking branch 'origin/master' into master-next 2017-01-12 15:58:19 -08:00
Sean Callanan
399709ccb8 Optionally separate Tasks` stderr from stdout.
Fixes a serious problem where spurious output from xcrun breaks
swift's discovery of libarclite.

<rdar://problem/28573949>
2017-01-11 11:11:23 -08:00
Bob Wilson
37e7d1c627 Merge remote-tracking branch 'origin/master' into master-next 2017-01-08 17:07:46 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Bob Wilson
78b28243ff Merge remote-tracking branch 'origin/master' into master-next 2017-01-03 14:22:59 -08:00
practicalswift
38be6125e5 [gardening] C++ gardening: Terminate namespaces, fix argument names, ...
Changes:
* Terminate all namespaces with the correct closing comment.
* Make sure argument names in comments match the corresponding parameter name.
* Remove redundant get() calls on smart pointers.
* Prefer using "override" or "final" instead of "virtual". Remove "virtual" where appropriate.
2016-12-17 00:32:42 +01:00
Bob Wilson
deddf19aae Merge remote-tracking branch 'origin/master' into master-next 2016-12-13 10:23:03 -08:00
Michael Gottesman
59c6a64f5a [gardening] 0 => nullptr. Fixed with clang-tidy. 2016-12-06 23:14:13 -08:00
Saleem Abdulrasool
2f21735256 adjust for SVN r286524 and SVN r287369
Groups are required for Timers after SVN r286524.  SVN r287369 requires that
timers have short names and long descriptions.  Adjust the API usage
accordingly.  Reorder some words to make some more sense as a description.
2016-12-04 19:35:30 -08:00
Bob Wilson
13da3fa8b1 Merge remote-tracking branch 'origin/master' into master-next 2016-12-04 18:16:09 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Brian Gesiak
fc1c81f500 [Frontend] Preserve .swiftdeps files
The Swift compiler uses files with an extension of ".swiftdeps" to store
information about cross-file dependencies. These files are read in at the
start of compilation to compute a dependency graph, and updated as compilation
proceeds. However, because these files are updated on every build, an
issue with dependency analysis is hard to reproduce—the inputs have been
lost.

Address this by renaming swiftdeps files that are about to be
overwritten, to '.swiftdeps~'. This preserves dependency information
from the most recent compilation (but no further back).
2016-11-16 22:51:05 -05:00
Bob Wilson
956c7150d5 Tweak my previous changes for reading and writing times.
As far as I know, the previous code worked OK but this version seems
cleaner.
2016-11-09 10:40:40 -08:00
Bob Wilson
5c4f517824 Checkpoint fixes for llvm r284966 (TimeValue) 2016-10-28 12:09:57 -07:00
Graydon Hoare
8970d44675 Add "-swift-version <n>" that sets LangOpts.EffectiveLanguageVersion.
This flag switches the "effective language version" of the compiler,
at least to any version supported (as of this change: "3" or "3.0").

At the moment nothing uses it except the language version build
configuration statements (#if swift(...)) and various other places
that report, encode, or otherwise check version numbers.

In the future, it's intended as scaffolding for backwards compatibility.

Fixes SR-2582
2016-09-20 15:11:37 -07:00
Brian Gesiak
2b3647efc4 [Driver] Move .swiftdeps strings (NFC)
Define compilation record (.swiftdeps) top-level keys, as well as string
identifiers used in compilation record files (like "!dirty" and "!private"), in
a single location. NFC.
2016-08-30 12:30:14 -04:00
Brian Gesiak
ba8009bfa3 [SR-1788] Add -driver-time-compilation option (#4367)
Add an option to print the time it takes each driver task to complete.

Here's an example of the output:

```
$ swiftc -driver-time-compilation \
         -emit-library -module-name Crispix \
         Crispix/A.swift Crispix/B.swift Crispix/C.swift
===-------------------------------------------------------------------------===
                           Driver Time Compilation
===-------------------------------------------------------------------------===
  Total Execution Time: 0.0000 seconds (0.0875 wall clock)

   ---Wall Time---  --- Name ---
   0.0245 ( 28.0%)  link /path/to/Crispix/A.swift /path/to/Crispix/B.swift /path/to/Crispix/C.swift
   0.0211 ( 24.1%)  compile /path/to/Crispix/A.swift
   0.0209 ( 23.9%)  compile /path/to/Crispix/B.swift
   0.0176 ( 20.1%)  compile /path/to/Crispix/C.swift
   0.0035 (  4.0%)  swift-autolink-extract /path/to/Crispix/A.swift /path/to/Crispix/B.swift /path/to/Crispix/C.swift
   0.0875 (100.0%)  Total
```
2016-08-23 13:35:48 -07:00
Jordan Rose
c9c0df2e55 [Driver] Address Brian G's feedback on 848b3eb. (#4046)
No functionality change.
2016-08-05 17:26:03 -07:00
Jordan Rose
b8cc2673c3 [Driver] Remove debugging code from 848b3eb.
Thanks, Dmitri.
2016-08-03 11:15:49 -07:00
Jordan Rose
848b3eb6a3 [Driver] Make sure to rebuild dependents when a dirty file fails. (#3935)
Otherwise we get into a situation like this:

1. Change made to the interface of file A.swift that also causes an
   error in A.swift.
2. Fixing the error in A.swift does not affect A.swift's interface.
3. File B.swift that depends on A.swift is not rebuilt, since the most
   recent change to A.swift did not change its interface.

To fix this, mark downstream files as needing to be rebuilt even when
a compilation job fails with errors. Additionally, attempt to be extra
conservative when there's a crash.

rdar://problem/25405605
2016-08-02 19:07:29 -07:00
Han Sangjin
cccfbf4d3c [swiftc/msvc] Compiling with MSVC (#1516)
Some modifications for the ms-extension option of the clang.exe in the Visual Studio 2015 development environment

This patch is only for swiftc.exe. I used the library set of Visual Studio 2015 Update 1 and recent version of swift-clang as the compiler. If you are using the real MSVC compiler, more patch might be required.
2016-07-08 19:06:10 -07:00
Jordan Rose
bbc14afd04 [Driver] Write per-job filelists even under -save-temps.
Same as the previous commit; here's a test case that triggers it.

Last bit of https://bugs.swift.org/browse/SR-280.
2016-01-13 18:41:05 -08:00
Jordan Rose
ce34ed593c [Driver] Use filelists for the *output* of a threaded WMO build.
This is only the driver side of the work; the frontend doesn't understand
this new -output-filelist option yet. Next commit.

More https://bugs.swift.org/browse/SR-280.
2016-01-13 18:39:24 -08:00
Jordan Rose
3328a30ea8 [Driver] Write the all-sources file even under -save-temps.
We optimize subprocess invocation to a simple execve() if there's no
cleanup work to do, but that doesn't get us out of doing /setup/ work.
2016-01-13 18:39:24 -08:00
Jordan Rose
6067120f81 [Driver] Emit filelists for Jobs that want them (inputs).
This is the other half of the previous commit: we can use -filelist for
linking on Darwin.

More https://bugs.swift.org/browse/SR-280.
2016-01-13 18:39:24 -08:00
Jordan Rose
f8bb54f6e6 [Driver] Pass around 'const char *' instead of 'const std::string &'.
No functionality change -- lifetime extension is handled by the
ArgumentList already owned by the Compilation.
2016-01-13 18:39:24 -08:00
Jordan Rose
fe00083eb1 [Driver] Actually write out the source file list file.
This is simply a newline-separated list of files, matching the format
from Darwin ld's -filelist option.

Part 2 of https://bugs.swift.org/browse/SR-280.
2016-01-12 19:20:50 -08:00
Jordan Rose
b45a69ef09 [Driver] Allow passing all source files in a filelist.
Generate frontend commands with -filelist in them. This isn't actually
implemented yet, but we can start testing at this point.

Part 1 of https://bugs.swift.org/browse/SR-280.
2016-01-12 19:20:50 -08:00
Jordan Rose
7be3effeed [Driver] Remove an unused accessor.
No one should be accessing the raw input argument list; it's there merely
to keep the info about the derived argument list alive.
2016-01-12 16:17:27 -08:00
Jordan Rose
7552d49c4a [Driver] Eliminate unused fields from Compilation.
No functionality change.
2016-01-12 16:17:27 -08:00
Jordan Rose
5f78d24e85 [Driver] Make the list of input files available when creating Jobs.
Previously jobs had to grovel this information out of the raw argument
list, which dropped the types we had inferred on input files. This
makes things more consistent across the compiler, though arguably we
should be able to designate "primary" and "non-primary" inputs on a
per-action basis rather than resorting to "global" state.

Use this new information to stop passing object file inputs to the
Swift frontend, fixing rdar://problem/23213785.

The list wouldn't have to live on the Compilation, but I'm going to use
it to fix SR-280 / rdar://problem/23878192 as well.
2016-01-12 11:52:31 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Jordan Rose
16a647249d [Driver] Actually set extra environment variables in single-command mode.
Implementing this for the general case either requires duplicating the
existing environment, or modifying TaskQueue to support "extra environment"
settings. Since we don't actually have any use cases for this yet, I'm
leaving it unimplemented for now.

Rest of rdar://problem/23588774
2015-12-04 12:18:47 -08:00
jonnyla
20f7d0947e Improved grammar
removed unnecessary 'so'
2015-12-03 21:58:19 -08:00
Jordan Rose
c403aedbb1 [Driver] Use Swift's shim for std::is_trivially_copyable.
Our libstdc++ doesn't have it yet.

rdar://problem/23387657
2015-11-03 19:38:41 -08:00