Commit Graph

557 Commits

Author SHA1 Message Date
Victoria Mitchell
d281722589 add symbol-graph flag to include SPI symbols
rdar://70794131
2021-05-20 15:10:49 -06:00
Xi Ge
e24eef4b35 driver: emit a warning when user specified flags to disable the new driver
rdar://78021402
2021-05-14 11:00:36 -07:00
Xi Ge
01b1aea958 Driver: diagnose options that are only supported in the new driver 2021-05-11 16:28:57 -07:00
Artem Chikin
4d7a4892f9 Merge pull request #37290 from artemcm/EnableDriverLinux
Enable `swift-driver` forwarding on non-Apple platforms.
2021-05-11 13:12:50 -07:00
Artem Chikin
6f44ba4ff1 Merge pull request #37122 from artemcm/BringBackNewDriver
Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
2021-05-07 09:42:38 -07:00
artemcm
8e637eca41 Enable swift-driver forwarding on non-Apple platforms.
This removes the `#ifdef __APPLE__` guard that restricts this forwarding to Apple platforms only.
If a given build/toolchain does not build or include the `swift-driver` executable alongside the compiler executables, the driver will still safely default to the legacy driver.

Resolves rdar://75534188
2021-05-06 10:29:09 -07:00
Owen Voorhees
6b004f1060 [APIDigester] Replace llvm::cl with shared option tables 2021-05-01 09:20:14 -07:00
Owen Voorhees
d1c326851d Remove unused API digester options 2021-05-01 09:18:24 -07:00
Owen Voorhees
6e0a096ca0 Remove direct access to llvm option definitions outside of SwiftAPIDigesterInvocation.parseArgs 2021-05-01 09:18:24 -07:00
Owen Voorhees
288d3dffbe Begin refactoring API digester tool to use a SwiftAPIDigesterInvocation object for option parsing and config 2021-05-01 09:18:24 -07:00
Artem Chikin
ae2e856f9b Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
This reverts commit 937e1a365c, reversing
changes made to a5440a8abd.
2021-04-28 15:11:36 -07:00
Artem Chikin
1e44ed00eb Revert "Always build SwiftDriver and use it as default compiler driver" 2021-04-28 11:20:21 -07:00
Artem Chikin
23452d5bad Merge pull request #36377 from artemcm/NewDriverDefault
Always build SwiftDriver and use it as default compiler driver
2021-04-27 09:53:06 -07:00
Artem Chikin
c2dc8e3d07 Always build (and use) the new SwiftDriver as the default compiler driver.
This will make sure that compiler developers are using the new driver when they build the compiler locally and use it.

- Adds a new build-script product category: before_build_script_impl for products we wish to build before the impl products.
- Adds a new EarlySwiftDriver product to that category, which gets built with the host toolchain.
- Adds an escape hatch: --skip-early-swift-driver
- Adjusts the swift CMake configuration with an additional step: swift_create_early_driver_symlinks which (if one was built) creates symlinks in the swift build bin directory to the EarlySwiftDriver swift-driver and swift-help executables.
- Adds a new test subset : only_early_swiftdriver, which will get built into a corresponding CMake test target: check-swift-only_early_swiftdriver-* which runs a small subset of driver-related tests against the Early SwiftDriver.
  - This subset is run always when the compiler itself is tested (--test is specified)
  - With an escape disable-switch: --skip-test-early-swift-driver
  - All tests outside of only_early_swiftdriver are forced to run using the legacy C++ driver (to ensure it gets tested, still).

NOTE: SwiftDriver product (no 'Early') is still the main product used to build the driver for toolchain installation into and for executing the product's own tests. This change does not affect that.
2021-04-26 12:17:32 -07:00
Victoria Mitchell
f4154d6019 add flag to skip docs on synthesized symbols 2021-04-11 17:40:37 -05:00
Victoria Mitchell
ba2b92be4e call it PrintMessages instead 2021-04-07 08:58:20 -06:00
Victoria Mitchell
0c5955b7fa silence symbolgraph-extract output without -v flag
rdar://72630103
2021-04-06 16:40:38 -06:00
Steven Wu
9904f9bb9c [SR-14311] Error out when swift-api-extract failed to load module
Emit diagnostics and error out when swift-api-extract failed to load
module.
2021-03-19 10:55:59 -07:00
Artem Chikin
d4fae29e0e [Driver] Emit the -new-driver-path option before actual compiler arguments.
Otherwise, if it is last then it will come after the input input source-file arguments. And in immediate (`swift`) mode, things that come after input source-file arguments are considered to be arguments to the underlying script and are placed after the `--`.

Resolves rdar://75039518
2021-03-16 13:48:42 -07:00
swift-ci
3bd26d0a38 Merge pull request #36381 from owenv/api-digester-as-frontend-tool 2021-03-15 23:26:26 -07:00
Xi Ge
2a1a7a8bca Merge pull request #36388 from nkcsgexi/75275788
driver: prefer a new driver name as swift-driver instead of swift-driver-new
2021-03-15 12:04:30 -07:00
Xi Ge
5e2bd57d90 driver: prefer a new driver name as swift-driver instead of swift-driver-new
rdar://75275788
2021-03-13 22:07:26 -08:00
Owen Voorhees
77efd77d23 [APIDigester] Build the API digester as a frontend tool instead of a standalone executable 2021-03-10 19:30:10 -08:00
Owen Voorhees
318e1b9e07 Port swift-symbolgraph extract argument parsing from llvm::cl to llvm::opt 2021-03-08 22:40:37 -08:00
QuietMisdreavus
2159908e06 [SymbolGraph] don't scan every available module for cross-import overlays (#36303)
rdar://74928853
2021-03-08 13:05:11 -07:00
Steven Wu
02c41656be swift-api-extract to generate JSON API information
Add a new swift-frontend driver option that extract APIs in the swift
module and print in JSON format. This is to allow tooling to understand
and process swift APIs without the need to be a swift compiler or
understand swift module/AST.
2021-02-15 15:04:52 -08:00
QuietMisdreavus
51bbea6132 Merge pull request #35923 from apple/QuietMisdreavus/dont-crash-on-failed-loads
don't crash the symbol graph tool when a module fails to load
2021-02-12 10:05:28 -07:00
Victoria Mitchell
65665ebffa don't crash the symbol graph tool when a module fails to load 2021-02-11 12:04:58 -07:00
Xi Ge
64a3a25836 driver: use a non-op front-end argument to indicate new driver is getting used
This could help avoiding emitting remarks.

rdar://73710910
2021-02-10 10:35:26 -08:00
Varun Gandhi
caf1a55eea Merge pull request #35229 from mininny/switch-find-to-contains
[NFC] Replace uses of find(x) != end() idiom with contains(x) for StringRef and Set-like types
2021-02-08 13:57:43 -08:00
Varun Gandhi
0d1e7abc9a Merge pull request #35757 from cypherean/refactor_transform
Replace std::transform with llvm::transform
2021-02-05 08:17:48 -08:00
shreyaa-sharmaa
2b11d7acc7 Task SR-14138 Replace std::transform with llvm::transform 2021-02-04 12:58:33 +05:30
Xi Ge
dd83f17fbc Frontend: allow retrying expanding response files in argument lists
We've seen bad file descriptor errors in certain build environments (rdar://73157185) and retrying
opening those files seems to be a walkaround. In this change, we allow the
compiler to retry expanding reponse files in argument lists.

rdar://73892564
2021-02-03 16:05:40 -08:00
Minhyuk Kim
e924cf6104 Replace usages of StringRef.find(Key) != StringRef::npos to StringRef.contains(Key) 2021-02-04 00:42:04 +09:00
Victoria Mitchell
5bf567f5f6 remove DiagPrinter directly from the CompilerInvocation 2020-12-11 08:30:32 -07:00
Victoria Mitchell
83602cb600 generate cross-import overlay symbol graphs if available 2020-12-10 19:13:37 -07:00
Robert Widmann
d815e2724a [NFC] Add Compilation::Result
In order to extract the module dependency graph from the compilation the driver just ran, define a separate semantic type to hold a result code and the graph itself.
2020-12-09 19:25:56 -08:00
Xi Ge
84afba5cf0 driver: forward driver invocation to the new driver by default
rdar://71817843
2020-12-01 15:20:22 -08:00
Eric Miotto
7771508819 Revert "CMake: generate SupportedFeatures.json while building and install it into toolchain" 2020-11-11 07:55:57 -08:00
Xi Ge
5598a605eb CMake: generate SupportedFeatures.json while building and install it into toolchain 2020-11-10 12:05:32 -08:00
Xi Ge
5b4cc58f8a driver: add an option to avoid forwarding to the new driver 2020-11-07 18:24:33 -08:00
Xi Ge
f8577b2aa8 driver: allow SWIFT_USE_NEW_DRIVER to specify a driver executable name 2020-11-07 10:26:50 -08:00
Xi Ge
11b2251ac1 Driver: forwarding driver invocations to the new driver when SWIFT_USE_NEW_DRIVER is defined
This allows us to experiment with the new swift-driver without changing build systems.
2020-10-02 14:02:13 -07:00
Xi Ge
c403b140e1 ClangImporter: refactor ClangImporterOptions to be ASTContext-owned. NFC
We need ClangImporterOptions to be persistent for several scenarios: (1)
when creating a sub-ASTContext to build Swift modules from interfaces; and
(2) when creating a new Clang instance to invoke Clang dependencies scanner.

This change is NFC.
2020-09-01 14:04:22 -07:00
David Ungar
6f9df09766 Merge pull request #33701 from davidungar/handle-bad-j
Don't crash on a bad -j input
2020-08-29 22:26:55 -07:00
David Ungar
fcf398a17b Don't crash on a bad -j input 2020-08-29 19:36:04 -07:00
Brent Royal-Gordon
d48e397b86 Support --driver-mode with swift-frontend
This makes development in Xcode somewhat simpler.
2020-08-07 16:00:15 -07:00
Dario Rexin
0850436d9f Properly compute resource folder when linking statically
- deduplicate the logic to compute the resource folder
- install headers and module files in shared and static resource folders
- forward -static flag when calling swiftc with -print-target-info
2020-07-30 15:07:03 -07:00
Doug Gregor
d49e4a2185 [Build] Don't install swift-frontend twice, incorrectly 2020-06-23 14:13:51 -07:00
Doug Gregor
bb2d6c59e4 Install swift-frontend executable 2020-06-23 13:00:26 -07:00