Commit Graph

1709 Commits

Author SHA1 Message Date
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
Slava Pestov
5c5d2eadf6 Merge pull request #41945 from slavapestov/rqm-split-concrete-equiv-class-improvements
RequirementMachine: Improve the 'split concrete equivalence classes' hack a bit
2022-03-22 20:59:07 -04:00
Richard Wei
335b766b25 [ResultBuilders] Enable SE-0348 buildPartialBlock by default.
Enables SE-0348 `buildPartialBlock` feature by default. The frontend flag is kept for compatibility with existing clients, but is now ineffective.

Also includes some improved error messages for invalid result builder call sites.
2022-03-22 16:26:50 -07:00
Allan Shortlidge
4e99cca356 Merge pull request #41940 from tshortli/target-min-inlining-version-min-by-default
Assume `-target-min-inlining-version min` for `-library-level api` modules
2022-03-22 15:26:02 -07:00
Slava Pestov
9ccdd15d58 RequirementMachine: Add upper bound on number of attempts at splitting concrete equivalence classes 2022-03-22 15:02:06 -04:00
Andrew Trick
406aa86d2e Merge pull request #41557 from atrick/addrlower-update
Update and reimplement AddressLowering pass (for SIL opaque values).
2022-03-21 22:15:06 -07:00
Allan Shortlidge
81fc0aed87 Frontend: By default, assume -target-min-inlining-version min for modules compiled with -library-level api to catch availability issues in API swiftinterfaces.
Resolves rdar://90575987
2022-03-21 15:02:40 -07:00
Slava Pestov
b93717cbae RequirementMachine: Enable flags directly in LangOptions
This enables requirement machine minimization for all tools (SourceKit, etc)
not just the frontend.
2022-03-18 15:19:57 -04:00
Slava Pestov
058190e2b9 Enable -requirement-machine-inferred-signatures=verify by default 2022-03-18 00:43:26 -04:00
Slava Pestov
e6d1ef9f6d Merge pull request #41868 from slavapestov/rqm-opaque-archetypes
RequirementMachine: Opaque archetype support (sort of)
2022-03-17 23:06:24 -04:00
Slava Pestov
2f727d6b47 RequirementMachine: Opaque archetype support (sort of)
Complete support is behind a flag, because it can result in a non-convergent
rewrite system if the opaque result type has a recursive conformance of its
own (eg, `some View` for SwiftUI's View protocol).

Without the flag, it's good enough for simple examples; you just can't have
a requirement that mentions a nested type of a type parameter equated to
the concrete type.

Fixes rdar://problem/88135291, https://bugs.swift.org/browse/SR-15983.
2022-03-17 17:45:59 -04:00
Robert Widmann
363954a416 Put Variadic Generics Behind a Flag 2022-03-16 14:22:03 -07:00
Evan Wilde
c34f7055f8 Detach enable-experimental-async-top-level flag
SE-0343 is approved so it's time to pull the feature out from behind the
experimental feature flag. This patch pulls it out and deprecates
passing the flag to the frontend so that we can pull it out entirely
eventually.
2022-03-15 16:07:03 -07:00
Allan Shortlidge
b563dc0736 Frontend: Replace the abi magic value accepted by -target-min-inlining-version with a min magic value instead. The new value corresponds to the OS versions in which Swift was introduced. The introduction OS is a better floor for availability checking than the OS in which Swift became ABI stable because inlinable functions may reference clang declarations which have availability between Swift's introduction and ABI stability and framework developers ought to get diagnostics for unguarded use of those APIs in inlinable code. 2022-03-14 19:26:36 -07:00
Andrew Trick
8a7e955b0d Move -enable-sil-opaque-value to SILOptions. 2022-03-09 17:18:15 -08:00
Slava Pestov
95f122f105 RequirementMachine: Add -enable-requirement-machine-loop-normalization flag 2022-03-08 22:47:22 -05:00
Slava Pestov
a0b71e9a68 Enable -requirement-machine-abstract-signatures=verify by default 2022-03-07 23:20:41 -05:00
Allan Shortlidge
e25b822f7a Merge pull request #41673 from tshortli/inlining-availability-checking
Add -target-min-inlining-version to aid type checking for inlinable functions in resilient libraries
2022-03-07 17:30:59 -08:00
Becca Royal-Gordon
bbcd980aff Add flag for minimum inlining version 2022-03-04 10:54:52 -08:00
Andrew Trick
ab31239ace Add a comment about lexical lifetimes to CompilerInvocation.
Otherwise, it's hard for me to tell who's in charge of setting the
default.
2022-03-03 15:08:26 -08:00
Erik Eckstein
1dfb3b1a2a cross-module-optimization: be more conservative when emitting a TBD file.
If we are emitting a TBD file, the TBD file only contains public symbols of this module.
But not public symbols of imported modules which are statically linked to the current binary.
This prevents referencing public symbols from other modules which could (potentially) linked statically.
Unfortunately there is no way to find out if another module is linked statically or dynamically, so we have to be conservative.

Fixes an unresolved-symbol linker error.
rdar://89364148
2022-03-03 11:42:07 +01:00
Slava Pestov
e8d240699e RequirementMachine: Add fourth 'check' option to 'on'/'off'/'verify' flags
This compares the results like 'verify' and prints output if there is
a mismatch, but does not assert.
2022-02-26 23:04:29 -05:00
Slava Pestov
8e09ba8b45 RequirementMachine: Introduce 'concrete contraction' pre-processing pass before building rewrite system
See the comment at the top of ConcreteContraction.cpp for a detailed explanation.

This can be turned off with the -disable-requirement-machine-concrete-contraction
pass, mostly meant for testing. A few tests now run with this pass both enabled
and disabled, to exercise code paths which are otherwise trivially avoided by
concrete contraction.

Fixes rdar://problem/88135912.
2022-02-25 11:48:38 -05:00
Slava Pestov
48a882899b Merge pull request #40492 from slavapestov/rqm-enable-protocol-verify
RequirementMachine: Enable -requirement-machine-protocol-signatures=verify by default
2022-02-25 10:45:10 -05:00