Commit Graph

412 Commits

Author SHA1 Message Date
Huon Wilson
103170bcbb Merge pull request #17688 from huonw/merging-tbd
Allow TBD files to be generated in non-wmo mode
2018-07-20 09:44:50 +10:00
Huon Wilson
9dab667544 [Driver] Make the TBD file behave more like a normal auxiliary output. 2018-07-20 08:12:22 +10:00
Robert Widmann
81e9a3f660 [NFC] Drop PerformJobsState as a friend class
Make the coupling between PerformJobsState and Compilation indirect.
2018-07-10 14:57:01 -07:00
David Ungar
794a3d748d Merge pull request #16669 from davidungar/refdep-refactor
NFC, [Incremental Compilation] Refactor ReferenceDependencies
2018-06-22 10:14:36 -07:00
Jordan Rose
7d8e40b0bb Merge pull request #16362 from dabelknap/frontend_responsefile
Wrap Command Line Arguments in a Response File if System Limits are Exceeded

https://bugs.swift.org/browse/SR-4517
2018-06-21 16:31:20 -07:00
David Ungar
a14a87350b Remove murky reference to Makefile .d dependencies. 2018-06-20 17:24:45 -07:00
Ellis Hoag
c93a5a5776 Add -debug-info-format=[dwarf|codeview] option (#16888) 2018-06-20 09:52:57 -07:00
David Ungar
2824b621a8 Fix comment for ExternalDependencies 2018-06-19 17:04:15 -07:00
Austin Belknap
9d51350ed8 Use an ArrayRef insead of a const reference. 2018-06-19 11:33:45 -07:00
Austin Belknap
f6b5cf5b7c Further clarify the purpose of "allowsResponseFiles" flag. 2018-06-15 16:14:07 -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
e65cb234ff Remove reference to vector in the comment. 2018-06-15 15:15:37 -07:00
David Ungar
8c2f733152 Address review comments. 2018-06-15 14:29:30 -07:00
David Ungar
d2e5239b00 Add sentences clarifying “external” dependencies. 2018-06-15 11:12:25 -07:00
Jordan Rose
8d43ec3ad7 Merge pull request #17087 from allevato/dwarf-command-line-flags
Make DWARF debug flag behavior match Clang.
2018-06-15 09:52:26 -07:00
Graydon Hoare
8be2c53b24 [BatchMode] Add -driver-batch-count to allow overriding batch count inferred by -j 2018-06-14 11:51:31 -07:00
Tony Allevato
0acc73ae4c Update flag name to -debug-info-store-invocation. 2018-06-12 18:32:35 -07:00
Tony Allevato
22ac700154 Make DWARF debug flag behavior match Clang.
Only write the compilation flags to debug info for Mach-O targets, and only
if the RC_DEBUG_OPTIONS environment variable is set.
2018-06-09 20:05:06 -07:00
Robert Widmann
da13d89c24 Move DummyQueue logic into buildTaskQueue 2018-05-29 21:58:27 -07:00
Robert Widmann
d7493dd0fa [NFC] Expose the TaskQueue as a Compilation Parameter
Shuffle the responsibility for creating the TaskQueue out of the
Compilation's internal job state object and into the driver.  Expose
a builder convenience function that handles the argument parsing.
2018-05-29 21:58:27 -07:00
Benjamin Herzog
ac10fb3462 [Driver] Added process information to emitted messages
When providing the -parseable-output flag to the swift compiler, it will provide json formatted messages about tasks that run.
I added some optional usage information in form of user time, system time and maxrss to the output. This can be used by other tools using the compiler to get some insights about time and memory usage.
Since the output does not longer match processes run (in batch mode), I also added a real_pid field so the client could reason about jobs that belong together if needed.

rdar://39798231
2018-05-25 13:12:57 -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
fe4f21d3ca Elaborate on the allowsResponseFiles flag. 2018-05-16 13:42:28 -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
2297f75c4a Move the "allowsResponseFiles" flag to the ToolChain. 2018-05-11 15:21:25 -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
Thomas Roughton
0506ccc244 Refactor ToolChains into separate files. (#16091)
Format the code and factor together some common functionality at the same time.
2018-05-02 11:11:54 -07:00
Argyrios Kyrtzidis
0682756a72 Merge pull request #15743 from nathawes/rdar38231888-sourcekit-error-when-parsing-the-compiler-arguments
[Driver] Add -driver-filelist-threshold to set the number of inputs beyond which filelists are used
2018-04-12 19:10:40 -07:00
Nathan Hawes
0a4204e99f [Driver] Add -driver-filelist-threshold to set the number of inputs beyond which filelists are used
When generating a compiler invocation in driver::createCompilerInvocation()
we end up using filelists if the number of inputs is > 128 (to work around
command line arg limits). We never actually write them out though, and so
fail when parsing the frontend arguments that reference them.

As this function is called frequently by SourceKit and command line limits
aren't a concern here, this patch makes the 128 threshold value configurable
via a new -driver-filelist-threshold option. This is set to its maximum value
in driver::createCompilerInvocation() to ensure filelists aren't used. This
new option makes the existing -driver-use-filelists (that forces filelists to
be used) redundant as it's now equivalent to -driver-filelist-threshold=0.

Resolves rdar://problem/38231888
2018-04-12 05:24:03 -07:00
David Ungar
906e1cadc3 Add some "consts" to the Driver. 2018-04-06 18:47:48 -07:00
Graydon Hoare
a9916dfd23 [BatchMode] Address review comments. 2018-04-04 16:29:02 -07:00
Graydon Hoare
0b4e7db476 [BatchMode] Consolidate reasoning about -{enable,disable}-batch-mode flag.
Previous to this change, the initial inspection of the -{enable,disable}-batch-mode
flag was made separate from the subsequent overriding by -wmo; this in turn meant
that the driver might decide it's "in batch mode" in one place (in particular,
when judging whether to ignore the -num-threads flag) and "in wmo mode" elsewhere
(when judging whether to emit one or multiple outputs, which depends on the
-num-threads flag).

Divergence between these two views caused the driver to effectively drop
the -num-threads flag even when overriding batch mode with wmo; since xcode
assumes that passing -wmo -num-threads _will_ cause multiple outputs, this
in turn caused linking to fail since the expected output files were not found.
2018-04-04 15:21:12 -07:00
Rintaro Ishizaki
2cec8dfc99 [Driver] Factor out build-record filename construction
* Retrive filename for read and write at the same time.
* Read LastBuildTime directly from the build record.
2018-04-03 20:39:55 +09:00
Rintaro Ishizaki
18ceef56e3 [Driver] Use separated build record file for '-emit-module' only mode
* In full compilation '-c' with '-emit-module', output duplicated build
  record file for full compilation *and* emit module ('~moduleonly') mode.
* In '-emit-module' only mode, use '~moduleonly' build record.
2018-04-02 21:04:13 +09:00
David Ungar
43b89133af Warn if explicit batch mode is overridden. 2018-03-28 17:31:34 -07:00
David Ungar
4fa3001bd1 Harden compiler against -num-threads and -enable-batch-mode. 2018-03-26 17:04:31 -07:00
David Ungar
f8f9dca9a3 Merge pull request #15446 from davidungar/PR-18-14-ActionClass
NFC: Use enum class for ActionClass.
2018-03-23 18:16:20 -07:00
David Ungar
a3ee808bfe Use enum class for ActionClass. 2018-03-23 13:15:35 -07:00
Sho Ikeda
1508b6f131 [gardening][Driver] Replace typedef with using 2018-03-23 19:14:50 +09:00
David Ungar
807dd5864e Renamed swift::types to swift::file_types. 2018-03-22 08:40:06 -07:00
David Ungar
e3535ff3d8 Merge pull request #15371 from davidungar/PR-18-11-fileMap-redo
[Batch mode] Write out filemaps for supplementary outputs.
2018-03-21 17:05:36 -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
Pavel Yaskevich
fd3610b8c0 Revert "[Batch mode] Write supplementary output file map. rdar://problem/38157859" 2018-03-17 21:01:46 -07:00
Graydon Hoare
f5d43e2df9 Merge pull request #15309 from graydon/improve-comment-on-commandoutput
[Driver] Clarify comment on CommandOutput::Inputs.
2018-03-17 13:24:31 -07:00
Graydon Hoare
fce5ed3a24 [Driver] Clarify comment on CommandOutput::Inputs. 2018-03-16 15:17:28 -07:00
David Ungar
caf5cbd0bb Review fixes, some cosmetic, some clarifications, one for an improbable situation. 2018-03-16 13:43:37 -07:00
David Ungar
919c224d5a Handle index file path differently. 2018-03-15 22:00:16 -07:00
David Ungar
1999cbc514 Rename addFrontendInputArguments. 2018-03-15 21:31:31 -07:00