Commit Graph

124 Commits

Author SHA1 Message Date
David Ungar
2f65ac3735 Cosmetic cleanups 2019-01-30 17:16:49 -08:00
David Ungar
3d8779efba Fix print bugs unfmt 2019-01-26 21:47:52 -08:00
David Ungar
9d84bc2af1 WIP tracer 2019-01-26 09:36:40 -08:00
David Ungar
323c42c532 Fomat 2019-01-24 18:46:49 -08:00
David Ungar
b520b242dc Collapsed lots of changes. 2019-01-24 18:46:49 -08:00
Adrian Prantl
ff63eaea6f Remove \brief commands from doxygen comments.
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

      for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
2018-12-04 15:45:04 -08:00
David Ungar
1f4dfce598 Add -enable-experimental-dependencies and push it through. 2018-10-28 00:39:36 -07:00
Graydon Hoare
0f26b9c12d [Driver] <rdar://43955209> Remove obsolete/fragile batch mode 'repartitioning' code. 2018-10-09 13:31:41 -07:00
Jordan Rose
e224e31720 Break almost all dependencies of Driver on Frontend
- Sink OutputFileMap{.h,.cpp} and ReferenceDependencyKeys.h to Basic
- Remove unnecessary includes of Frontend.h.
2018-08-27 20:47:58 -07:00
Graydon Hoare
d5a9f44e4a [BatchMode] <rdar://41271283> Limit memory pressure on large modules. 2018-07-30 17:26:31 -07: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
Graydon Hoare
8be2c53b24 [BatchMode] Add -driver-batch-count to allow overriding batch count inferred by -j 2018-06-14 11:51:31 -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
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
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
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
David Ungar
17a81f6981 Restore -### functionality for batch-mode by extending OutputLevel. 2018-03-05 11:07:20 -08:00
Graydon Hoare
263c4c54d5 [BatchMode] Preserve intra-batch order, add a seed mode. 2018-02-20 18:31:41 -08:00
Graydon Hoare
3d9ce0afb9 [BatchMode] Store -{enable,disable}-batch-mode as a flag in Compilation. 2018-02-15 15:38:09 -08:00
Graydon Hoare
798f43cf5f [BatchMode] Make Compilation::TheToolChain available to clients. 2018-02-15 15:38:08 -08:00
Graydon Hoare
a2c718777d [BatchMode] Pass OutputInfo to Compilation on construction. 2018-02-15 15:38:08 -08:00
Graydon Hoare
e03e61a32a [BatchMode] Add Compilation::DerivedOutputFileMap. 2018-02-09 14:06:22 -08:00
Graydon Hoare
36b7c76fde [BatchMode] Mark Compilation::TheToolChain as LLVM_ATTRIBUTE_UNUSED for now. 2018-02-09 14:06:16 -08:00
Graydon Hoare
d139ab2968 [BatchMode] Expand lifetime of ToolChain, pass reference to it to Compilation. 2018-01-24 10:31:19 -08:00
Jordan Rose
47872d9190 [Driver] Transfer all ownership of Actions to the Compilation.
Previously, Actions were responsible for freeing their inputs...
except for the ones that weren't. Or the ones that were supposed
to, but then they needed to share an input, so they couldn't anymore.
If this sounds ridiculous, you're right; now Actions are just
immediately allocated and owned by the Compilation.

The graph structure of the actions is still useful for some things; in
particular, "top-level" actions get to put their outputs somewhere
permanent rather than TMPDIR. But I expect these things to get cleaned
up in the future too.
2017-08-11 21:09:34 -07:00
Jordan Rose
64df9b1edc [Driver] Actually free Actions instead of just leaking them.
Fixes rdar://problem/32518867, though in a fairly messy way. Next
commit will clean this up again.
2017-08-11 21:09:34 -07:00
Jordan Rose
a875d8c7c7 [Driver] Preserve filelists when a subprocess crashes. (#9849)
This should make it easier to rerun crashed jobs that use filelists;
previously you'd have to run the top-level driver command again with
-save-temps. I didn't want to save /all/ temporary files because that
often includes things like .o files, which could fill up your disk
pretty quickly. But we can always tweak this later.
2017-05-22 17:14:20 -07:00
Huon Wilson
7e8568d03d [Driver] Main compiler tells frontend to -emit-loaded-module-trace. 2017-04-21 11:14:29 -07:00
Graydon Hoare
0245c83c4b [Stats] Add -stats-output-dir, wire UnifiedStatsReporter into place. 2017-04-03 18:08:59 -07:00
Graydon Hoare
ec5d4f3ea1 [Driver] Put new job-lifecycle diagnostic chatter behind another option. 2017-03-01 09:07:21 -08:00
Graydon Hoare
ab5201f60e [Driver] Make PerformJobsState a mostly-private class. 2017-02-28 15:17:26 -08:00
Graydon Hoare
01655789a0 [Driver] Move some function-local state into PerformJobState. 2017-02-28 13:22:20 -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
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
Bob Wilson
5c4f517824 Checkpoint fixes for llvm r284966 (TimeValue) 2016-10-28 12:09:57 -07: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
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
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
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