Commit Graph

1173 Commits

Author SHA1 Message Date
Alejandro Alonso
f25545b785 Add a module interface test 2024-09-04 15:13:48 -07:00
Doug Gregor
601a5c3c0c Merge pull request #76187 from DougGregor/extract-inlinable-text-swift-syntax
Implement extractInlinableText with swift-syntax
2024-09-04 07:53:40 -07:00
Allan Shortlidge
eafb40588c Merge pull request #76240 from tshortli/maccatalyst-tests
Tests: Adjust several macCatalyst tests
2024-09-04 02:47:05 -07:00
elsh
640b1252fc Do not print package-name in non-package interface by default.
Having package-name printed in public or private interface led to strange dependency errors in the past. For example, an SPI module is a dependency within a package, but due to the package-name being printed in public or private interface, dependency scanner tries to find it even for an external client of the package, causing a `no such module found` error. The  -disable-print-package-name-for-non-package flag helps with such case, but to enforce the correct behavior, we should make it a default to not print package-name in public or private interface.

Resolves rdar://135260270
2024-09-04 02:40:19 -07:00
Allan Shortlidge
0ea7ee8229 Tests: Upstream default-prebuilt-module-location-maccatalyst.swift. 2024-09-03 22:14:24 -07:00
Alex Hoppen
c5aa49ba64 Revert "Isolated synchronous deinit" 2024-09-03 18:11:26 -07:00
Doug Gregor
a73711ef4b Implement extractInlinableText with swift-syntax
Replace the existing C++ implementation of extractInlinableText with
a new implementation based on swift-syntax. It uses SwiftIfConfig to
remove inactive regions (with a special mode), and a new compiler-only
entrypoint in the library to remove comments and `#sourceLocation`.
2024-08-30 16:43:41 -07:00
Mykola Pokhylets
50b1313175 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	lib/SILGen/SILGenDistributed.cpp
#	lib/Sema/TypeCheckConcurrency.cpp
2024-08-15 16:58:43 +02:00
Ellie Shin
dc1c34dfa1 [Sema] Treat @usableFromInline package decls from interface as public and skip access checks
Resolves rdar://133319906
2024-08-13 17:01:19 -07:00
Alexis Laferrière
eea22c2f09 Merge pull request #75659 from xymus/shadow-dont-warn-with-alias-workaround
ModuleInterface: Don't warn on name conflict when the alias workaround is enabled
2024-08-05 12:38:00 -07:00
Alexis Laferrière
b4fb5720b2 ModuleInterface: Don't warn on name conflict when the alias workaround is enabled
This warning is designed to be an early report of name conflicts in
swiftinterfaces caused by a type having the same name as a module.
Make sure we silence this warning when the workaround
-alias-module-names-in-module-interface is enabled. This is what we
already do for -module-interface-preserve-types-as-written.

rdar://132990400
2024-08-02 14:48:29 -07:00
Allan Shortlidge
2899aa5660 ModuleInterface: Add more test cases to actor_init.swift.
Resolves rdar://133012963.
2024-08-02 07:50:51 -07:00
Allan Shortlidge
403156b088 Revert "AST: Don't print convenience on actor initializers."
This reverts commit 3453b136c3.
2024-08-02 07:50:51 -07:00
Pavel Yaskevich
4efb210823 Merge pull request #75546 from xedin/rdar-132551887
[Tests] NFC: Fix init accessors test-case to support both 32 and 64 b…
2024-07-30 00:04:15 -07:00
Kavon Farvardin
972373b129 NCGenerics: begin process of removing compat hack
The reverse-condfail workaround needs to be removed, and this is the
first step to allowing the stdlib to build with conditionally escapable
types.

resolves rdar://132453000
2024-07-29 17:27:17 -07:00
Pavel Yaskevich
3a974fa545 [Tests] NFC: Fix init accessors test-case to support both 32 and 64 bit platforms
Resolves: rdar://132551887
2024-07-29 09:50:23 -07:00
Allan Shortlidge
d81f8db52f Merge pull request #75411 from tshortli/module-interface-lazy-typecheck-invalid-extension
ModuleInterface: Avoid crashing on invalid extensions in lazy typechecking mode
2024-07-23 15:49:57 -07:00
Kavon Farvardin
5230b19ef6 Test: replace '@_moveOnly' with '~Copyable' 2024-07-23 11:05:33 -07:00
Allan Shortlidge
a621059f80 ModuleInterface: Avoid crashing on invalid extensions in lazy typechecking mode.
With `-experimental-lazy-typecheck` specified during module interface emission,
`collectProtocols()` may be the first piece of code to request the extended
type for a given extension and it therefore needs to ignore invalid extensions
and ensure that diagnostics are emitted.

Also, add some `PrettyStackTrace` coverage to `ModuleInterfaceSupport.cpp` to make
investigating future issues easier.

Resolves rdar://126232836.
2024-07-23 10:32:50 -07:00
Kavon Farvardin
99dec9fcd2 Test: finish noncopyable accessor test
rdar://106164128
2024-07-23 08:11:37 -07:00
Allan Shortlidge
e836fea314 ModuleInterface: Print -target-variant flag in .swiftinterface files.
This is necessary to ensure that availability checks contained in inlined
functions are compiled correctly for zippered modules when built from
interface.

Resolves rdar://130094532.
2024-07-18 12:43:34 -07:00
Kavon Farvardin
1fa02fb0fe Revert "NCGenerics: remove the reverse-condfail workaround"
This reverts commit 5b2f2cbfcf.
2024-07-16 08:10:00 -07:00
Pavel Yaskevich
cfb50a0aef Merge pull request #75191 from xedin/inlinable-init-accessors
[AST/Sema] Make it possible to use init accessors in inlinable initializers
2024-07-15 09:16:30 -07:00
Ellie Shin
8bb6b30288 Merge pull request #75160 from swiftlang/elsh/lookup-pkg-interface
Correct discrepancies in the package interface file lookup.
2024-07-12 11:56:16 -07:00
Pavel Yaskevich
be3396821e [AST] Print init accessors when they are ABI-public
Using init accessors from inlinable code requires `@usableFromInline`
annotation, which means that we need to print them in swift interfaces
and serialize them.
2024-07-12 09:54:08 -07:00
Kavon Farvardin
4529f3b295 Merge pull request #75183 from kavon/remove-reverse-condfail-workaround
NCGenerics: remove the reverse-condfail workaround
2024-07-12 09:39:12 -07:00
Kavon Farvardin
5b2f2cbfcf NCGenerics: remove the reverse-condfail workaround
This should no longer be needed, after having staged the first set of
changes in, as it was a temporary workaround.

resolves rdar://131560183
2024-07-11 14:30:27 -07:00
Ellie Shin
5e58876b16 Update tests 2024-07-11 13:13:00 -07:00
Mykola Pokhylets
1304f81a04 Fixed CI builds 2024-07-11 21:54:43 +02:00
Allan Shortlidge
3453b136c3 AST: Don't print convenience on actor initializers.
Although actor initializers can be classified as convenience initializers by
the internals of the compiler, they are not written that way in source and
should not be printed with the `convenience` keyword.

Resolves rdar://130926278.
2024-07-11 11:47:19 -07:00
Mykola Pokhylets
816d62c972 Merge remote-tracking branch 'upstream/main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/SILGen/SILGenDestructor.cpp
#	test/Concurrency/flow_isolation.swift
#	test/abi/macOS/arm64/concurrency.swift
#	test/abi/macOS/x86_64/concurrency.swift
2024-07-11 13:11:59 +02:00
Mykola Pokhylets
2cb7e8d7b8 Implemented suppressing isolated deinit for compatibility with older compiler versions 2024-07-11 13:09:08 +02:00
Mykola Pokhylets
62dbc6c966 Fixed some tests. Using extract_executor SIL instruction instead of custom code. 2024-07-11 13:09:06 +02:00
Allan Shortlidge
ab68c29701 AST: Remove interface guards for a bunch of experimental features.
Since these features are experimental features, they can't be catagorized as
"baseline" features. However, there is no need to guard code in swiftinterfaces
that potentially uses syntax related to these features since all supported
compilers can parse the syntax.
2024-07-09 14:29:31 -07:00
Allan Shortlidge
45f3e94b46 AST: Promote AssociatedTypeImplements feature to baseline. 2024-07-09 14:28:30 -07:00
Allan Shortlidge
b71e73d04c AST: Promote RetroactiveAttribute feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
e7ae787516 AST: Promote ConformanceSuppression feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
b39637159c AST: Promote RethrowsProtocol feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
8dad141136 AST: Promote Extern feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
731d91f590 AST: Promote TypedThrows features to the baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
53451caf49 AST: Promote LexicalLifetimes feature to baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
e1082bb8be AST: Promote various macro features to baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
b517a44528 AST: Promote ParameterPacks feature to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
6b9b7bcd83 AST: Promote PrimaryAssociatedTypes2 feature to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
b5acc6b07d AST: Promote AsyncSequenceFailure feature to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
6f972fc275 AST: Promote AssociatedTypeAvailability feature to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
9e5a9b963f AST: Remove NoncopyableGenerics feature suppression.
It is no longer necessary to produce `.swiftinterface` files the support older
compilers that lack support for the NoncopyableGenerics feature. Cleaning this
up makes the stdlib `.swiftinterface` far more readable.
2024-07-08 17:44:24 -07:00
Allan Shortlidge
a6faa5a4bf Frontend: Only print the -project-name flag in private and package interfaces.
Resolves rdar://130992944.
2024-07-03 09:10:48 -07:00
Allan Shortlidge
7cadb0b4e3 Sema: Downgrade actor convenience initializer diagnostic to a warning in interfaces.
The `convenience` keyword is not accepted on actor initializers because the
compiler infers this status automatically and actors cannot be subclassed.
However, internally the compiler still computes whether an actor init is a
convenience init and this implicit status has been leaking through accidentally
in printed `.swiftinterface` files. This was noticed because in Swift 6 the
presence of the keyword is diagnosed as an error, making `.swiftinterface`
files unparseable for modules containing actors with convenience inits.

For Swift 6, I'm just going to suppress the error in `.swiftinterface` files
regardless of language mode. In future releases of the compiler, though, it can
stop printing the `convenience` keyword on these inits altogether, though.

Resolves rdar://130857256.
2024-07-02 08:31:23 -07:00
Ellie Shin
ea8a05399f Drop package-name if needed in SaveModuleInterfaceArgs 2024-06-28 20:24:28 -07:00