Commit Graph

7544 Commits

Author SHA1 Message Date
Alex Lorenz
5aa63fc93e Merge pull request #72634 from hyp/eng/android/ndk-overlay
[android] add an Android NDK Swift overlay
2024-06-05 19:35:13 -07:00
Tim Kientzle
eba980af03 Limit this test to macOS 2024-06-05 17:47:30 -07:00
Tim Kientzle
40eb3c084d Expand the work from #73491 to support more MPE layouts. This also switches the
MPE layout code to exclusively use the new code.  The key observation: existing
reflection metadata seems to already provide enough information in all cases, so
we can abandon an earlier effort to add spare bitmask data.

Resolves rdar://129281368
2024-06-05 10:15:58 -07:00
Nate Chandler
666f036b82 [Test] Add regression test.
For https://github.com/apple/swift/issues/68128 .
2024-06-05 07:48:50 -07:00
swift-ci
089207f2d3 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-04 18:35:07 -07:00
nate-chandler
23915e8075 Merge pull request #74109 from nate-chandler/rdar113142446
[ConsumeObjectChecker] End lifetimes at consumes.
2024-06-04 18:17:36 -07:00
Nate Chandler
cae89a9562 [ConsumeObjectChecker] End lifetimes at consumes.
The checker already verifies that no non-destroy consuming users occur
after any `move_value`s corresponding to `consume` operators applied to
a value.  There may, however, be _destroy_ users after it.

Previously, the checker did not shorten the lifetime from those destroys
up to `move_value`s that appear after those `move_value`s.  The result
was that the value's lifetime didn't end at the `consume`.

Here, the checker is fixed to rewrite the lifetimes so that they both
end at `consume`s and also maintain their lexical lifetimes on paths
away from the `consume`s.  This is done by using
`OwnedValueCanonicalization`/`CanonicalizeOSSALifetime`.

Specifically, it passes the `move_value`s that correspond to
source-level `consume`s as the `lexicalLifetimeEnds` to the
canonicalizer.  Typically, the canonicalizer retracts the lexical
lifetime of the value from its destroys.  When these `move_value`s are
specified, however, instead it retracts them from the lifetime boundary
obtained by maximizing the lifetime within its original lifetime while
maintaining the property that the lifetime ends at those `move_value`s.

rdar://113142446
2024-06-03 15:45:32 -07:00
swift-ci
1e98ad9bdf Merge remote-tracking branch 'origin/main' into rebranch 2024-05-31 21:35:10 -07:00
Alex Hoppen
ba773d5c4e Merge pull request #73659 from ahoppen/ahoppen/fix-capture-crash
[CodeCompletion] Don’t compute isolated parameter captures during code completion
2024-05-31 21:26:36 -07:00
Alex Hoppen
22f0daf7d5 [CodeCompletion] Don’t compute isolated parameter captures during code completion
Computing capture information requires a type checked AST, which we don’t have during code completion. To fix an assertion failure, don’t look for a captured `isolated` parameter while computing a closure’s actor isolation during code completion.

rdar://126923558
2024-05-31 17:44:00 -07:00
swift-ci
d23bfc9e6a Merge remote-tracking branch 'origin/main' into rebranch 2024-05-31 15:56:17 -07:00
Dario Rexin
2d0b19484f Merge pull request #74058 from drexin/wip-127535274
[IRGen] Assign layout strings for static layout generic types in meta…
2024-05-31 15:38:00 -07:00
Dario Rexin
8e2b0ec1d6 [IRGen] Assign layout strings for static layout generic types in metadata initialization function
rdar://127535274

The layout string needs to be assigned before completion, to make it available in recursive metadata initialization. Setting it in the completion function causes a race between other metadata initializers using it and the completion function running.
2024-05-31 11:24:01 -07:00
swift-ci
ff256e4a52 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-30 18:35:13 -07:00
Slava Pestov
8a7f0b8e58 Add regression test for fixed crasher 2024-05-30 16:39:49 -04:00
Slava Pestov
23be369c0e SILGen: Update for PackElementExpr captures
Fixes https://github.com/apple/swift/issues/68941.
Fixes https://github.com/apple/swift/issues/69282.
Fixes https://github.com/apple/swift/issues/72153.
Fixes rdar://110711746.
Fixes rdar://119212867.
Fixes rdar://124202697.
2024-05-30 16:39:49 -04:00
Finagolfin
a99b3748fe [android] Update tests to use new Android overlay and disable stdlib/Glibc.swift 2024-05-28 13:01:25 -07:00
swift-ci
e5905defea Merge remote-tracking branch 'origin/main' into rebranch 2024-05-26 10:54:02 -07:00
Michael Ilseman
4f83c093e5 Merge pull request #73714 from karwa/enable-norm-tests
Re-enable StringNormalization validation test
2024-05-26 11:44:43 -06:00
swift-ci
fd95cb8f45 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-26 10:34:14 -07:00
Allan Shortlidge
4bc1abb4be Sema: Relax feature check for non-escapable types in swiftinterfaces.
Checking for the presence of a feature flag in order to allow syntax tends to
result in condfails when applied to `.swiftinterfaces`, since older compilers
that have this restriction may be used to compile newer interfaces where the
restriction has been lifted. Remove this restriction for non-escapable types
when typechecking an interface.

Resolves rdar://128577611
2024-05-24 13:53:50 -07:00
Dario Rexin
de06df9fc6 [Test] Require arm64 in pack_stack_metadata_alloc_loop.sil
rdar://128431285
2024-05-23 16:41:20 -07:00
swift-ci
95de7f626b Merge remote-tracking branch 'origin/main' into rebranch 2024-05-18 04:54:40 -07:00
Slava Pestov
c7c244e16a Merge pull request #73712 from slavapestov/pack-expansion-closures-part-6
Pack expansion closures, part 6
2024-05-18 07:41:44 -04:00
Slava Pestov
4aa0008d74 SILGen: Rewrite captured local archetypes into primary archetypes
This implements support for autoclosures, closures and local functions
nested within a pack iteration for loop.

The combination of explicit closure expressions and pack expansion
expressions still needs some work.

Fixes #66917.
Fixes #69947.
Fixes rdar://113505724.
Fixes rdar://122293832.
Fixes rdar://124329076.
2024-05-17 17:45:05 -04:00
swift-ci
e08a64d130 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-17 13:55:16 -07:00
Karl Wagner
31782df287 Re-enable StringNormalization validation test 2024-05-17 19:32:48 +02:00
Hamish Knight
cbbb1c9eca [CS] Avoid creating placeholder var if skipping for completion
Otherwise we'd crash in CSApply since we'd have no
type recorded for the var.

rdar://127838305
2024-05-17 15:46:40 +01:00
swift-ci
9bc448114e Merge remote-tracking branch 'origin/main' into rebranch 2024-05-16 19:54:35 -07:00
nate-chandler
a570286201 Merge pull request #73647 from nate-chandler/rdar128077404
[PrunedLiveness] Fix boundary check for dead-ends.
2024-05-16 19:45:41 -07:00
swift-ci
60a50df76e Merge remote-tracking branch 'origin/main' into rebranch 2024-05-16 16:35:17 -07:00
Holly Borla
1b3aa8723e Merge pull request #73666 from hborla/implicit-global-actor-sendable
[Concurrency] Implicit global actor attributes imply `Sendable`.
2024-05-16 16:30:36 -07:00
Nate Chandler
9d42d69c0a [PrunedLiveness] Fix boundary check for dead-ends.
Consider dead, dead-end blocks within the availability boundary to be
within the boundary.

rdar://126965232
2024-05-16 15:53:06 -07:00
Holly Borla
1b0dca035e [NFC] Update concurrency validation test. 2024-05-16 10:18:34 -07:00
Nate Chandler
353e4955ee [Test] embedded: Use test lit in validation-test. 2024-05-15 11:52:18 -07:00
swift-ci
99593fa393 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-15 11:14:36 -07:00
Joe Groff
10f9289ef8 Enable 'BorrowingSwitch' feature. 2024-05-14 07:31:59 -07:00
swift-ci
65204e9227 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-10 13:34:02 -07:00
Tim Kientzle
03ea6a1225 Merge pull request #73491 from tbkka/tbkka-mpe-sparebits
Calculate spare bits for multi-payload enums from first principles
2024-05-10 13:15:07 -07:00
swift-ci
ac90898851 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-08 16:34:07 -07:00
Kavon Farvardin
0420310623 NCGenerics: it's no longer "experimental"
resolves rdar://127701059
2024-05-08 10:49:12 -07:00
Tim Kientzle
ea87a273d7 Redesign the spare bit mask calculation
This adds a `getSpareBits` method to all the TypeInfo classes
that returns a suitable bitmask indicating the spare bits available
in values of this type.  This gives us a way to recursively explore
the type tree and build up a full spare bit mask for an arbitrary type.

Happily, it appears we actually do have enough information to do this
calculation entirely from first principles, without requiring additional
reflection information.  So once this is stable, we should remove my
earlier incomplete effort to publish spare bit mask info in the reflection
data, as that adds unnecessary metadata to every binary.

This doubtless still has plenty of holes, but seems sufficient
to handle a few basic enum types, including the stdlib DecodingError
which was used as an example to work out some key issues.
2024-05-07 14:17:00 -07:00
swift-ci
c30af15f40 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-06 23:14:44 -07:00
Erik Eckstein
eac23edc65 tests: deprecate the swift_in_compiler lit feature
Now that SwiftCompilerSources are always enabled, `swift_in_compiler` is not needed anymore.
Set this feature unconditionally for tests which still include `REQUIRES: swift_in_compiler`.
2024-05-06 17:22:27 +02:00
Arnold Schwaighofer
195fe84e18 [rebranch] Fix validation-test/IRGen/pack_stack_metadata_alloc_loop.sil 2024-05-03 13:06:35 -07:00
swift-ci
ed8ed34a6f Merge remote-tracking branch 'origin/main' into rebranch 2024-05-01 21:14:11 -07:00
Konrad `ktoso` Malawski
dc5e354d69 [Concurrency] Reimplement @TaskLocal as a macro (#73078) 2024-05-01 20:57:20 -07:00
Arnold Schwaighofer
fdb050d2cf IRGen: Fix some test cases for llvm rebranch 2024-05-01 09:30:15 -07:00
saehejkang
33c666a855 [SILGen]: Add test for parenthesized try expression 2024-04-29 17:57:02 -07:00
nate-chandler
c1ecef79dc Merge pull request #73191 from nate-chandler/rdar125265980
[IRGen] Deadends don't need dealloc_pack_metadata.
2024-04-24 16:17:08 -07:00