Commit Graph

2062 Commits

Author SHA1 Message Date
Anthony Latsis
3f629315a9 Merge pull request #65731 from AnthonyLatsis/always-print-any
ASTPrinter: Turn on explicit `any` printing for everything and remove the option to disable it
2023-05-16 03:27:36 +03:00
Anthony Latsis
7f6d3bcd41 ASTPrinter: Turn on explicit any printing for everything and remove the option to disable it 2023-05-13 02:55:49 +03:00
nate-chandler
4d8dab00f8 Merge pull request #65845 from nate-chandler/eagermove_language_feature
[AST] Added language feature for @_eagerMove.
2023-05-11 08:31:25 -07:00
Nate Chandler
b72395814b [AST] Added language feature for @_eagerMove.
The new LexicalLifetimes suppressible language feature results in
declarations annotated with @_eagerMove, @_noEagerMove, and
@_lexicalLifetimes to be printed with that attribute when it's available
and without it when it's not.
2023-05-10 18:19:49 -07:00
Kavon Farvardin
3e4bc82aa8 rename _forget to discard; deprecate _forget
SE-390 concluded with choosing the keyword discard rather than forget for
the statement that disables the deinit of a noncopyable type. This commit
adds parsing support for `discard self` and adds a deprecation warning for
`_forget self`.

rdar://108859077
2023-05-08 21:42:19 -07:00
Allan Shortlidge
ffaa1d5dbc Revert "[Macros] Treat FreestandingExpressionMacros as a suppressible feature"
This reverts commit b412c6c884.

Resolves rdar://108591384
2023-05-01 19:44:39 -07:00
BJ Homer
3e2d614c07 Merge branch 'main' into disable-property-wrapper-based-isolation 2023-05-01 08:39:12 -06:00
Slava Pestov
df5d531dc6 ASTPrinter: Fix printing of pack requirements
Also remove the flag for printing 'each' and make it always on.
2023-04-19 13:04:51 -04:00
Joe Groff
8ea5ab84d3 Merge pull request #65173 from jckarter/noncopyable-tuples-not-supported
Diagnose attempts to use tuples with noncopyable elements.
2023-04-17 10:49:53 -07:00
Holly Borla
336da919fe [Features] Add a dedicated experimental feature flag for tuple conformances. 2023-04-15 17:23:25 -07:00
Joe Groff
52e97d6544 Diagnose attempts to use tuples with noncopyable elements.
These aren't fully supported yet. rdar://108024586
2023-04-14 16:49:30 -07:00
Holly Borla
234b5dc660 [SE-0393] Require the repeat keyword for generic requirement expansions. 2023-04-12 22:04:01 -07:00
Slava Pestov
2068dc82f9 AST: Refactor printing of generic types a bit 2023-04-05 23:42:16 -04:00
Slava Pestov
4f2ab59ee5 Merge pull request #64875 from slavapestov/parameter-packs-feature-flag
Guard usage of variadic generics with $ParameterPacks in module interface files
2023-04-05 09:48:47 -04:00
Richard Wei
01e6fe2936 [Macros] Code item macros
Add support for declaring and expanding code item macros.  Add experimental feature flag `CodeItemMacros`.
2023-04-04 09:54:57 -07:00
Slava Pestov
093fa282b0 Guard usage of variadic generics with $ParameterPacks in module interface files
Fixes rdar://107559541.
2023-04-03 19:49:39 -04:00
Alejandro Alonso
4a681160dc Merge pull request #64673 from Azoy/builtin-module-feature
[Frontend] Add BuiltinModule experimental feature
2023-03-29 23:12:40 -07:00
Doug Gregor
9292231e1f [Macros] Start recording expanded macro definitions and replacements
Handle a trivial macro defined in terms of another macro.
2023-03-29 16:32:28 -07:00
QuietMisdreavus
0d74959af6 don't print macro definitions in symbol graphs (#64732)
rdar://106862694
2023-03-29 17:04:00 -06:00
Nuri Amari
564621e330 Create feature flag for SE-0384 2023-03-29 10:25:22 -07:00
Michael Gottesman
8453978896 Merge pull request #64692 from gottesmm/pr-f1e588ca3b1fd387de94e5afc8350ef1dd1caf3e
[move-only] Temporarily ban deinits on non-copyable enums.
2023-03-29 01:37:41 -07:00
Dario Rexin
45b8cfd511 [ModuleInterface] Guard layout based prespecializations in swiftinter… (#64695)
* [ModuleInterface] Guard layout based prespecializations in swiftinterface files

rdar://107269447

To allow compilers that don't have this feature enabled to parse interface files that contain declarations that use layout based prespecializations, it has to be guarded.

* Incorporate feedback
2023-03-28 22:43:45 -07:00
Michael Gottesman
aa75e6d99f [move-only] Temporarily ban deinits on non-copyable enums.
The reason why we are doing this is that:

1. For non-copyable types, switches are always at +1 for now.
2. non-copyable enums with deinits cannot be switched upon since that would
invalidate the deinit.

So deinits on non-copyable enums are just not useful at this point since you
cannot open the enum.

Once we make it so that you can bind a non-copyable enum at +0, we will
remove this check.

I added an experimental feature MoveOnlyEnumDeinits so tests that validate the
codegen/etc will still work.

rdar://101651138
2023-03-28 16:07:15 -07:00
swift-ci
3be14e0a4a Merge pull request #64622 from kavon/bifurcate-moveonly-featureflag
Fix minimal stdlib builds with noncopyable types
2023-03-28 14:44:24 -07:00
Alejandro Alonso
c21899ee0f Add BuiltinModule experimental feature 2023-03-28 09:41:37 -07:00
swift-ci
8ac71b115c Merge pull request #64525 from beccadax/checkmate-ii
Re-merge #63668: Improve @objcImplementation member checking
2023-03-28 00:56:44 -07:00
Konrad `ktoso` Malawski
0586c14b60 [Concurrency] SerialExecutor.isSameExclusiveExecutionContext (#64604) 2023-03-28 15:56:28 +09:00
Becca Royal-Gordon
04a27b822c Omit @objcImpl from module interfaces
Module interfaces should not include the @objcImplementation attribute, member implementations that are redundant with the ObjC header, or anything that would be invalid in an ordinary extension (e.g. overridden initializers, stored Swift-only properties).
2023-03-25 14:53:29 -07:00
Kavon Farvardin
6f98e9a2c6 trifurcate the MoveOnly feature
I want to reserve Feature::MoveOnly only for move-only types and other
things that are part of SE-390. Other prototyped features like
noimplicitcopy and some older names for consume were left behind
as guarded by this Feature. That's really not the right way to do it,
as people will expect that the feature is enabled all the time, which
would put those unofficial features into on-by-default. So this change
introduces two new Features to guard those unofficial features.
2023-03-24 15:43:35 -07:00
Alex Lorenz
259763c278 [interop] do not print inline C++ namespaces when printing module interface 2023-03-20 19:47:49 -07:00
Egor Zhdan
55a08bb2e5 Merge pull request #64453 from apple/egorzhdan/cxx-completion-unsafe
[cxx-interop] Do not auto-complete unsafe underscored methods, part 2
2023-03-17 22:05:39 +00:00
Egor Zhdan
9247d53082 [cxx-interop] Do not auto-complete unsafe underscored methods, part 2
Previous patch removed unsafe C++ methods from the module interface, but not from auto-completion results.

rdar://103252957
2023-03-17 18:04:22 +00:00
Ben Barham
fd84ae98c2 Merge pull request #64367 from bnbarham/system-to-sdk
[SourceKit] Stop using `isSystemModule` to represent "non-user" modules
2023-03-17 10:15:04 -07:00
Ben Barham
eec2848508 [SourceKit] Stop using isSystemModule to represent "non-user" modules
Rather than using `ModuleDecl::isSystemModule()` to determine whether a
module is not a user module, instead check whether the module was
defined adjacent to the compiler or if it's part of the SDK.

If no SDK path was given, then `isSystemModule` is still used as a
fallback.

Resolves rdar://89253201.
2023-03-15 14:29:48 -07:00
John McCall
09018a8981 [NFC] Store interface shape types in opened element environments 2023-03-15 17:25:04 -04:00
Konrad `ktoso` Malawski
41f99fc2ae [Executors][Distributed] custom executors for distributed actor (#64237)
* [Executors][Distributed] custom executors for distributed actor

* harden ordering guarantees of synthesised fields

* the issue was that a non-default actor must implement the is remote check differently

* NonDefaultDistributedActor to complete support and remote flag handling

* invoke nonDefaultDistributedActorInitialize when necessary in SILGen

* refactor inline assertion into method

* cleanup

* [Executors][Distributed] Update module version for NonDefaultDistributedActor

* Minor docs cleanup

* we solved those fixme's

* add mangling test for non-def-dist-actor
2023-03-15 23:42:55 +09:00
Allan Shortlidge
6b0c22c334 Merge pull request #64311 from tshortli/print-accessor-attributes
AST: Print attributes on accessor declarations
2023-03-13 10:34:04 -07:00
Allan Shortlidge
dd41a3e946 AST: Print attributes on accessor declarations.
This ensures that the output of `swift-frontend -print-ast-decl` includes availability annotations if present. Previously, they were omitted by the compact printing logic.
2023-03-12 18:03:18 -07:00
Egor Zhdan
201a3b1076 Merge pull request #64287 from apple/egorzhdan/do-not-auto-complete-unsafe
[cxx-interop] Do not auto-complete unsafe underscored methods
2023-03-13 00:06:32 +00:00
Egor Zhdan
8326c84bfc [cxx-interop] Do not auto-complete unsafe underscored methods
e.g. `__beginUnsafe()` or `__endUnsafe()` which return iterators

rdar://103252957
2023-03-10 19:31:04 +00:00
Doug Gregor
b412c6c884 [Macros] Treat FreestandingExpressionMacros as a suppressible feature
When the feature isn't available, use the older `@expression` syntax to
work around limitations of older compilers.
2023-03-09 20:33:30 -08:00
Richard Wei
833338f9ce [Macros] Top-level freestanding macros (#63553)
Allow freestanding macros to be used at top-level.
- Parse top-level `#…` as `MacroExpansionDecl` when we are not in scripting mode.
- Add macro expansion decls to the source lookup cache with name-driven lazy expansion. Not supporting arbitrary name yet.
- Experimental support for script mode and brace-level declaration macro expansions: When type-checking a `MacroExpansionExpr`, assign it a substitute `MacroExpansionDecl` if the macro reference resolves to a declaration macro. This doesn’t work quite fully yet and will be enabled in a future fix.
2023-03-06 07:15:20 -08:00
swift-ci
302180f542 Merge pull request #64126 from kavon/moveonly-swiftinterfaces
ensure decls using move-only types are feature-guarded
2023-03-05 19:23:52 -08:00
Kavon Farvardin
b78e2f58e7 Ensure all decls using move-only types are feature-guarded
rdar://106262652
2023-03-05 16:28:09 -08:00
Dario Rexin
5fe716577b [IRGen] Add layout strings for generic and resilient types (#64023)
* [IRGen] Add layout strings for generic and resilient types

rdar://105837048

* Add some corner cases

* Add flag to enable generic instantiation and some fixes

* Fix resilient types

* Fix metadata accessor function pointers in combined layout strings
2023-03-05 15:26:45 -08:00
Doug Gregor
1a4d6b6519 [Macros] Ensure that we escape macro declared names in printing.
Fixes an issue where we couldn't round-trip macro declared names
2023-03-04 22:41:09 -08:00
Michael Gottesman
78d57ea6be [reference-bindings] Put reference bindings support behind -enable-experimental-feature ReferenceBindings. 2023-03-03 17:14:16 -08:00
Alexis Laferrière
4330921806 [Sema] Remove ImportFilterKind::SPIAccessControl
That filter wasn't needed in practice, we can remove it.
2023-03-03 11:42:59 -08:00
Joe Groff
5ef0c4eaad Merge pull request #64058 from jckarter/minimize-abi-effect-of-parameter-modifiers-b
Only mangle `borrowing`/`consuming` when they would change ABI.
2023-03-03 07:01:50 -08:00
Joe Groff
5345e982e9 Only mangle borrowing/consuming when they would change ABI.
`__shared` and `__owned` would always get mangled, even when they don't have any effect
on ABI, making it unnecessarily ABI-breaking to apply them to existing API to make
calling conventions explicit. Avoid this issue by only mangling them in cases where they
change the ABI from the default.
2023-03-02 21:33:29 -08:00