Commit Graph

364 Commits

Author SHA1 Message Date
Brian Gesiak
3f8e8084ff [Driver] Remove unused input type code (NFCI)
Summary:
When the Swift driver executable was first added in
ed2038585f,
the code included a FIXME to support input types, like Clang's
`-x <language>` option. Perhaps as a first step in implementing this
functionality, it also included dead code that manipulated an input type
argument, even though the variable for storing the argument was never
written to.

Remove the unused input type code, and the FIXME. The FIXME is now
tracked with a Swift bug URL, so that a discussion on next steps can be had:
https://bugs.swift.org/browse/SR-6054

Test plan: `utils/build-script --release --test`
2017-10-04 13:53:14 -04: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
Calvin Hill
aee81d272f Add Initial platform support for Haiku. (#11583) 2017-09-22 21:06:56 -04:00
Huon Wilson
08a2e35b3f Merge pull request #11563 from huonw/emit-module-path-wmo
[Driver] Obey -emit-module-path in -wmo that only does -emit-module.
2017-08-23 14:07:56 -07:00
Huon Wilson
151bbf95a3 [Driver] Obey -emit-module-path in -wmo that only does -emit-module. 2017-08-23 11:18:52 -07:00
Jordan Rose
0a4cf89a33 Merge pull request #11482 from jrose-apple/take-action
[Driver] Clean up ownership of Action objects
2017-08-16 09:40:17 -07: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
4934c57491 [Driver] Remove ActionList typedef, improve const correctness.
No functionality change.
2017-08-11 21:09:34 -07:00
George Karpenkov
efe143c2f4 Adding support for -sanitize=fuzzer flag (#11381)
Similarly to Clang, the flag enables coverage instrumentation, and links
`libLLVMFuzzer.a` to the produced binary.
Additionally, this change affects the driver logic, and enables the
concurrent usage of multiple sanitizers.
2017-08-07 18:16:51 -07:00
swift-ci
d549147e43 Merge remote-tracking branch 'origin/master' into master-next 2017-07-31 18:48:50 -07:00
Huon Wilson
dfa8501e59 [Frontend] Emit tbd as an extra output, not a frontend action.
This means it can be emitted during an -emit-module frontend job, which is the
most common place it will be used, so reusing work like this is important for
performance.

For now, this has to happen as part of a single frontend invocation, i.e. -wmo
or -force-single-frontend-invocation.
2017-07-31 11:05:29 -07:00
swift-ci
f6a4fb6b5c Merge remote-tracking branch 'origin/master' into master-next 2017-07-21 14:28:51 -07:00
Harlan
37f88e7372 Add frontend flag to serialize Syntax tree (#11095)
* Add frontend flag to serialize Syntax tree

* Rename dump-serialized-syntax-tree to emit-syntax
2017-07-21 14:23:50 -07:00
swift-ci
609f493fcd Merge remote-tracking branch 'origin/master' into master-next 2017-06-30 16:08:53 -07:00
Graydon Hoare
411b13309a Merge pull request #10733 from graydon/rdar-32984579-emit-bc-depends-on-bridging-pch-as-well
[Bridging PCH] Move dependency-on-bridging-PCH to -emit-bc JobAction itself
2017-06-30 16:06:16 -07:00
Graydon Hoare
d4ff4537b9 [Bridging PCH] Move dependency-on-bridging-PCH to -emit-bc JobAction itself. 2017-06-30 15:13:41 -07:00
Arnold Schwaighofer
a72b685927 Merge remote-tracking branch 'origin/master' into master-next 2017-06-30 12:21:33 -07:00
David Farler
645aaad551 [index/build] Upstream indexing while building changes
This patch upstreams previously AppleInternal changes for
indexing while building.
2017-06-29 16:20:06 -07:00
Greg Parker
7b009eccde Merge remote-tracking branch 'origin/master' into master-next 2017-06-28 15:25:17 -07:00
Michael Gottesman
3617134b69 [upstream-update] llvm::opt::filtered_{begin,end} => llvm::opt::filtered. 2017-06-22 21:17:01 -07:00
George Karpenkov
479aeca88c Addressing code review comments. 2017-06-16 13:26:46 -07:00
George Karpenkov
9637bd2c36 Change driver logic for sanitizers support.
With this patch different sanitizers (tsan/asan) will be enabled or
disabled on the driver level on a particular OS depending on whether
the required library is present.

The current patch only supports Darwin architectures, but Linux support
should not be hard to add.
2017-06-16 13:26:46 -07:00
swift-ci
e057a05fbe Merge remote-tracking branch 'origin/master' into master-next 2017-06-14 16:28:39 -07:00
Mishal Shah
c5ff1f2cac Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-06-14 16:20:35 -07:00
swift-ci
6a0b7391f8 Merge remote-tracking branch 'origin/master' into master-next 2017-06-14 14:08:42 -07:00
Erik Verbruggen
97b9886a70 Do stricter checking of -D command-line arguments
Check if the condition "name" is a proper identifier, and generate an
error when assigning specific values in -D conditions.

Fixes SR-2404.
2017-06-13 23:19:08 -07:00
swift-ci
6afda14ba8 Merge remote-tracking branch 'origin/master' into master-next 2017-06-07 15:48:34 -07:00
Argyrios Kyrtzidis
ffd9e952d8 Merge pull request #10158 from akyrtzi/persistent-pch-diag-file
[driver] For the persistent bridging PCH job action, make sure to pass a serialized diagnostics path in the PCH output directory
2017-06-07 15:34:24 -07:00
Argyrios Kyrtzidis
563a37f053 [driver] For the persistent bridging PCH job action, make sure to pass a serialized diagnostics path in the PCH output directory
Previously it was passing a relative filename and the invocation was creating .dia files in the source directory.
If a filename is not determined for inside the PCH output directory, it fallsback to creating a temporary for the diagnostics file,
similarly to the non-persistent bridging PCH job.

rdar://32594291
2017-06-07 15:08:05 -07:00
swift-ci
54af467191 Merge remote-tracking branch 'origin/master' into master-next 2017-06-03 00:28:33 -07:00
Graydon Hoare
7fc8bd270b [Stats] Tidy up stray characters in filenames. 2017-06-02 23:42:38 -07:00
swift-ci
6366c9fe1c Merge remote-tracking branch 'origin/master' into master-next 2017-06-02 20:28:33 -07:00
Graydon Hoare
e10f483477 [Stats] Mangle a little more information into the file & timer names.
This helps disambiguate files that might otherwise be hard to sort through
if multiple runs output stats together in a single directory. The names
don't have to be perfect, just contain sufficient hints (and be parseable)
to differentiate module, arch, opt and output-type variation in jobs.
2017-06-02 18:08:31 -07:00
swift-ci
d07f8e33e7 Merge remote-tracking branch 'origin/master' into master-next 2017-05-23 14:28:33 -07:00
Jordan Rose
45e5116683 [Driver] Don't remove temporary PCH files on crashes either. (#9881)
Follow-up to a875d8c7c.
2017-05-23 14:20:31 -07:00
swift-ci
0b164991ae Merge remote-tracking branch 'origin/master' into master-next 2017-05-13 16:48:31 -07:00
Argyrios Kyrtzidis
a6a3ebee6c [Driver] For the persistent PCH job there is no output path, the frontend determines the filename to use.
Previously the parseable output would have an empty string as the output of the PCH job, this fixes the issue.
2017-05-13 14:59:18 -07:00
swift-ci
4c56317e58 Merge remote-tracking branch 'origin/master' into master-next 2017-05-12 07:48:34 -07:00
Argyrios Kyrtzidis
4391ecc802 [Driver] For the 'emit persistent PCH' job, don't set an output filename. 2017-05-11 16:24:51 -07:00
Argyrios Kyrtzidis
c4b5b60d00 [Driver/ClangImporter] Changes for the driver to recognize -pch-output-dir and propagate to the frontend invocations
For the multiple-files mode -emit-pch is still invoked in separate frontend invocation but with using a persistent PCH.
Subsequent frontend invocations use the persistent PCH but they don't need to validate it.

For all-files mode (e.g. WMO) the frontend invocation uses a persistent PCH that it also validates.
2017-05-11 11:44:12 -07:00
swift-ci
502bda365b Merge remote-tracking branch 'origin/master' into master-next 2017-05-05 13:48:34 -07:00
practicalswift
492f5cd35a [gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar)
Replace `NameOfType foo = dyn_cast<NameOfType>(bar)` with DRY version `auto foo = dyn_cast<NameOfType>(bar)`.

The DRY auto version is by far the dominant form already used in the repo, so this PR merely brings the exceptional cases (redundant repetition form) in line with the dominant form (auto form).

See the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es11-use-auto-to-avoid-redundant-repetition-of-type-names) for a general discussion on why to use `auto` to avoid redundant repetition of type names.
2017-05-05 09:45:53 +02:00
swift-ci
cdde06ac25 Merge remote-tracking branch 'origin/master' into master-next 2017-04-27 15:56:02 -07:00
David Farler
63776b507b When converting some of the old Migrator automation to the new Migrator,
I had set up the driver to invoke a separate frontend invocation with
the "update code" mode. We sort of did this last release, except we
forked to the swift-update binary instead. This is causing problems with
testing in Xcode.

Instead, let's perform a single compile and add the remap file as an
additional output during normal compiles. The driver, seeing
-update-code, will add -emit-remap-file-path $PATH to the -c frontend
invocation.

rdar://problem/31857580
2017-04-27 01:03:00 -07:00
Huon Wilson
45bda6fe79 [Frontend] Change LOADED_MODULE_TRACE_PATH -> ..._FILE.
Accidentally wrote down the wrong name initially.
2017-04-25 13:19:49 -07:00
swift-ci
2d8df36a08 Merge remote-tracking branch 'origin/master' into master-next 2017-04-21 13:28:31 -07:00
Huon Wilson
9c6c7c5105 [Driver] Support the SWIFT_LOADED_MODULE_TRACE_PATH env var.
This overrides -emit-loaded-module-trace (etc.).
2017-04-21 11:14:30 -07:00
Huon Wilson
7e8568d03d [Driver] Main compiler tells frontend to -emit-loaded-module-trace. 2017-04-21 11:14:29 -07:00