Commit Graph

1697 Commits

Author SHA1 Message Date
swift-ci
4ee528a886 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-27 15:14:25 -07:00
Doug Gregor
8da6caeccd Add experimental feature for type witness system inference 2022-05-27 12:34:53 -07:00
Doug Gregor
333ae3f830 Add experimental feature for one-way closure parameters 2022-05-27 11:52:29 -07:00
Doug Gregor
b012270fca Adopt experimental-feature infrastructure for move-only feature 2022-05-26 14:21:26 -07:00
Doug Gregor
37dbf23ba2 Adopt experimental feature approach for flow-sensitive concurrency captures 2022-05-26 13:56:21 -07:00
Doug Gregor
0de5d7818d Make named opaque types an experimental feature 2022-05-26 13:44:08 -07:00
Doug Gregor
a523473315 Make static assertions an experimental feature 2022-05-26 13:43:36 -07:00
Doug Gregor
6d82448dc8 Add -enable-experimental-feature X for experimental features.
Experimental features can only be enabled in non-production (+Asserts)
builds. They can be detected with `hasFeature` in the same manner as
"future" features.

The `-enable-experimental-feature X` flag will also look for future
features by that name, so that when an experimental feature becomes an
accepted future feature, it will still be enabled in the same manner.

Switch variadic generics over to this approach, eliminating the
specific LangOption for it.
2022-05-26 11:50:39 -07:00
swift-ci
0f4ef3080e Merge remote-tracking branch 'origin/main' into rebranch 2022-05-26 08:53:05 -07:00
QuietMisdreavus
bf66515858 add default values for SymbolGraphOptions (#59037)
rdar://93780666
2022-05-26 09:33:51 -06:00
Ben Barham
92b6dd24c2 Merge branch 'main' into manually-merge-main 2022-05-25 15:55:35 -07: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
swift-ci
f6cdcc736d Merge remote-tracking branch 'origin/main' into rebranch 2022-05-18 15:18:15 -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
swift-ci
75f7d2e957 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-16 14:13:30 -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
swift-ci
f125662aca Merge remote-tracking branch 'origin/main' into rebranch 2022-05-10 12:53:39 -07:00
Slava Pestov
bfcaa39d37 Remove the GenericSignatureBuilder
Resolves rdar://problem/88136582.
2022-05-10 11:47:06 -04:00
swift-ci
7eff6ccfec Merge remote-tracking branch 'origin/main' into rebranch 2022-05-10 05:33:46 -07: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
Ben Barham
114b4d96e4 [next] Use new VersionTuple API
The `VersionTuple` API was changed llvm/llvm-project
219672b8dd06c4765185fa3161c98437d49b4a1b to return `VersionTuple`
from `get*Version` rather than pass in major, minor, and subminor output
parameters. Update uses to the new API.

Note that `getMacOSXVersion` is slightly different in that it returns a
boolean while taking a `VersionTuple` output parameter to match its
previous behaviour. There doesn't seem to be any use that actually
checks this value though, so we should either update the API to return
an `Optional` and actually check it *or* remove the "failure" case and
return a `VersionTuple` like all the others.
2022-05-05 16:25:10 -07: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