Commit Graph

54 Commits

Author SHA1 Message Date
Varun Gandhi
65577940d0 [NFC] Get rid of -Wrange-loop-analysis warnings. (#31324) 2020-04-27 09:47:52 -07:00
Fred Riss
259d78a350 Adapt to llvm.org StringRef API change 2020-03-13 19:08:22 +01:00
David Ungar
cc89dad526 Fine-grained and driver fixes.
Restructure fine-grained-dependencies to enable unit testing

Get frontend to emit correct swiftdeps file (fine-grained when needed) and only emit dot file for -emit-fine-grained-dependency-sourcefile-dot-files

Use deterministic order for more information outputs.

Set EnableFineGrainedDependencies consistently in frontend.

Tolerate errors that result in null getExtendedNominal()

Fix memory issue by removing node everywhere.

Break up print routine

Be more verbose so it will compile on Linux.

Sort batchable jobs, too.
2020-01-11 21:57:14 -08:00
Saleem Abdulrasool
b483047afe Revert "[Incremental] Dependency fixes in preparation for fine-grained dependencies" 2020-01-09 19:14:47 -08:00
David Ungar
6fffe724f2 Fine-grained and driver fixes.
Restructure fine-grained-dependencies to enable unit testing

Get frontend to emit correct swiftdeps file (fine-grained when needed) and only emit dot file for -emit-fine-grained-dependency-sourcefile-dot-files

Use deterministic order for more information outputs.

Set EnableFineGrainedDependencies consistently in frontend.

Tolerate errors that result in null getExtendedNominal()

Fix memory issue by removing node everywhere.

Break up print routine

Be more verbose so it will compile on Linux.

Sort batchable jobs, too.
2020-01-04 14:37:06 -08:00
David Ungar
2a79331ac3 add -enable/disable-only-one-dependency-file flag, on by default 2019-12-18 16:07:51 -08:00
David Ungar
742c3985bd Source-range-based dependencies
Frontend outputs source-as-compiled, and source-ranges file with function body ranges and ranges that were unparsed in secondaries.
Driver computes diffs for each source file. If diffs are in function bodies, only recompiles that one file. Else if diffs are in what another file did not parse, then the other file need not be rebuilt.
2019-11-12 20:41:02 -08:00
Harlan Haskins
21bd24a150 Revert "[Driver] Load the standard library before starting parallel frontend invocations"
This failed the source compat suite, it seems we need more driver
changes for this.
2019-07-12 21:38:23 -07:00
Harlan Haskins
7022110a05 [Driver] Load the standard library before starting parallel frontend invocations
Add a new action, LoadModuleJobAction, that the driver can use to schedule a
load of a given module before we fan out and invoke the frontend multiple
times. This gives the module interface loader a chance to compile it from a
module interface before we start with parallel invocations, avoiding starting
potentially dozens of redundant compiles of a large module. Start by using this
on the standard library.

Quick fix for rdar://52839445
2019-07-12 14:53:25 -07:00
Tony Allevato
6d7223023d Fix response file support for batch jobs. 2019-04-13 10:06:30 -07:00
David Ungar
7792179925 Fix spaces in filenames in response files. 2018-09-13 22:17:34 -07:00
Austin Belknap
d6ec8fad74 Replace accessor methods in getArgumentsForTaskExecution. 2018-06-19 13:26:35 -07:00
Austin Belknap
9d51350ed8 Use an ArrayRef insead of a const reference. 2018-06-19 11:33:45 -07:00
Austin Belknap
d71373c95c Encapsulate the logic for returning a response file or the full arg vector. 2018-06-15 15:16:35 -07:00
Austin Belknap
3fe62b94e7 Reformat verbose and stack trace printouts for response-files. 2018-05-23 11:05:20 -07:00
Austin Belknap
2a30e25504 Only keep a "const char*" for the response file argument. 2018-05-18 13:48:09 -07:00
Austin Belknap
2b5e3c7adc Reuse existing string-escaping code, and use raw_fd_ostream. 2018-05-14 10:06:53 -07:00
Austin Belknap
da19625711 Merge branch 'master' into frontend_responsefile 2018-05-11 14:11:34 -07:00
Graydon Hoare
39fdf5d4e5 [BatchMode] <rdar://39981525> Emit parseable output for each job, using quasi-PIDs. 2018-05-10 20:34:33 -07:00
Austin Belknap
59769014fc Wrap command line arguments in a response file if they exceed system limits. 2018-05-03 14:09:07 -07:00
David Ungar
807dd5864e Renamed swift::types to swift::file_types. 2018-03-22 08:40:06 -07:00
David Ungar
90773d298c Write out filemaps for supplementary outputs.
Add -driver-force-one-batch-repartition and enhance  batch_mode-overlong_argv test.
2018-03-20 09:42:13 -07:00
Graydon Hoare
45c78c4f7d [BatchMode] Add a pile of asserts to CommandOutput. 2018-02-28 14:07:25 -08:00
Graydon Hoare
8ceeecc33c [BatchMode] Actually wire-up the part that pushes multiple aux output args. 2018-02-24 00:45:23 -08:00
Graydon Hoare
21319c0d4d [Driver] cleanup: elide over-long output lists, use StringRefs. 2018-02-20 14:45:54 -08:00
Graydon Hoare
83aeb39895 [BatchMode] Add CommandOutput::addOutputs and hasSameAdditionalOutputTypes. 2018-02-15 15:37:55 -08:00
Graydon Hoare
6132f18994 [BatchMode] Add virtual destructor to Job. 2018-02-15 15:15:34 -08:00
Graydon Hoare
f9d7bd2584 [BatchMode] Add PrettyStackTrace helpers to Driver. 2018-02-09 14:10:46 -08:00
Graydon Hoare
ef61f721d4 [BatchMode] Change all CommandOutputs to use a shared OutputFileMap. 2018-02-09 14:08:50 -08:00
Graydon Hoare
10c0abea5d [BatchMode] Add BatchJob subclass of Job, for use with BatchModeCompile. 2018-01-24 10:31:19 -08:00
practicalswift
492f5cd35a [gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar)
Replace `NameOfType foo = dyn_cast<NameOfType>(bar)` with DRY version `auto foo = dyn_cast<NameOfType>(bar)`.

The DRY auto version is by far the dominant form already used in the repo, so this PR merely brings the exceptional cases (redundant repetition form) in line with the dominant form (auto form).

See the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es11-use-auto-to-avoid-redundant-repetition-of-type-names) for a general discussion on why to use `auto` to avoid redundant repetition of type names.
2017-05-05 09:45:53 +02:00
Graydon Hoare
a13a0dfbba [Driver] Factor out some Job-logging support. 2017-02-28 15:17:22 -08:00
Hugh Bellamy
f001b7562b Use relatively new LLVM_FALLLTHROUGH instead of our own SWIFT_FALLTHROUGH 2017-02-12 10:47:03 +07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01: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
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00: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
9a39d71d1a [Driver] Add Job::dump.
No functionality change.

Swift SVN r29803
2015-06-30 19:31:05 +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
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
Jordan Rose
c4fd29eb0b [Driver] Eliminate the common base class of Command and JobList.
...and rename Command to Job (previously the name of the base class).

We never generated job lists directly contained in other job lists, so
let's not even worry about this case. We may some day need to break Job
out into separate subclasses (Clang has Command and FallbackCommand in
addition to JobList), but we should be able to keep the list separate.

No intended functionality change.

Swift SVN r23144
2014-11-07 00:10:18 +00:00
Connor Wakamo
6cf30215ae Added support for specifying the terminator used by Command::printCommandLine.
This defaults to "\n", so this is NFC for existing clients.

Swift SVN r20848
2014-07-31 21:19:56 +00:00
Jordan Rose
3bebef4d29 Pass options to LLDB's REPL.
This is the rest of <rdar://problem/16776705>

Swift SVN r17820
2014-05-10 01:17:39 +00:00
Ted Kremenek
c87ac8167a Use SWIFT_FALLTHROUGH instead of [[clang::fallthrough]].
Swift SVN r15028
2014-03-14 05:15:05 +00:00
Ted Kremenek
39a368f0ec Add [[clang::fallthrough]] in obvious cases to satisfy -Wimplicit-fallthrough.
Swift SVN r15018
2014-03-14 00:34:25 +00:00
Dmitri Hrybenko
f73dd27e83 StringRef'ize escapeAndPrintString
Swift SVN r13911
2014-02-14 16:00:44 +00:00
Connor Wakamo
d7e13970c0 [driver] Made Command::printCommandLine() escape its strings.
This uses roughly the same rules as Clang’s support for escaping strings in its Command class.

Swift SVN r13254
2014-02-01 00:22:41 +00:00
Connor Wakamo
49d8d07224 [driver] Moved Command printing into Command::printCommandLine().
This was previously implemented in both Compilation::performJobsInList() and printJob().

Swift SVN r13253
2014-02-01 00:22:41 +00:00
Jordan Rose
9cb81b0006 [driver] Add support for invoking ld.
swift_driver can now end-to-end compile a Swift file. Try it yourself!

echo 'println("hello")' | swift_driver -

Swift SVN r12840
2014-01-23 02:11:47 +00:00
Jordan Rose
c101e360a9 [driver] Use "const std::string &" instead of StringRef.
…for strings required to be null-terminated.

Swift SVN r12790
2014-01-22 21:56:24 +00:00