Commit Graph

1432 Commits

Author SHA1 Message Date
QuietMisdreavus
bf66515858 add default values for SymbolGraphOptions (#59037)
rdar://93780666
2022-05-26 09:33:51 -06:00
Robert Widmann
663722d892 Parameterized Existential Types Are Enabled By Default
See https://forums.swift.org/t/accepted-se-0353-constrained-existential-types/57560
2022-05-25 09:50:36 -07:00
Alexis Laferrière
6c287b2b41 Merge pull request #58935 from xymus/swiftmodule-per-sdk-soft-reject
[Serialization] Soft-reject swiftmodules built against a different SDK on tagged compilers
2022-05-18 15:09:48 -07:00
Ben Barham
47721d25e6 Merge pull request #42394 from DavidGoldman/hermeticindexstore
Support hermetic indexing information + introduce `-file-prefix-map`
2022-05-16 14:09:25 -07:00
Alexis Laferrière
c8059a09e9 [Serialization] Soft-reject swiftmodules built against a different SDK
Change the way swiftmodules built against a different SDK than their
clients are rejected. This makes them silently ignored when the module
can be rebuilt from their swiftinterface, instead of reporting a hard
error.

rdar://93257769
2022-05-16 13:22:35 -07:00
David Goldman
c232ed2913 Support hermetic indexing information
Swiftc port of https://github.com/apple/llvm-project/pull/4207.

This introduces a new flag, `-file-prefix-map` which can be used
instead of the existing `-debug-prefix-map` and `-coverage-prefix-map`
flags, and also remaps paths in index information currently.
2022-05-16 11:00:14 -04:00
Slava Pestov
bfcaa39d37 Remove the GenericSignatureBuilder
Resolves rdar://problem/88136582.
2022-05-10 11:47:06 -04:00
Slava Pestov
f39372b33d RequirementMachine: Turn off redundant requirement warnings by default and add -warn-redundant-requirements frontend flag 2022-05-10 01:49:56 -04:00
Erik Eckstein
abb2da88e6 Add a flag -enable-default-cmo to enable default cross-module-optimization.
So far, the swift-frontend decided by itself if CMO can be enabled. This caused problems when used with an old driver, which doesn't consider CMO.
Now, the driver decides when to use default CMO by passing this flag to swift-frontend.
2022-04-29 18:22:55 +02:00
Evan Wilde
8b2ccd9ed5 Merge pull request #58429 from etcwilde/ewilde/disjunction-main-resolution
Use Disjunction Constraint to find main function
2022-04-28 09:31:45 -07:00
Egor Zhdan
ca44a67a99 [Frontend] NFC: fix compiler warning
```
[218/807] Building CXX object lib/Frontend/CMakeFiles/swiftFrontend.dir/CompilerInvocation.cpp.o
/home/egorzh/swift/swift/lib/Frontend/CompilerInvocation.cpp:804:28: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
  Opts.EnableCXXInterop |= Args.hasArg(OPT_enable_experimental_cxx_interop) |
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                            ||
/home/egorzh/swift/swift/lib/Frontend/CompilerInvocation.cpp:804:28: note: cast one or both operands to int to silence this warning
```
2022-04-28 14:24:35 +01:00
Evan Wilde
94e30a817e Revert "Add -async-main flag to favor asynchronous main"
This reverts commit da0a3311a5.
2022-04-26 16:29:45 -07:00
Doug Gregor
c1534d5af9 Merge pull request #42520 from DougGregor/rename-strict-concurrency-options 2022-04-21 00:26:34 -07:00
Zoe Carver
320e4c63cb Merge pull request #42511 from zoecarver/add-flag-import-as-computed-property 2022-04-20 22:47:21 -07:00
Doug Gregor
3316cf01f7 Merge pull request #41996 from DougGregor/implicit-open-by-default
[SE-0352] Implicit opening of existentials by default
2022-04-20 21:37:52 -07:00
Doug Gregor
5538068500 Rename -strict-concurrency=explicit to minimal
This makes it far more clear what the relative ordering of the options is.

Thanks, Jake!
2022-04-20 21:30:41 -07:00
Doug Gregor
4116d7a3d7 Rename the -strict-concurrency= options to be more descriptive.
The three options are now:

* `explicit`: Enforce Sendable constraints where it has been explicitly adopted and perform actor-isolation checking wherever code has adopted concurrency. (This is the default)
* `targeted`: Enforce Sendable constraints and perform actor-isolation checking wherever code has adopted concurrency, including code that has explicitly adopted Sendable.
* `complete`: Enforce Sendable constraints and actor-isolation checking throughout the entire module.
2022-04-20 18:17:33 -07:00
Doug Gregor
c76a99ba02 [SE-0352] Enable implicit opening of existentials by default 2022-04-20 17:51:04 -07:00
zoecarver
21192904ba [cxx-interop][nfc] Add flag cxx-interop-getters-setters-as-properties.
This is causing problems in certain cases, disabling by default.
2022-04-20 17:32:26 -07:00
Josh Soref
38c0de0598 Spelling frontend (#42465)
* spelling: calculated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: compilations

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: containing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dependency

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dependent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: diagnose

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: explicit

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: explicitly

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: feature

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: fulfill

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: fulfillment

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: invoke

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: module

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: multiple

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: omitted

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: optimization

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: performing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: primaries

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: propagate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: sacrifices

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: scanned

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: substitution

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: successful

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: typecheck

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unobtrusive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: utilities

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-20 15:18:37 -07:00
Pavel Yaskevich
6db0001863 [TypeChecker] NFC: Remove -experimental-multi-statement-closures flag
SE-0326 has been enabled by default, so this flag is no longer necessary.
2022-04-20 10:40:27 -07:00
Doug Gregor
12a11e5416 Merge pull request #42445 from DougGregor/strict-concurrency-flag 2022-04-19 08:07:30 -07:00
Doug Gregor
7a724c4586 Add frontend flag -swift-concurrency={off|limited|on}
Replace `-warn-concurrency` with a more granular option
`-swift-concurrency=`, where the developer can select one of three
different "modes":

* `off` disables `Sendable` checking for most cases. (This is the Swift
5.5 and Swift 5.6 behavior.)
* `limited` enables `Sendable` checking within code that has adopted
Swift concurrency. (This is currently the default behavior.)
* `on` enables `Sendable` and other concurrency checking throughout
the module. (This is equivalent to `-warn-concurrency` now).

There is currently no distinction between `off` and `limited`. That
will come soon.

Implements the flag part of rdar://91930849.
2022-04-18 18:12:10 -07:00
Saleem Abdulrasool
8f96a6bce1 Frontend: add an additional search path for swift modules
This setups the frontend to search both an architecture suffixed and
unsuffixed path.  This improves the multi-architecture setup for
Windows, enabling it use the directory form of the swift modules with
the architectures overlaying in the swift module and leaving the arch
suffixed directory for the import libraries.

This can be fully generalized as this also enables Linux to use the
multi-architecture search path for the swift modules enabling it to
eventually adopt a SDK model as well.
2022-04-17 15:39:46 -07:00
Hamish Knight
9aa315a416 Add -disable-experimental-string-processing
Introduce a frontend flag that disables
experimental string processing, including `/.../`
literals.
2022-04-13 13:26:53 +01:00
Hamish Knight
63b8db1659 Start using '-enable-bare-slash-regex'
Change the flag to imply
'-enable-experimental-string-processing', and
and update some tests to start using it.
2022-04-12 16:03:47 +01:00
Artem Chikin
b3726d097b Merge pull request #42217 from artemcm/BareBonesRegexSyntax
Rename flag for enabling forward slash literals to be less ambiguous.
2022-04-11 16:40:23 -07:00
Erik Eckstein
9906666801 Fix the 'hosttools' bootstrapping build mode
After the rename of the `enable-cxx-interop` option to `enable-experimental-cxx-interop` it was no longer possible to build with installed tools.
This change re-introduces the `enable-cxx-interop` option for backward compatibility
2022-04-09 10:56:06 +02:00
Pavel Yaskevich
f7253f253e Merge pull request #42228 from xedin/enable-se-0347-by-default
[TypeChecker] SE-0347: Enable type inference from default expressions
2022-04-08 16:10:20 -07:00
zoecarver
839839f924 [cxx-interop] Rename enable-cxx-interop -> enable-experimental-cxx-interop.
Also removes the driver flag, this will now also always be guarded on `-Xfrontend`.
2022-04-07 19:15:25 -07:00
swift-ci
78aae7eec1 Merge pull request #42234 from tshortli/revert-library-level-api-target-min-inlining-min
Revert https://github.com/apple/swift/pull/41940
2022-04-06 21:09:36 -07:00
Allan Shortlidge
05daaf8a6f Frontend: Revert the behavior introduced by https://github.com/apple/swift/pull/41940.
Resolves rdar://91382164.
2022-04-06 18:22:14 -07:00
Pavel Yaskevich
b03021dbb7 [TypeChecker] SE-0347: Enable type inference from default expressions 2022-04-06 15:03:00 -07:00
Slava Pestov
1bf248e374 Enable parameterized protocols by default, and add new staging flag for parameterized existentials 2022-04-06 17:30:10 -04:00
Artem Chikin
7ba377b3c2 Rename flag for enabling forward slash literals to be less ambiguous.
Previous spelling could easily be mistaken for gating the entire feature.

Part of rdar://91119995
2022-04-06 09:46:40 -07:00
Nate Chandler
11e5c97f45 [SILOpt] Added flag to disable destroy hoisting.
It is on by default.  The default changes with the value of the
CopyPropagation setting.  But it can still be overridden.
2022-04-05 20:01:17 -07:00
swift-ci
882edde92f Merge pull request #41966 from rxwei/se-0348-if-approved
[ResultBuilders] Enable SE-0348 `buildPartialBlock` by default.
2022-04-04 21:21:19 -07:00
Richard Wei
065ac52c0d Add frontend flag -disable-implicit-string-processing-module-import.
We add a new flag to disable the implicit import of `_StringProcessing`, similar to `-disable-implicit-concurrency-module-import`. We need this to build `_RegexParser` when `-enable-experimental-string-processing` is enabled by default, because `_StringProcessing` currently imports `_RegexParser` publicly (non-implementation-only).
2022-04-04 13:55:47 -07:00
Evan Wilde
4494db946c Merge pull request #42142 from etcwilde/ewilde/async-main-resolution
Fixing async main resolution
2022-04-04 10:25:29 -07:00
Xi Ge
8dd638fbd0 ModuleInterface: ensure -disable-clang-spi flag to propagate to module interface builders 2022-04-02 21:31:00 -07:00
Evan Wilde
2eb801145e Merge branch 'main' into ewilde/async-main-resolution 2022-04-02 16:15:10 -07:00
Evan Wilde
da0a3311a5 Add -async-main flag to favor asynchronous main
This flag biases the overload checker in favor of selecting an
asynchronous main function over a synchronous main. If no asynchronous
main function exists, a synchronous one will still be selected.
Likewise, if the flag is not passed and there are only asynchronous main
functions available, the most specific asynchronous main function will
still be selected.
2022-04-02 16:14:01 -07:00
Artem Chikin
b04ae26391 Add support for -enable-regex-literals flag
- Add driver and frontend option
- Add LangOptions entry
- Ensure driver propagates flag to frontends
- Add feature to `features.json`

Part of rdar://91119995
2022-04-01 12:14:28 -07:00
Xi Ge
91c4f17b35 Frontend: flip the default of whether importing SPI_AVAILABLE from clang 2022-03-31 09:43:13 -07:00
Yuta Saito
43a25e89b7 [Wasm][IRGen] Add initial support for absolute function pointer
On some Harvard architectures like WebAssembly that allow sliding code
and data address space offsets independently, it's impossible to make
direct relative reference to code from data because the relative offset
between them is not representable.
Use absolute function references instead of relative ones on such targets.
2022-03-30 08:12:23 +00:00
Slava Pestov
132334cda9 RequirementMachine: Add debugging flag to disable re-using requirement machines 2022-03-27 11:54:28 -04:00
Slava Pestov
cdcc8ed8fc RequirementMachine: Enable loop normalization by default 2022-03-26 22:12:12 -04:00
Anthony Latsis
38e48ac15d TypeWitnessSystem: Disable by default 2022-03-25 08:45:54 +03:00
Doug Gregor
c4e6e6d105 Eliminate the EnableExperimentalDistributed language option.
Nothing is using it because this feature is enabled by default.
2022-03-24 16:00:26 -07:00
Doug Gregor
b9f31a8547 Remove SwiftOnoneSupport hack for implicit opening of existentials 2022-03-24 13:08:00 -07:00