Commit Graph

12816 Commits

Author SHA1 Message Date
Doug Gregor
b414a93f4e Merge pull request #72127 from DougGregor/mangle-generalized-ext-without-inverses
Disable mangling of inverses for generalized existential shape symbols
2024-03-06 16:33:37 -08:00
Kavon Farvardin
2e01f4ebf5 GenProto: drop cond. Copyable reqs from descriptor 2024-03-06 16:30:39 -08:00
Emil Pedersen
7c9a8769a1 Merge pull request #72072 from Snowy1803/tuple-fragments
Add support for op_tuple_fragment in SIL DIExpression and SIL SROA
2024-03-06 15:20:08 -08:00
Doug Gregor
cab88d15f3 Don't mangle inverse protocols within reabstraction thunks 2024-03-06 14:40:11 -08:00
Pavel Yaskevich
53c9049b99 [AST] NFC: Move distributed actor methods from ASTContext into swift namespace 2024-03-06 13:51:14 -08:00
Doug Gregor
f269cb5fbe Disable mangling of inverses for generalized existential shape symbols 2024-03-06 13:41:49 -08:00
Adrian Prantl
db237bc7a9 Merge pull request #72096 from adrian-prantl/reference-loop
Avoid copy of loop temporary
2024-03-06 13:20:54 -08:00
Allan Shortlidge
c17c19a200 Merge pull request #72109 from tshortli/maccatalyst-ldprevious
TBDGen: Specify the correct macCatalyst platform ID in `$ld$previous` directives
2024-03-06 10:58:53 -08:00
Konrad `ktoso` Malawski
746521b31c Merge branch 'main' into distributed-protocol-requirement-accessors 2024-03-06 12:52:41 +09:00
Allan Shortlidge
f49dbb06b6 TBDGen: Specify the correct macCatalyst platform ID in $ld$previous directives.
Resolves rdar://123491072
2024-03-05 19:05:19 -08:00
Kavon Farvardin
e2d33ecd5f Merge pull request #71878 from kavon/ncgenerics-mangling-2
NCGenerics: New Inverse Mangling 3DS XL
2024-03-05 18:15:40 -08:00
Allan Shortlidge
9a0598cda7 TBDGen: Use LinkerPlatformId enum type instead of casting to uint8_t.
Increase type safety by consistently using the `LinkerPlatformId` enum type,
instead of casting to/from `uint8_t` unnecessarily.

NFC.
2024-03-05 14:51:38 -08:00
Kavon Farvardin
215bd3cab4 Mangling: handle inverse requirements 2024-03-05 14:19:00 -08:00
Adrian Prantl
b5d83afaba Avoid copy of loop temporary 2024-03-05 12:16:14 -08:00
Pavel Yaskevich
c00c692c96 [IRGen] Distributed: Fix distributed actor metadata referencing when ObjC interop is disabled 2024-03-04 17:46:49 -08:00
Pavel Yaskevich
89e4fb25d6 [IRGen] Distributed/NFC: Switch from ASTMangler to IRGenMangler 2024-03-04 15:59:57 -08:00
Pavel Yaskevich
b443266580 [IRGen] Distributed: Start emitting distributed actor accessors for protocol requirements 2024-03-04 15:59:57 -08:00
Pavel Yaskevich
1e06448da7 [IRGen] Distributed: Remove a requirement that accessible function should be backed by SILFunction
Distributed protocol requirements don't have associated SILFunction,
let's introduce a more flexible way to define it that collects only
the information necessary for the function to become accessible.
2024-03-04 15:59:57 -08:00
Pavel Yaskevich
c6820a539b [IRGen] Distributed: Expand distributed actor accessor to support protocol requirements
Given the following protocol:

```
protocol Greeter : DistributedActor {
  distributed func greet()
}
```

The changes make it possible to synthesize a distributed accessor
thunk for the requirement `greet` which would be dispatched to the
underlying concrete actor implementation at runtime.
2024-03-04 15:59:23 -08:00
Emil Pedersen
35e346fd8d Add support for op_tuple_fragment in SIL DIExpression and SIL SROA
rdar://124034536
2024-03-04 15:46:02 -08:00
Nate Chandler
fb760f4846 [IRGen] Require same copyability to reuse layout.
Previously, in place of the layout of an aggregate which consisted of
exactly one field, the layout of that one field would be used.  This is
incorrect in the case that the aggregate is noncopyable but the field is
not.  Here, it's checked that the move-only-ness of the field matches
the move-only-ness of the aggregate.

rdar://123197751
2024-03-04 14:35:05 -08:00
nate-chandler
19fbe5b33d Merge pull request #72034 from nate-chandler/rdar123560548-onone
[IRGen] Outlined consume functions call noncopyable deinits.
2024-03-02 08:52:21 -08:00
Alastair Houghton
0860953945 Merge pull request #72011 from al45tair/eng/PR-23335318
[IRGen] Don't call objc_retainAutoreleasedReturnValue() without interop.
2024-03-02 13:52:24 +00:00
Nate Chandler
f638918be8 [IRGen] Multi payload enum consumes call deinits.
They include the necessary metadata.
2024-03-01 21:01:50 -08:00
Nate Chandler
0075682b4d [IRGen] Single payload enums consumes call deinits
The include the necessary metadata.
2024-03-01 21:01:50 -08:00
Nate Chandler
04d06806b2 [NFC] IRGen: Extracted method. 2024-03-01 21:01:50 -08:00
Nate Chandler
f37d2a21e4 [Gardening] IRGen: Doc'd method. 2024-03-01 21:01:50 -08:00
Nate Chandler
9a8c814553 [Outlining] Pass polymorphic args of type.
If any deinit must be called, just pass the full generic environment of
the type being destroyed.
2024-03-01 21:01:50 -08:00
Nate Chandler
b83085b00b [NFC] IRGen: Extracted function. 2024-03-01 21:01:49 -08:00
Nate Chandler
3f6bd9d3e1 [NFC] IRGen: Store SILType in metadata collector. 2024-03-01 21:01:49 -08:00
Nate Chandler
babdbda2d4 [NFC] IRGen: Moved constructor to cpp. 2024-03-01 21:01:49 -08:00
Nate Chandler
73ccf1c9fb [NFC] IRGen: Extracted method. 2024-03-01 21:01:49 -08:00
Nate Chandler
a82140bc1c [NFC] IRGen: Renamed method.
Not all metadata that the OutliningMetdataCollector collects is for
layout anymore.
2024-03-01 21:01:49 -08:00
Nate Chandler
765d23bbbc [NFC] IRGen: Clarify metadata collection helper.
Gather the circumstances under which the collector should be used and
what it should collect separately and then collect only in one place if
collection should happen.
2024-03-01 21:01:49 -08:00
Nate Chandler
1253dba02b [NFC] IRGen: Renamed outlining helpers.
In preparation for them handling more polymorphic arguments than merely
metadata.
2024-03-01 21:01:49 -08:00
Nate Chandler
5d8dfde980 [NFC] IRGen: Added debugging info.
In debug builds, provide some context when an archetype fails to be
found.
2024-03-01 21:01:49 -08:00
Nate Chandler
195046a605 [NFC] IRGen: Marked member const. 2024-03-01 21:01:49 -08:00
Nate Chandler
379beabf3a [Gardening] IRGen: Changed a variable name. 2024-03-01 21:01:49 -08:00
Nate Chandler
c867e4c37e [NFC] IRGen: Marked some functions public. 2024-03-01 21:01:49 -08:00
Nate Chandler
fefd793a2a [NFC] IRGen: Renamed method. 2024-03-01 21:01:49 -08:00
Pavel Yaskevich
0f41071fe6 [IRGen] Distributed: Switch DistributedAccessor linking to reference underlying thunks
Preparing to start emitting distributed requirement accessors
that don't have `SILFunction *` because they are associated with
protocol requirements.
2024-03-01 17:12:23 -08:00
Augusto Noronha
76853717c2 Merge pull request #71939 from augusto2112/fix-specify-of-2
[DebugInfo] Fix bound generic types debug info generation
2024-03-01 16:40:31 -08:00
Pavel Yaskevich
548f2f63ff [IRGen] Distributed/NFC: Collect all target handling logic into AccessorTarget 2024-03-01 15:47:36 -08:00
Augusto Noronha
9178c4a346 Merge pull request #71962 from augusto2112/embedded-flag
[DebugInfo] Emit embedded swift into DW_AT_APPLE_flags
2024-03-01 15:12:39 -08:00
Pavel Yaskevich
89231745c8 [IRGen] Distributed: Drop unused parameter from getAccessorType 2024-03-01 14:32:56 -08:00
Alastair Houghton
d0c35cf2d5 [IRGen] Don't call objc_retainAutoreleasedReturnValue() without interop.
When ObjC interop is not enabled, we shouldn't be emitting calls to
`objc_retainAutoreleasedReturnValue()` as that function might not exist.

Call `swift_retain()` instead, to balance the `swift_release()` of the
returned value.

Fixes #47846, #45359.

rdar://23335318
2024-03-01 20:34:43 +00:00
Adrian Prantl
8a25294f50 Merge pull request #71965 from augusto2112/fix-lto-decl
[DebugInfo] Emit witness and objc method declarations in debug info
2024-03-01 09:26:02 -08:00
John McCall
237dd4faab Merge pull request #71970 from rjmccall/isolated-any-availability
Fix metadata availability testing for parameterized existentials and implement it for @isolated(any) function types
2024-03-01 04:11:22 -05:00
John McCall
0f076c0702 Fix metadata availability testing for parameterized existentials
and implement it for @isolated(any) function types.

The existing testing was pretty broken: we were diagnosing all sorts
of things that don't require type metadata (like using a tuple with
an extended existential in a value position in an API signature)
and not diagnosing several things that do (like covariant function
conversions that erase types).  There's therefore some risk to this
patch, but I'm not too worried because needing metadata like this is
pretty uncommon, and it's likely that programs won't build correctly
anyway --- it'll just get caught by the linker instead of the compiler.
2024-02-29 22:14:49 -05:00
Augusto Noronha
0b8abda060 [DebugInfo] Emit embedded swift into DW_AT_APPLE_flags
To properly initialize the compiler instance on LLDB when debugging
embedded Swift programs, emit "-enable-embedded-swift" into the
DW_AT_APPLE_flags attribute of the compile unit.
2024-02-29 16:37:13 -08:00