Commit Graph

13074 Commits

Author SHA1 Message Date
swift-ci
e61c65951b Merge remote-tracking branch 'origin/main' into rebranch 2025-09-19 14:36:30 -07:00
Gabor Horvath
e4e54236ca [cxx-interop] Fix over-releasing reference members of trival C++ types
Large trivial types were copied via memcpy instead of doing a field-wise
copy. This is incorrect for types with reference fields where we also
need to bump the corresponding refcounts.

rdar://160315343
2025-09-19 14:28:33 +01:00
swift-ci
6924296975 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-18 14:58:38 -07:00
Anthony Latsis
22e85b0a8b Merge pull request #84349 from kateinoigakukun/pr-c060d7df7f5ebd5db851a07367d4128bf3b3f9ec
[IRGen] Use PrivateLinkage for `@__Swift_AST` global
2025-09-18 22:42:58 +01:00
Yuta Saito
9cb5e37efc [IRGen] Use PrivateLinkage for @__Swift_AST global
`.swift_ast` section is now recognized as a "metadata" section by LLVM's
object emission. On WebAssembly, metadata symbols must not appear in the
object file symbol table. Therefore, change the linkage of the
`@__Swift_AST` global from InternalLinkage to PrivateLinkage to avoid
exposing the symbol.

555eaef3ab
2025-09-17 16:10:32 +00:00
swift-ci
df8f7818a0 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-16 20:26:17 -07:00
Doug Gregor
56f60635b1 Merge pull request #84328 from DougGregor/coroframealloc-backdeploy 2025-09-16 20:15:50 -07:00
Doug Gregor
f7264e327f [IRGen] Only use a stub for swift_coroFrameAlloc when we need it
swift_coroFrameAlloc was introduced in the Swift 6.2 runtime. Give it
the appropriate availability in IRGen, so that it gets weak
availability when needed (per the deployment target). Then, only
create the stub function for calling into swift_coroFrameAlloc or
malloc (when the former isn't available) when we're back-deploying to
a runtime prior to Swift 6.2. This is a small code size/performance
win when allocating coroutine frames on Swift 6.2-or-newer platforms.

This has a side effect of fixing a bug in Embedded Swift, where the
swift_coroFrameAlloc was getting unconditionally set to have weak
external linkage despite behind defined in the same LLVM module
(because it comes from the standard library).

Fixes rdar://149695139 / issue #80947.
2025-09-16 10:51:12 -07:00
swift-ci
0d2c4ca9be Merge remote-tracking branch 'origin/main' into rebranch 2025-09-15 10:29:21 -07:00
Meghana Gupta
c764244df0 Merge pull request #84180 from meg-gupta/borrowandmutatepr
Add preliminary support for borrow accessors
2025-09-15 10:01:15 -07:00
swift-ci
4bbfc9db04 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-13 17:40:42 -07:00
John McCall
c987ea9c8e Merge pull request #84236 from ellishg/objc-prop-methname-section
[ObjC][GenDecl] Emit ObjC properties in __objc_methname section
2025-09-13 18:13:17 -04:00
swift-ci
bf9d79f5c1 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-13 06:17:00 -07:00
Slava Pestov
6bf5213d41 Merge pull request #84251 from slavapestov/fix-rdar151171381
Fix @_opaqueReturnTypeOf module interface syntax for parameter packs
2025-09-13 08:44:44 -04:00
Slava Pestov
10fa09cae6 IRGen: Remove a bit of duplicated code 2025-09-12 15:43:31 -04:00
swift-ci
7b9382146f Merge remote-tracking branch 'origin/main' into rebranch 2025-09-12 10:55:53 -07:00
John McCall
d532448d0b Merge pull request #84242 from rjmccall/complete-metadata-for-concurrency-builtins
Fix IRGen to pass complete metadata to various concurrency builtins
2025-09-12 10:23:28 -04:00
John McCall
fb9a1e301b Fix IRGen to pass complete metadata to various concurrency builtins
Fixes rdar://146155888
2025-09-11 18:27:39 -04:00
Ellis Hoag
f5b70998ab [ObjC][GenDecl] Emit ObjC properties in __objc_methname section 2025-09-11 12:22:24 -07:00
swift-ci
2a761f83a7 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-10 12:56:44 -07:00
Gábor Horváth
4fabc61c82 Merge pull request #84199 from Xazax-hun/no-reflection-anon-types
[cxx-interop] Restrict the uses of anonymous types
2025-09-10 20:40:03 +01:00
Gabor Horvath
1cde254dbe [cxx-interop] Restrict the uses of anonymous types
Make sure they are excluded from the reflection metadata (although in
the future we want to make sure indirect fields are included). Make sure
the users cannot refer to the anonymous field, only its members.
2025-09-10 12:12:14 +01:00
swift-ci
7f8473a16c Merge remote-tracking branch 'origin/main' into rebranch 2025-09-10 02:51:07 -07:00
Anton Korobeynikov
7668666ad2 Support differentiation of wrapped value modify accessors (#78794)
Some fixes for coroutines with normal results and `partial_apply` of coroutines were required.

Fixes #55084
2025-09-10 02:30:26 -07:00
Yuta Saito
401b705295 Merge pull request #81348 from kateinoigakukun/yt/dyn-replace-asan
IRGen: Disable ASan for the auto dynamic replacement array
2025-09-10 17:46:04 +09:00
Meghana Gupta
1cff471c57 Introduce ResultConvention::Guaranteed and ResultConvention::GuaranteedAddress
ResultConvention::Guaranteed will be used by borrow accessors when the storage type can be returned by value.

ResultConvention::GuaranteedAddress will be used by mutate accessors and borrow accessors when the storage type
cannot be returned by value.
2025-09-09 14:45:40 -07:00
Meghana Gupta
9fe489ce22 Introduce borrow and mutate as new accessor kinds
And handle them in various covered switches
2025-09-09 14:30:26 -07:00
swift-ci
e84e776fc3 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-09 07:15:59 -07:00
Doug Gregor
66a730b638 [Embedded] Remove -mergeable-symbols
This option is no longer necessary, because we emit weak definitions
for any imported modules. Fixes rdar://158364032.
2025-09-08 17:44:51 -07:00
swift-ci
b0ddb492a6 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-08 09:55:31 -07:00
Gábor Horváth
56a525b0c9 Merge pull request #84152 from Xazax-hun/add-nullptr-to-metadata
[cxx-interop] Make the size of anonymous types metadata is unchanged
2025-09-08 17:44:43 +01:00
Gabor Horvath
cae23fd098 [cxx-interop] Make the size of anonymous types metadata is unchanged
Add a null pointer to the value witness table instead of completely
skipping emitting the pointer.
2025-09-08 11:51:10 +01:00
swift-ci
e9979235de Merge remote-tracking branch 'origin/main' into rebranch 2025-09-06 12:18:17 -07:00
John McCall
92352b817d Merge pull request #84130 from rjmccall/nominal-type-visitor
[NFC] Introduce a convenience specialization of CanTypeVisitor
2025-09-06 13:59:33 -04:00
swift-ci
2fc9025c9a Merge remote-tracking branch 'origin/main' into rebranch 2025-09-05 13:49:08 -07:00
Doug Gregor
ab15602af5 Merge pull request #84110 from DougGregor/lazy-irgen-global-variables
[IRGen] Lazily emit SIL global variables
2025-09-05 13:36:42 -07:00
John McCall
64d020ec45 [NFC] Introduce a convenience specialization of CanTypeVisitor that
forwards the paired nominal type methods to common implementations.
2025-09-05 14:02:36 -04:00
swift-ci
1e13c47707 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-05 01:16:18 -07:00
Gábor Horváth
8cc45ddec3 Merge pull request #84105 from Xazax-hun/no-vwt-for-anon-types
[cxx-interop] Basic support for anonymous structs with non-copyable fields
2025-09-05 09:07:17 +01:00
Doug Gregor
dbc30dc5c9 [IRGen] Cache the layout of the LLVM struct type for statically-initialized objects
Lazy emission of SIL global variables caused us to go through the
creation of two different LLVM struct types for the same
initialization, tripping an assertion in LLVM. Cache it along with
other information about the static-initialized object rather than
rebuilding it.

Also fix the lazy_globals test to account for the laziness,
generalizing it to also run on arm64 so I won't miss it locally.
2025-09-04 15:58:32 -07:00
Doug Gregor
4009814783 [IRGen] Lazily emit SIL global variables
Delay the emission of SIL global variables that aren't externally
visible until they are actually used. This is the same lazy emission
approach that we use for a number of other entities, such as SIL
functions.

Part of rdar://158363967.
2025-09-04 13:03:15 -07:00
Gabor Horvath
0c909a8395 [cxx-interop] Basic support for anonymous structs with non-copyable fields
Anonymous structs cannot be copied or moved, these operations only can
happen to their enclosing non-anonymous types. Stop trying to emit
special member functions and value witness tables for these structs.
2025-09-04 15:20:17 +01:00
swift-ci
255ee32c29 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-03 13:48:19 -07:00
Janat Baig
f21eb5375e Merge branch 'main' into temp-branch 2025-09-02 20:23:25 -04:00
swift-ci
d4dd3ae410 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-29 09:38:00 -07:00
Dario Rexin
c38db438b2 Merge pull request #83922 from drexin/wip-159143492
[IRGen] Fix computation of spare bits for fixed arrays
2025-08-29 09:21:50 -07:00
swift-ci
605811fda2 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-29 00:13:26 -07:00
Kavon Farvardin
bb8b1e1b42 Merge pull request #83984 from kavon/avoid-not-noncopyable
nfc: avoid !isNoncopyable()
2025-08-28 17:46:39 -07:00
Dario Rexin
81af291c4f [IRGen] Fix computation of spare bits for fixed arrays
rdar://159143492

Previously all bits after the spare bits of the first element were marked as spare bits. This caused enum tags to be stored in bits used by the payload.
2025-08-28 12:27:40 -07:00
Kavon Farvardin
3bb8fa848a nfc: !isNoncopyable() -> isCopyable() 2025-08-28 12:13:21 -07:00