Commit Graph

7628 Commits

Author SHA1 Message Date
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
Nate Chandler
da38fb51fb [IRGen] Deadends don't need dealloc_pack_metadata.
There is a debug-build-only verification that is done for
alloc_pack_metadata instructions that checks that there exist paired
dealloc_pack_metadata instructions which will be keyed off of to clean
up the on-stack variadic metadata packs corresponding to (the
instruction after) the alloc_pack_metadata.

StackNesting omits the deallocation instruction (as does
PackMetadataMarkerInserter) if it would be created in a dead end block.
If all blocks in the dominance frontier of the alloc_pack_metadata
instruction are dead-end blocks, then the verification will incorrectly
fail.  It should not fail because it is not necessary to clean up the
on-stack pack metadata (or any other stack allocations) in such a case.

If all such blocks are dead-end blocks, however, the
alloc_pack_metadata's block itself is a dead-end block as well.  So
during the verification, check whether the alloc_pack_metadata occurs in
a dead-end block and do not fail verification if it does.

rdar://125265980
2024-04-24 07:24:20 -07:00
Nate Chandler
5325a4d5f8 [MoveOnlyAddressChecker] Fix empty struct repr.
An empty struct without a deinit gets a single bit which is used to
track the struct's liveness.  Previously, an empty struct with a deinit
also only got a single bit.  Consequently, when discarding the struct
(i.e. dropping the deinit), there was no bit left to represent the
struct.  This resulted in a failure to track liveness for the value.

rdar://126863003
2024-04-22 08:42:14 -07:00
Nate Chandler
de8f1c0b69 [NoncopyablePartialConsumption] Promote to feature 2024-04-19 12:37:34 -07:00
Artem Chikin
01d891ad99 Merge pull request #72834 from artemcm/UpstreamVisionOS
Introduce visionOS Platform
2024-04-15 09:33:49 -07:00
Alex Hoppen
9fca2ff0ff Merge pull request #72568 from ahoppen/ahoppen/type-relation-of-call-pattern
[CodeCompletion] Don’t report a call pattern as convertible if its result type doesn’t match
2024-04-12 13:16:51 -07:00
nate-chandler
b1e5a5dfbb Merge pull request #72978 from nate-chandler/rdar126275392
[NoncopyablePartialConsumption] Promote to upcoming feature.
2024-04-11 14:13:14 -07:00
Nate Chandler
943cc3cc7c [NoncopyablePartialConsumption] Enable.
SE-429 was accepted.

rdar://126275392
2024-04-11 08:19:29 -07:00
Yuta Saito
65723193a9 [embedded] Use @_extern(c) instead of @_silgen_name for putchar in tests
Using inconsistent attributes between stdlib and tests causes
compilation errors. There are still several misuses of @_silgen_name in
tests, but leaving them as is for now to incrementally fix them.
2024-04-11 10:37:25 +00:00
Alex Hoppen
278ecef284 [CodeCompletion] Don’t report a call pattern as convertible if its result type doesn’t match
To compute the expected type of a call pattern (which is the return type of the function if that call pattern is being used), we called `getTypeForCompletion` for the entire call, in the same way that we do for the code completion token. However, this pattern does not generally work. For the code completion token it worked because the code completion expression doesn’t have an inherent type and it inherits the type solely from its context. Calls, however, have an inherent return type and that type gets assigned as the `typeForCompletion`.

Implement targeted checks for the two most common cases where an expected type exists: If the call that we suggest call patterns for is itself an argument to another function or if it is used in a place that has a contextual type in the constraint system (eg. a variable binding or a `return` statement). This means that we no longer return `Convertible` for call patterns in some more complex scenarios. But given that this information was computed based on incorrect results and that in those cases all call patterns had a `Convertible` type relation, I think that’s acceptable. Fixing this would require recording more information in the constraints system, which is out-of-scope for now.
2024-04-10 16:06:47 -07:00
Artem Chikin
1f14158a1d Introduce VisionOS Platform
This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
2024-04-10 09:38:02 -07:00
Meghana Gupta
5ced6cc00d Disable test Runtime/issue-51181.swift 2024-04-09 12:57:51 -07:00
Meghana Gupta
9112760248 Disable failing test on arm64 2024-04-09 11:53:57 -07:00
Meghana Gupta
85f960f366 Disable SequenceType.swift.gyb failing on freestanding 2024-04-08 10:16:16 -07:00
Slava Pestov
454e5cff67 Merge pull request #72825 from slavapestov/two-minor-fixes-and-tests
RequirementMachine: Fix two minor crash on invalid bugs
2024-04-03 22:42:24 -04:00
Slava Pestov
ae73cd4637 RequirementMachine: Fix an incorrect assertion
We don't expect to see type parameters that are not generic parameters
here, but dependent member types that wrap an ErrorType are fine, they
show up when a conformance had an invalid type witness.

Fixes the remaining example from https://github.com/apple/swift/issues/59384.
2024-04-03 19:37:20 -04:00
Slava Pestov
c1dc44643c Add regression test for rdar://111991454 2024-04-03 15:11:59 -04:00