Commit Graph

1784 Commits

Author SHA1 Message Date
Jordan Rose
a214f0b39b Fix call to llvm::opt::OptionTable::PrintHelp (#16269)
The signature here changed, but the old arguments implicitly converted
to the parameter types for the wrong overload, so we didn't notice.
Add a simple test that would have at least caught this for the driver.
2018-05-02 16:54:10 -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
Huon Wilson
d4f49a1252 [IDE] std::function -> llvm::function_ref for some non-escaping params. 2018-05-01 08:29:06 +10:00
David Ungar
2b89d1cf1b Instead of crashing for bad output-file-map path, exit. Also print the path in the diagnostic. 2018-04-24 11:53:52 -07:00
Ben Langmuir
8ea2d0dded [BatchMode] Avoid spurious warnings in sourcekitd and indexing
Explicitly disable batch mode in createCompilerInvocation, since it uses
-force-single-frontend-invocation.  Previously we were getting spurious
warnings.  Also add a test that -disable-batch-mode will allow commands
that use -index-file to avoid the same warning, since that is likely
what they want to do as well.

rdar://39581506
2018-04-20 11:28:13 -07:00
Jordan Rose
e1b70cdb7b Merge pull request #15813 from jrose-apple/decremental
[Driver] Disallow -autolink-force-load with -incremental
2018-04-19 14:20:41 -07:00
swift-ci
ea39ceae79 Merge pull request #15999 from graydon/rdar-39504759-keep-demultiplexing-after-first-read 2018-04-18 14:18:48 -07:00
Graydon Hoare
c1682fa465 [Driver] <rdar://39504759> Continue demultiplexing subprocess output after initial read. 2018-04-18 11:52:11 -07:00
Thomas Roughton
5bb6ac2e12 Implement a Windows toolchain. 2018-04-18 15:26:05 +12:00
Jordan Rose
c3d8fc0254 [Driver] Break up validateArgs() into several helper functions
No functionality change.
2018-04-16 20:01:25 -07:00
Argyrios Kyrtzidis
b6a8725ba5 Remove unnecessary newline whitespace 2018-04-12 19:45:51 -07:00
Argyrios Kyrtzidis
8207212f0b [driver/index] Fix an issue where the -index-file invocation was not working when there are 5 or more input files
When the supplementary-outputs file is written for an -index-file invocation it writes out the first input file
given in arguments instead of the input file that is provided by -index-file-path option. This then causes the frontend
index invocation to fail with an error because there is a mismatch in the primary input file and the input file that is written
in the supplementary-outputs file.
2018-04-12 19:37:44 -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
Jordan Rose
36150a8696 [Driver] Disallow -autolink-force-load with -incremental
6af333f3 changed the implementation of -autolink-force-load to only
generate one symbol, but the /placement/ of that one symbol depends on
the order of input files, and -incremental supports adding a file
without rebuilding all other files. We don't have any need for these
two to play nice together right now, so just disallow it.
2018-04-06 20:06:24 -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
a055d46489 Merge pull request #15578 from davidungar/PR-19-warn-WMO-batch
[Batch mode] Warn the user if -enable-batch-mode gets overridden by -whole-module-optimization or -index-file.
2018-03-28 19:20:03 -07:00
David Ungar
43b89133af Warn if explicit batch mode is overridden. 2018-03-28 17:31:34 -07:00
swift-ci
af38053775 Merge pull request #15531 from graydon/sort-jobs-dont-assert 2018-03-28 14:50:46 -07:00
Graydon Hoare
af538f1321 [BatchMode] Sort batch inputs rather than asserting; they are not always sorted. 2018-03-28 09:25:10 -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
swift-ci
b8b3144772 Merge pull request #15388 from lanza/merge-grlp 2018-03-22 13:39:19 -07:00
David Ungar
807dd5864e Renamed swift::types to swift::file_types. 2018-03-22 08:40:06 -07:00
Nathan Lanza
21f7d87eac Merge getRuntimeLibraryPath and getRuntimeStaticLibraryPath
These two functions are duplicates except for one string. Merge them and
add an argument for whether we want static or shared.
2018-03-22 01:19:40 -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
David Ungar
a0cd1c57bc Merge pull request #15013 from davidungar/PR-18-11-fileMap
[Batch mode] Write supplementary output file map. rdar://problem/38157859
2018-03-16 17:38:53 -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
David Ungar
3a0acdaf0c Fix supplementary output filemap generation to account for CommandOutput. 2018-03-15 21:28:56 -07:00
David Ungar
3752fda967 Undo buildInputs index hack 2018-03-15 15:28:59 -07:00
David Ungar
3c9139b8e7 Typo fix for -emit-objc-header-path. 2018-03-15 15:24:54 -07:00
David Ungar
9dcbaa38f7 Factor out writeOutputFileMap 2018-03-15 13:54:43 -07:00
David Ungar
3051fddb8d Remove overfactoring and restore symmetry for -emit-objc-header-path 2018-03-15 13:23:25 -07:00
David Ungar
a81c995e93 OutputFileMap type fix. 2018-03-14 22:52:51 -07:00
David Ungar
498366c91c Small cosmetic fixes. 2018-03-14 21:17:08 -07:00
David Ungar
09a80cbbe3 Return an Optional OutputFileMap instead of a unique pointer. 2018-03-14 20:19:13 -07:00
David Ungar
3b57ae80ae Fix comments and names 2018-03-14 15:21:04 -07:00
David Ungar
e499aeda9b Redo force repartion flag and add a test. 2018-03-13 17:20:12 -07:00
David Ungar
5dc4a915b4 Fix SourceKit/CodeComplete/complete_playground_symlink.swift test.
Don't filter inputs by type for SingleCompile.
2018-03-13 07:59:08 -07:00
David Ungar
fdf1d2bdc6 Fix index. 2018-03-12 21:27:42 -07:00