Allan Shortlidge
1ff1a8d7bc
AST: Store the active DeclContext in AvailabilityScope.
...
In the future, the `DeclContext` for a given scope will be needed as an input
in order to query for the `AvailabilityDomain` associated with an
`AvailabilitySpec`.
2025-02-20 08:57:45 -08:00
fahadnayyar
d8f919778d
[cxx-interop] [cxx-interop] Infer SWIFT_SHARED_REFERENCE for types inheriting from a C++ foreign reference type
...
rdar://97914474
2025-02-20 08:46:57 -08:00
Gabor Horvath
a6c6a005d7
[cxx-interop] Support ObjC classes in generic context in reverse interop
...
We have the sufficient type metadata on the Swift side so this PR only
makes sure the type traits are correctly generated.
rdar://145211212
2025-02-20 15:19:32 +00:00
Doug Gregor
6e4f711a55
Merge pull request #79512 from DougGregor/unsafe-storage-checking-generic
...
Fix declaration context for unsafe storage checking
2025-02-20 02:21:30 -10:00
Doug Gregor
052958eea9
Merge pull request #79462 from DougGregor/remove-unsafe-from-inline
...
Remove "unsafe" keyword from expressions when printing inlinable code
2025-02-20 00:41:06 -10:00
Pavel Yaskevich
dd1be8f6d4
[Frontend] Hide @execution attribute behind an experimental feature ExecutionAttribute
...
Since the proposal has not been approved yet we cannot expose
`@execution` attribute.
2025-02-20 00:05:03 -08:00
Doug Gregor
c308cfd26a
Fix declaration context for unsafe storage checking
...
Fix a compiler crash involving checking of generic types for unsafe
storage.
2025-02-19 21:31:20 -10:00
Daniil Kovalev
83a028d105
[AutoDiff] Allow closure differentiation when used as default arg val ( #78373 )
...
If the default argument generator (and, consequently, the function taking this default argument) has public visibility, it's OK to have a closure (which always has private visibility) as the default value of the argument.
2025-02-19 22:34:56 -08:00
Rintaro Ishizaki
3a8cb9b094
Merge pull request #79490 from rintaro/astgen-layout-constraint
...
[ASTGen] Generate generic layout constraint
2025-02-19 22:06:22 -08:00
eeckstein
06042c1cba
Merge pull request #79483 from eeckstein/fix-temp-lvalue-opt
...
TempLValueOpt: avoid creating invalid apply argument aliasing.
2025-02-20 06:55:33 +01:00
eeckstein
ee360e0854
Merge pull request #79484 from eeckstein/fix-simplify-cfg
...
SimplifyCFG: remove all borrowed-from uses from arguments when merging blocks
2025-02-20 06:55:09 +01:00
eeckstein
3aae44dbef
Merge pull request #79482 from eeckstein/fix-const-expr
...
ConstExpr: fix handling of store_borrow
2025-02-20 06:53:50 +01:00
Becca Royal-Gordon
369e6d3706
Merge pull request #79413 from beccadax/negative-the-predicates-had-no-effect
...
[PrintAsClang] Kill declaration sorting bugs super-dead
2025-02-19 21:20:56 -08:00
Michael Gottesman
dcba66f646
Merge pull request #79502 from gottesmm/pr-0157e2d0f6c260a7cd233938fd987b1ada6a30da
...
[rbi] Fix a thinko where while finding closure uses, I was not checking if functions had a body when looking for arguments.
2025-02-19 21:13:21 -08:00
Slava Pestov
668928e591
Merge pull request #79475 from slavapestov/issue-a-retraction
...
Sema: Clean up odd bit of dead code in binding inference
2025-02-19 23:55:36 -05:00
Slava Pestov
a7b50c0b62
Merge pull request #79489 from slavapestov/fix-rdar145092838
...
Sema: Don't record constraints containing UnboundGenericType from shrink()
2025-02-19 23:42:09 -05:00
Pavel Yaskevich
613fbaf76e
[Sema] Either variant of @execution is incompatible with other isolation
...
According to the proposal both variants cannot be used together
with other forms of isolation i.e. isolated parameters, global
actors, `@isolated(any)` attributes.
2025-02-19 20:06:15 -08:00
Konrad `ktoso` Malawski
e8668684a1
Merge pull request #79411 from amartini51/typo_144059094
...
Remove double word ("a a" and "the the")
2025-02-20 13:05:06 +09:00
Pavel Yaskevich
e2ff3308be
[Frontend] NFC: Rename NonIsolatedAsyncInheritsIsolationFromContext feature
...
New name is `AsyncCallerExecution` as stated by the proposal.
2025-02-19 20:00:56 -08:00
Dario Rexin
71f994d26a
Merge pull request #79372 from drexin/wip-refactor-typed-throws
...
[IRGen] Remove code duplication in CallEmission::emitToUnmappedExplosionWithDirectTypedError
2025-02-19 19:21:52 -08:00
Michael Gottesman
3ef18eaf1d
Merge pull request #79300 from gottesmm/pr-12bede947a34719b34b1aa8ea6c126a6126d6dd6
...
[concurrency] Implement serialization for execution(caller)/execution(concurrent).
2025-02-19 18:29:02 -08:00
Allan Shortlidge
ff17263e56
Merge pull request #79480 from tshortli/exclude-parser-diags
...
Parse: Avoid including `DiagnosticsParse.h` in `Parser.h`
2025-02-19 18:19:29 -08:00
Meghana Gupta
31ad30e6ac
Merge pull request #79493 from meg-gupta/csesave
...
Avoid creating unoptimizable copies in CSE
2025-02-19 17:56:43 -08:00
Allan Shortlidge
7492e961dc
Merge pull request #79494 from tshortli/type-check-availability-spec
...
Parse/Sema: Move some `AvailabilitySpec` diagnostics from Parse to Sema
2025-02-19 17:07:24 -08:00
Pavel Yaskevich
1067ead82c
[Mangling] Mangle presence of @execution(caller) in a function type
...
If `@execution(caller)` attribute is present on a function type,
mark its presence in the mangling with `YC` suffix.
2025-02-19 16:48:41 -08:00
Rintaro Ishizaki
2b14a233b7
[ASTGen] Generate generic layout constraint
2025-02-19 16:38:00 -08:00
Rintaro Ishizaki
2ceb8f1e57
Merge pull request #79492 from rintaro/astgen-attr-as-modifier
...
[ASTGen] Add an assertion for attribute as an modifier
2025-02-19 15:56:55 -08:00
Rintaro Ishizaki
1a5228b31e
Merge pull request #79468 from rintaro/astgen-nonisolated
...
[ASTGen] Generate "nonisolated" decl modifier
2025-02-19 15:46:32 -08:00
Michael Gottesman
8f952d2f3d
[rbi] Fix a thinko where while finding closure uses, I was not checking if functions had a body when looking for arguments.
...
rdar://145089562
2025-02-19 14:45:09 -08:00
Rintaro Ishizaki
6aea6ce2f5
Merge pull request #79469 from rintaro/astgen-custom-type-attr
...
[ASTGen] Generate CustomAttr on types
2025-02-19 14:06:25 -08:00
Rintaro Ishizaki
e5d5026992
Merge pull request #79456 from rintaro/astgen-paramdecl
...
[ASTGen] ParamDecl generation improvements
2025-02-19 14:05:55 -08:00
Arnold Schwaighofer
8120fa3989
LoadableByAddress: Must be able to materialize undef operands
...
rdar://145092298
2025-02-19 13:59:32 -08:00
Xi Ge
fcbb15ef18
Merge pull request #79463 from swiftlang/145061506
...
ABI checker: avoid diagnosing missing availability info for decls that are only explicitly available on visionOS
2025-02-19 13:58:15 -08:00
Allan Shortlidge
e90530990a
Parse/Sema: Move some AvailabilitySpec diagnostics from Parse to Sema.
...
Eventually, querying the `AvailabilityDomain` associated with an
`AvailabilitySpec` will require invoking a request that takes a `DeclContext`.
This means that any diagnostics related to the domain identified by an
`AvailabilitySpec` need to be emitted during type-checking rather than parsing.
This change migrates several `AvailabilitySpec` diagnostics from Parse to Sema
to unblock further work.
2025-02-19 11:40:56 -08:00
Meghana Gupta
4561658799
Avoid creating unoptimizable copies in CSE
...
CSE uses OSSA rauw which creates copies and copies that are created to optimize
across borrow scopes are unoptimizable. This PR avoids this situation for now.
2025-02-19 11:20:43 -08:00
Rintaro Ishizaki
81475be976
[ASTGen] Add an assertion for attribute as an modifier
2025-02-19 11:09:53 -08:00
Slava Pestov
521ea46d15
Sema: Don't record constraints containing UnboundGenericType from shrink()
...
Something changed here between the removal of shrink() and it's
re-introduction, and we now record constraints that contain
UnboundGenericType, which crashes in matchTypes().
As a narrow workaround, let's just ignore the contextual type if
contains an UnboundGenericType.
Fixes rdar://145092838.
2025-02-19 13:27:33 -05:00
Tony Allevato
5fd985256c
[Frontend] Support -index-store-path for explicit module interface compilation.
2025-02-19 12:42:48 -05:00
Allan Shortlidge
e8329d292b
Parse: Avoid including DiagnosticsParse.h in Parser.h.
...
This prevents the include of DiagnosticsParse.h from leaking into `.cpp` files
in libraries besides Parse.
2025-02-19 07:56:38 -08:00
Erik Eckstein
328e6aad07
ConstExpr: fix handling of store_borrow
...
The `store_borrow` instruction has a result and that must be set.
Fixes a false error of the OSLogOptimization.
rdar://144896232
2025-02-19 13:30:07 +01:00
Erik Eckstein
5ef3b96da2
SimplifyCFG: remove all borrowed-from uses from arguments when merging blocks
...
So far we only considered the forwarding use. But there may be other uses.
Fixes a compiler crash.
rdar://145091197
2025-02-19 13:25:48 +01:00
Erik Eckstein
f0b7bdb382
TempLValueOpt: avoid creating invalid apply argument aliasing.
...
An indirect argument (except `@inout_aliasable`) must not alias with another indirect argument.
Now, if we would replace tempAddr with destAddr in
```
apply %f(%tempAddr, %destAddr) : (@in T) -> @out T
```
we would invalidate this rule.
This is even true if the called function does not read from destAddr.
Fixes a SIL verification error.
rdar://145090659
2025-02-19 10:33:18 +01:00
Allan Shortlidge
efab3ff0a0
Parse: Broaden an availability spec diagnostic.
...
The "can't be combined with shorthand specification" diagnostic doesn't need to
be specific to platform availability attributes.
2025-02-18 21:31:48 -08:00
Allan Shortlidge
342dc1d36f
AST: Fix an unused variable warning in Decl.cpp.
2025-02-18 21:31:48 -08:00
Allan Shortlidge
04024ec222
AST: Simplify printing of AvailabilitySpecs in ASTDumper.
2025-02-18 21:31:48 -08:00
Becca Royal-Gordon
f26a6fb985
[PrintAsClang] Tweak fallback member sort rules
...
Compare the names of all extension members first, before attempting weirder and more expensive comparisons like stringified type and mangled name. This gives us a sort order that’s a little more comprehensible to humans.
2025-02-18 17:46:20 -08:00
Slava Pestov
2cf365fa19
Sema: Fold ConstraintGraph::updateFixedType() into its last caller
2025-02-18 17:53:30 -05:00
Slava Pestov
58fdc4f805
Sema: ConstraintGraph::retractFromInference() doesn't need the new fixed type
2025-02-18 17:52:59 -05:00
Meghana Gupta
03038d201e
Fix loop rotate when header has instructions producing ownership results
...
rdar://145086395
2025-02-18 14:42:28 -08:00
Ryan Mansfield
7c97328569
Fix -Wreorder-ctor warning in DiagnosticVerifier.cpp.
2025-02-18 16:24:28 -05:00