Commit Graph

479 Commits

Author SHA1 Message Date
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
Jordan Rose
30589d608b [Driver] Use simpler idiom for forwarding -target-cpu
No functionality change, but now at least we're testing this more
explicitly than just in test/Misc/tbi.sil.
2017-11-16 13:58:47 -08:00
Jordan Rose
23897e136c -embed-bitcode: Pass -O options to backend jobs too! (#12971)
Otherwise, we leave optimization opportunities on the table, and in
some cases even fail to remove marker intrinsics inserted by earlier
optimization.

Background: under -embed-bitcode, compilation happens in two stages: a
"frontend" job that compiles Swift code, generates LLVM IR, optimizes
it, and then emits a .bc file; and a "backend" job that takes that
.bc, converts it to assembly, and emits an object file with the
original bitcode embedded. However, there are actually optimization
passes that run before and during that "convert to assembly" step that
were getting completely skipped.

rdar://problem/34864094
2017-11-16 13:45:31 -08:00
Adam Nemet
66085a8aef Save optimization remarks in an external YAML file
This brings the capability from clang to save remarks in an external YAML files.
YAML files can be viewed with tools like the opt-viewer.

Saving the remarks is activated with the new option -save-optimization-record.

Similarly to -emit-tbd, I've only added support for single-compile mode for now.
In this case the default filename is determined by
getOutputFilenameFromPathArgOrAsTopLevel, i.e. unless explicitly specified
with -save-optimization-record-path, the file is placed in the directory of the
main output file as <modulename>.opt.yaml.
2017-10-27 10:14:27 -07:00
swift-ci
b006d07342 Merge pull request #12294 from anemet/opt-remarks 2017-10-20 20:45:50 -07:00
Adam Nemet
9b9805420d Add optimization remarks
This allows reporting successful and unsuccessful optimizations similar to
clang/llvm.

This first patch adds support for the
options -Rpass=<pass-name-regex> -Rpass-missed=<pass-name-regex>.  These allow
reporting successful/unsuccessful optimization on the compiler output for passes
specified by the regex.  I've also added one missed and one passed remark type
to the inliner to test the infrastructure.

Clang also has the option of collecting these records in an external YAML data
file.  This will be added in a later patch.

A few notes:
* The goal is to use this facility for both user-lever "performance" warnings
and expert-level performance analysis.  There will probably be a flag in the
future differentiating the verbosity.

* The intent is match clang/llvm as much as it makes sense.  On the other hand I
did make some changes.  Unlike in llvm, the emitter is not a pass which
simplifies things.  Also the remark class hierarchy is greatly simplified since
we don't derive from DiagnosticInfo.  We also don't derive from Diagnostic to
support the streaming API for arbitrary named-value pairs.

* Currently function names are printed mangled which should be fixed.
2017-10-20 12:41:37 -07:00
Brian Gesiak
b81ad22cab [SR-2660][Driver] Handle .swiftmodule inputs
Allow users to pass `.swiftmodule` files into the Swift driver when
compiling without `-g`. The `.swiftmodule` files are then passed to the
linker via `-add_ast_path` so that LLDB can access their AST
information.

This addresses one of two driver changes suggested in the comments of
https://bugs.swift.org/browse/SR-2660.
2017-10-19 15:03:03 -07:00
Brian Gesiak
6652e8f699 [Driver] Remove obsolete "APPLE-ONLY" comments
A post-commit reviewer on https://github.com/apple/swift/pull/10716
asked that the comments be removed. Remove them, as they're no longer
demarcating code that is internal to Apple.
2017-10-04 00:34:56 -04:00
Vedant Kumar
1621facc6c [SwiftPGO] Add driver support for -profile-use=<path>
This option tells the compiler where to find a profdata file. The
information in this file enables PGO. For more information about the PGO
infrastructure, look for the -profile-generate option and for the
llvm-profdata tool [1].

[1] http://llvm.org/docs/CommandGuide/llvm-profdata.html
2017-09-26 10:52:08 -07:00
Graydon Hoare
85dda86130 Merge pull request #12071 from graydon/trace-stats-deltas
Trace stats deltas
2017-09-22 22:25:58 -07:00
Calvin Hill
aee81d272f Add Initial platform support for Haiku. (#11583) 2017-09-22 21:06:56 -04:00
Graydon Hoare
994ad7ad92 [stats] Add -trace-stats-events 2017-09-22 19:16:50 -04:00
Slava Pestov
c28ade7077 Driver: Pass the new -sil-merge-partial-modules flag
Also pass flags to disable SIL optimization passes when merging
modules, since that's completely unnecessary.

An evolution test that used to fail with WMO disabled now passes
with this change.

FIxes <rdar://problem/18913977>.
2017-09-18 21:18:07 -07:00
Slava Pestov
94be90bea3 Revert "Driver: Pass the new -sil-merge-partial-modules flag"
This reverts commit 86d241b38e.
2017-09-15 18:37:54 -07:00
Slava Pestov
86d241b38e Driver: Pass the new -sil-merge-partial-modules flag
Also pass flags to disable SIL optimization passes when merging
modules, since that's completely unnecessary.

An evolution test that used to fail with WMO disabled now passes
with this change.

FIxes <rdar://problem/18913977>.
2017-09-15 00:24:52 -07:00