Commit Graph

660 Commits

Author SHA1 Message Date
elsh
58a01c4ee7 Use StringMap
More specific diag msgs
Add tests
2021-09-24 14:37:56 -07:00
elsh
be26554418 Add a module alias option to frontend
Validate input and set up the module alias map
rdar://83316886
2021-09-24 14:37:56 -07:00
Alexis Laferrière
a144aa78cd Merge pull request #38966 from xymus/one-way-emit-module
[Driver] Force the test one-way-merge-module-fine to use emit-module
2021-09-09 08:11:35 -07:00
Alexis Laferrière
3ddbb88385 [Driver] Force the use of merge-module in merge-module specific test
As support, accept but ignore the -no-emit-module-separately flag in the
C++ driver.
2021-09-08 10:20:20 -07:00
Alexis Laferrière
0f7e57d07c [Driver] Align definition of the emit-module-separately flag with the driver's 2021-09-08 10:20:14 -07:00
Alexis Laferrière
4336084aa6 Merge pull request #39094 from xymus/driver-library-level
[Driver] Make -library-level a driver argument and pass it to the frontend
2021-08-30 16:22:26 -07:00
Alexis Laferrière
9cb3702b0a [Driver] Make -library-level a driver argument and pass it to the frontend
rdar://82458987
2021-08-30 10:06:53 -07:00
Doug Gregor
9d4ce58ed6 Merge pull request #38930 from DougGregor/concurrency-compatibility-library
[concurrency] Implement a compatibility .a library for Concurrency.
2021-08-28 22:40:37 -07:00
Varun Gandhi
0e13fcd857 Merge pull request #38750 from RAJAGOPALAN-GANGADHARAN/sr_14122
Improve usability of -l flag
2021-08-27 10:25:34 -07:00
Michael Gottesman
1bc94bfa6a [concurrency] Implement a compatibility .a library for Concurrency.
In a back deployment scenario, this will provide a place where one could provide
function implementations that are not available in the relevant stdlib.

This is just setting up for future work and isn't doing anything interesting
beyond wiring it up/making sure that it is wired up correctly with tests.
2021-08-18 09:35:37 -07:00
Doug Gregor
725624fc1b [SE-0286] Disable backward scanning for trailing closures in Swift 6 mode. 2021-08-18 05:54:54 -07:00
Doug Gregor
d54abea922 Implement customizable Sendable conformance diagnostics.
Rework Sendable checking to be completely based on "missing"
conformances, so that we can individually diagnose missing Sendable
conformances based on both the module in which the conformance check
happened as well as where the type was declared. The basic rules here
are to only diagnose if either the module where the non-Sendable type
was declared or the module where it was checked was compiled with a
mode that consistently diagnoses `Sendable`, either by virtue of
being Swift 6 or because `-warn-concurrency` was provided on the
command line. And have that diagnostic be an error in Swift 6 or
warning in Swift 5.x.

There is much tuning to be done here.
2021-08-14 08:13:10 -07:00
Rajagopalan-Gangadharan
4f5cb6a47b -l flag accepts space and emits without space to llvm frontend 2021-08-04 20:48:10 +05:30
Slava Pestov
66702b3b18 Preserve -requirement-machine=(off|on|verify) in module interfaces
Hopefully I won't regret this later. This is needed to ensure that clients
of _Differentiation.swiftinterface don't fall over while building a module
from the interface.
2021-08-02 17:27:59 -04:00
Mishal Shah
3722bcb85a Revert "[concurrency] Implement a compatibility .a library for Concurrency." 2021-07-29 11:26:51 -07:00
Michael Gottesman
78166f765b Merge pull request #38616 from gottesmm/pr-43566c09aa169640705f6291f3dd981cc30040da
[concurrency] Implement a compatibility .a library for Concurrency.
2021-07-25 12:56:38 -07:00
Michael Gottesman
8441871a04 [concurrency] Implement a compatibility .a library for Concurrency.
In a back deployment scenario, this will provide a place where one could provide
function implementations that are not available in the relevant stdlib.

This is just setting up for future work and isn't doing anything interesting
beyond wiring it up/making sure that it is wired up correctly with tests.
2021-07-23 17:30:18 -07:00
Robert Widmann
262e2b335d Eat -experimental-emit-module-separately
SourceKit invokes the legacy driver. Providing this flag in the IDE
means the command lines SourceKit forms to run semantic requests in the
editor are all invalid.

Teach the legacy driver to eat this flag.

rdar://80811565
2021-07-23 13:29:29 -07:00
Jeremy Legendre
7fa9fcf01f Update flag options
Co-authored-by: Owen Voorhees <owenvoorhees@gmail.com>
2021-07-06 01:34:37 -04:00
Jeremy Legendre
ebd59927d6 Use Swift-style args for Driver 2021-07-05 23:56:42 -04:00
Jeremy Legendre
35735e7d0c [LTO] Driver support for -lto_library flag
This commit adds support for the -lto_library flag, allowing users to specify a custom LTO library on Darwin. This also fixes an issue where the default LTO library is used even if Driver is run from inside an alternate toolchain.
2021-07-05 18:01:40 -04:00
Owen Voorhees
d5cf49b399 Merge pull request #37991 from owenv/digester-disable-fail-on-error 2021-06-30 22:35:56 -07:00
Owen Voorhees
734d7ae058 [APIDigester] Add a -disable-fail-on-error option 2021-06-20 11:00:13 -07:00
Xi Ge
750ce7acc1 Frontend: -disable-clang-target should be a flag 2021-06-14 14:54:51 -07:00
Xi Ge
cc59279bc4 driver: add an option to disable separately specifying Clang target 2021-06-07 10:35:06 -07:00
Xi Ge
4bd7a2fbfe Merge pull request #37774 from nkcsgexi/72480261
Frontend: allow specifying a different target triple for internal clang instance to use
2021-06-06 13:43:57 -07:00
Xi Ge
2dcb33bb00 Frontend: allow specifying a different target triple for internal clang instance to use
Before this change, we always use the Swift target triple to instantiate the internal
Clang instance. When loading a Swift module from the textual interface, we may pick up
a lower target triple to use to build the Swift module because the target is hard-coded
in the textual interface file. This implies we may end up building multiple versions of the
same Clang module, one for each target triple of the loading Swift module.

This change adds a new frontend flag -clang-target to allow clients to specify a
consistent clang target to use across the Swift module boundaries. This value won't change
because it's not part of .swiftinterface files.

swift-driver should pass down -clang-target for each frontend invocation, and its value should be
identical to -target.

Related to: rdar://72480261
2021-06-06 07:58:21 -07:00
QuietMisdreavus
40b084e5c0 Merge pull request #37640 from apple/QuietMisdreavus/spi-symbols
add symbol-graph flag to include SPI symbols
2021-06-04 11:34:48 -06:00
Varun Gandhi
b77ea50d5d Revert "Turn on additional musttail checks for swiftc and runtime."
This reverts commit 02551564ad.

Using this flag caused breakage when trying to use upstream LLVM
as well as Clang/LLVM from Xcode 12.5. See SR-14714.
2021-06-02 16:35:27 -07:00
Varun Gandhi
02551564ad Turn on additional musttail checks for swiftc and runtime.
Fixes rdar://76024810.
2021-05-25 11:49:46 -07:00
Xi Ge
03e0006a48 ModuleInterface: move -user-module-version to a new field
Titled as "// swift-module-flags-ignorable:", this new field contains new
frontend arguments that can be safely ignored by the older version of the compiler.
For compilers that don't know the field at all, all arguments in it are ignored.

rdar://78233352
2021-05-21 14:52:10 -07:00
Victoria Mitchell
d281722589 add symbol-graph flag to include SPI symbols
rdar://70794131
2021-05-20 15:10:49 -06:00
Xi Ge
01b1aea958 Driver: diagnose options that are only supported in the new driver 2021-05-11 16:28:57 -07:00
Owen Voorhees
6b004f1060 [APIDigester] Replace llvm::cl with shared option tables 2021-05-01 09:20:14 -07:00
Xi Ge
fe5c7ef995 ModuleInterface/Serialization: allow library authors to define a custom module version number
This allows library authors to pass down a project version number so that library users can conditionally
import that library based on the available version in the search paths.

Needed for rdar://73992299
2021-04-30 10:00:45 -07:00
Doug Gregor
19a7fa6625 [SILGen] Put actor data-race checking behind a flag.
Introduce flags `-enable-actor-data-race-checks` and
`-disable-actor-data-race-checks` to enable/disable emission of code
that checks that we are on the correct actor. Default to `false` for
now but make it easy to enable in the future.
2021-04-20 22:30:53 -07:00
Victoria Mitchell
f4154d6019 add flag to skip docs on synthesized symbols 2021-04-11 17:40:37 -05:00
Victoria Mitchell
0c5955b7fa silence symbolgraph-extract output without -v flag
rdar://72630103
2021-04-06 16:40:38 -06:00
Varun Gandhi
cc14992281 [Frontend] Add -emit-irgen option to driver and frontend.
Fixes SR-14389, fixes rdar://75715690.
2021-03-31 11:56:36 -07:00
Victoria Mitchell
6c7dfa6384 all supplementary outputs affect incremental builds
rdar://75536036
2021-03-26 16:55:09 -05:00
Doug Gregor
2a28fed34d Allow one to separately specify the ABI name of a module.
Introduce a new compiler flag `-module-abi-name <name>` that uses the
given name as the ABI name for the module (rather than the module's
name in source code). The ABI name impacts name mangling and metadata.
2021-03-12 07:42:07 -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
Doug Gregor
6efaf7ac0f Introduce -warn-concurrency flag to warn about concurrency issues.
To help support incremental adoption of the concurrency model, a number
of concurrency-related diagnostics are enabled only in "new" code that
takes advantage of concurrency features---async, @concurrent functions,
actors, etc. This warning flag opts into additional warnings that better
approximate the eventual concurrency model, and which will become
errors a future Swift version, allowing one to both experiment with
the full concurrency model and also properly prepare for it.
2021-03-05 10:58:54 -08:00
Robert Widmann
d0b07bb4bb Remove Unused Experimental Cross-Module Flag
Now that we're using -{enable,disable}-incremental-imports, drop the
experimental flag.
2021-03-03 10:02:47 -08:00
Robert Widmann
7f7978370b Merge pull request #36111 from CodaFi/cross-over-episode
Add Real Enable/Disable Flags for Cross-Module Incremental Builds
2021-03-02 16:07:11 -08:00
Robert Widmann
28a37a427f Add Real Enable/Disable Flags for Cross-Module Incremental Builds
In the legacy driver, these flags will merely be propagated to the
frontends to indicate that they should disable serialization of
incremental information in swift module files.

In the new driver, these flags control whether the Swift driver performs
an incremental build that is aware of metadata embedded in the module.

Kudos to David for coming up with our new marketing name: Incremental
Imports.

rdar://74363450
2021-03-01 10:15:25 -08:00
Nathan Hawes
821345c834 [Frontend] Add a new -index-unit-ouput-path and filelist equivalent to the frontend
These new options mirror -o and -output-filelist and are used instead
of those options to supply the output file path(s) to record in the
index store. This is intended to allow sharing index data across
builds in separate directories that are otherwise equivalent as far
as the index data is concered (e.g. an ASAN build and a non-ASAN build)
by supplying the same -index-unit-output-path for both.

Resolves rdar://problem/74816412
2021-02-27 13:06:22 +10:00
Robert Widmann
76686667b7 [NFC] Clean Out Some Unused Enable/Disable Flags 2021-02-23 13:57:57 -08: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
AG
a5b804602d Merge pull request #35110 from bitjammer/acgarland/emit-symbol-graph
Add optional -emit-symbol-graph output when emitting modules
2021-02-12 09:00:58 -08:00