Commit Graph

493 Commits

Author SHA1 Message Date
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
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
Nathan Hawes
42b22fbe38 [migrator] Add -api-diff-data-dir option to override the default location for the migrator's platform + version specific api diff json files
This is useful for testing the migrator with different versions of the api diff data.
2018-05-31 09:23:24 -07:00
Huon Wilson
60ae475ca0 [IRGen] Make -emit-public-type-metadata-accessors a no-op.
This work-around is no longer needed now that the full fix landed in
https://github.com/apple/swift/pull/16615. The argument is left with a warning
to help with migration between compilers with the work-around and compilers with
the full fix (see also rdar://problem/40502379).

Fixes rdar://problem/40476573.
2018-05-24 09:37:35 +10:00
Doug Gregor
20832fd2c5 Add -emit-public-type-metadata-accessors to work around metadata linkage bug.
IRGen can introduce calls to type metadata accessors for types that
should not be visible to the current translate, which can manifest in
linker errors within a module (for references to private types when
whole module optimization is disabled) or across modules (for
references to private/internal types in another module). Introduce a
new compiler flag `-emit-public-type-metadata-accessors` that emits
all type metadata accessors with public linkage, to work around the
problem in affected projects. This flag is intended to go away once we
have a proper solution.

This bug has been around in Swift "forever", but compiling the
overlays using -enable-resilience has exacerbated the problem and
caused regressions. This is a short-term fix to
rdar://problem/40229755 while we work on the correct long-term fix.
2018-05-14 17:09:14 -07:00
Austin Belknap
2297f75c4a Move the "allowsResponseFiles" flag to the ToolChain. 2018-05-11 15:21:25 -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
Thomas Roughton
5bb6ac2e12 Implement a Windows toolchain. 2018-04-18 15:26:05 +12: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
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
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
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
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
3c9139b8e7 Typo fix for -emit-objc-header-path. 2018-03-15 15:24:54 -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
498366c91c Small cosmetic fixes. 2018-03-14 21:17:08 -07:00
David Ungar
3b57ae80ae Fix comments and names 2018-03-14 15:21:04 -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
David Ungar
75d2871b8e JobContext name fixes 2018-03-12 16:34:18 -07:00
David Ungar
3570af7476 Fixes 2018-03-12 15:40:08 -07:00
David Ungar
180bdd61be Implement -index-file-path 2018-03-11 11:48:21 -07:00
David Ungar
ba1a714dbe Formatting 2018-03-10 16:10:38 -08:00
David Ungar
65267c6568 WIP 2018-03-09 15:45:38 -08:00
David Ungar
798dd7b490 Write out filemaps for supplementary outputs. 2018-03-09 13:54:44 -08:00
George Karpenkov
a65da887f2 Determine whether a given sanitizer is available based on the presenc… (#14919)
Determine whether a given sanitizer is available based on the presence of the library.

rdar://37192887
2018-03-02 16:57:45 -08: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
swift-ci
786cfc5ed1 Merge pull request #14703 from graydon/profile-stats 2018-02-21 19:21:59 -08:00
Graydon Hoare
628c446fe3 [Stats] Add -profile-stats-{events,entities} 2018-02-21 16:22:48 -08:00
Ben Langmuir
20cb3e3eb2 [driver] Add -working-directory option
Adds a -working-directory option which can be used to modify how
relative paths are resolved. It affects all other paths used in driver
options (controlled by a new ArgumentIsPath flag on options) as well as
the contents of output file maps and auxilliary file paths generated
implicitly by the compiler itself.

rdar://37713856
2018-02-21 09:42:05 -08:00
Saleem Abdulrasool
fe01c6a2fc Driver: collapse getClangLibraryPath[On*] (NFC)
Rather than have a function per-target, create a single implementation
that is generic enough to handle the various targets.  NFC.
2018-02-10 21:39:32 -08:00
Graydon Hoare
ef61f721d4 [BatchMode] Change all CommandOutputs to use a shared OutputFileMap. 2018-02-09 14:08:50 -08:00
Graydon Hoare
c4e58af039 [BatchMode] Add BatchModeCompile, multi-input form of StandardCompile. 2018-01-24 10:31:19 -08:00
Graydon Hoare
87131d496f [BatchMode] Hoist two args out of an inappropriate loop and switch-case. 2018-01-24 10:31:19 -08:00
Graydon Hoare
d74c1a512a [BatchMode] Make InvocationInfo and Job support multiple FilelistInfos, NFC. 2018-01-19 15:15:08 -08:00
Graydon Hoare
0f09a95679 [BatchMode] Change FiellistInfo::WhichFiles to an enum class, NFC. 2018-01-19 14:05:42 -08:00
Doug Gregor
5c831a71ee Revert "[SE-0143] Put conditional conformances behind an "experimental" flag."
This reverts commit b59c30c1af.
2017-12-18 22:54:31 -08:00
David Ungar
28b206008f FrontendInputs data structure redo.
- Outlaw duplicate input files, fix driver, fix tests, and add test.
- Reflect that no buffer is present without a (possibly pseudo) named file.
- Reflect fact that every input has a (possible pseudo) name.
- Break up CompilerInstance::setup.

Don't bail on dups.
2017-12-05 17:28:03 -08:00
Saleem Abdulrasool
9ea988f22d Merge pull request #12758 from compnerd/ELF-registration
ELF registration Restructuring
2017-11-30 11:20:53 -08:00
Doug Gregor
b59c30c1af [SE-0143] Put conditional conformances behind an "experimental" flag.
Conditional conformances aren't quite ready yet for Swift 4.1, so
introduce the flag `-enable-experimental-conditional-conformances` to
enable conditional conformaces, and an error when one declares a
conditional conformance without specifying the flag.

Add this flag when building the standard library (which will vend
conditional conformances) and to all of the tests that need it.

Fixes rdar://problem/35728337.
2017-11-28 16:01:51 -08:00
Saleem Abdulrasool
0c42b57962 ELF: restructure image metadata registration
Restructure the ELF handling to be completely agnostic to the OS.
Rather than usng the loader to query the section information, use the
linker to construct linker tables and synthetic markers for the
beginning and of the table.  Save off the values of these pointers and
pass them along through the constructor to the runtime for registration.

This removes the need for the begin/end objects.  Remove the special
construction of the begin/end objects through the special assembly
constructs, preferring to do this in C with a bit of inline assembly to
ensure that the section is always allocated.

Remove the special handling for the various targets, the empty object
file can be linked on all the targets.

The new object file has no requirements on the ordering.  It needs to
simply be injected into the link.

Name the replacement file `swiftrt.o` mirroring `crt.o` from libc.  Merge
the constructor and the definition into a single object file.

This approach is generally more portable, overall simpler to implement,
and more robust.

Thanks to Orlando Bassotto for help analyzing some of the odd behaviours
when switching over.
2017-11-28 10:04:04 -08:00
Erik Eckstein
89ffd4ca29 driver: fix handling of hidden option -assume-single-threaded
It had no effect, because it was not passed to the frontend
2017-11-17 13:33:55 -08:00
Erik Eckstein
416082ccd5 driver: Make -remove-runtime-asserts a driver option, which is passed to the frontend
rdar://problem/35602951
2017-11-17 13:33:55 -08:00