Commit Graph

184973 Commits

Author SHA1 Message Date
Slava Pestov
401f527bbb Sema: Don't construct TupleType with InOutType inside 2025-05-30 16:27:01 -04:00
Slava Pestov
6d0c73935b Parse: An empty escaped identifier is entirely whitespace 2025-05-30 16:27:00 -04:00
Hamish Knight
6d3455f52b Merge pull request #81849 from hamishknight/message-in-an-error
[Basic] Always dump message to stderr in `_abortWithMessage`
2025-05-30 20:53:37 +01:00
Slava Pestov
ff941bc4f3 Sema: Fix crash when any is followed by something that doesn't parse as a type 2025-05-30 14:44:58 -04:00
Slava Pestov
0a0019ba76 Sema: Fix null pointer dereference with invalid ParamDecl 2025-05-30 14:44:24 -04:00
Slava Pestov
0e1561f05a Sema: Change a couple of Identifier usages to DeclName instead 2025-05-30 14:43:48 -04:00
nate-chandler
dd75d2ed82 Merge pull request #81854 from nate-chandler/rdar152195094
[DestroyAddrHoisting] Don't destructure NE aggs.
2025-05-30 11:32:12 -07:00
Pavel Yaskevich
f31cdb3fec Merge pull request #81852 from xedin/rdar-151943924
[TypeCheckEffects] Fix `AbstractFunction::getType` to look through al…
2025-05-30 11:03:40 -07:00
Holly Borla
f0e77c7814 [Concurrency] Don't diagnose metatype captures in closures that are
isolated to the same actor as the enclosing context.
2025-05-30 10:58:38 -07:00
Doug Gregor
73031240fa Effects: Treat #selector as covering throws/async effects in its operand
Fixes rdar://151968656
2025-05-30 10:50:32 -07:00
Anthony Latsis
d0b00504d8 Merge pull request #81426 from AnthonyLatsis/quercus-ilex
[test] Fix misspelled FileCheck directives
2025-05-30 17:54:28 +01:00
Pavel Yaskevich
b12d844fcc [CSSimplify] Remove ad-hoc optional mismatch handling for arguments
Since we have `repairViaOptionalUnwrap`, let's use that to fix
argument/parameter mismatches instead of doing ad-hoc matching.
2025-05-30 09:52:57 -07:00
Pavel Yaskevich
2d1f9d3f18 [CSSimplify] Move inout failures handing to LValueConversion block
This is cleanup that allows us to avoid a fallthrough to `ApplyArgToParam`
handling for `inout` failures.
2025-05-30 09:52:57 -07:00
Pavel Yaskevich
ded6158cc3 [CSSimplify] Detect when generic argument mismatch applies to argument and produce a tailed fix
The problem detection logic currently expects `generic argument #<N>`
location to always be associated with two generic types, but that
is not always the case, this locator element is sometimes used for
i.e. optional object types and pointer `Pointee` type when types
appear in argument positions. This needs to be handled specifically.

Resolves: rdar://82971941
2025-05-30 09:52:57 -07:00
Pavel Yaskevich
10186d664b [Diagnostics] Assign missing member eagerly when there is no context
Without contextual information it won't be possible to bind a missing
member to a concrete type later, so let's bind them eagerly and propagate
placeholders outward.

Resolves: rdar://152021264
Resolves: https://github.com/swiftlang/swift/issues/81770
2025-05-30 09:52:52 -07:00
Ben Barham
b0d5e0e8f1 Merge pull request #81697 from bnbarham/use-toolchain-version
Add the distribution tag to `-print-target-info`
2025-05-30 09:51:03 -07:00
Egor Zhdan
a7c174431f [cxx-interop] Do not crash when emitting layout of std::string
If a `[[no_unique_address]]` field has zero size according to Clang, and field has a type that isn't representable in Swift, Swift would previously try to add an opaque field of size 1 for it.

This is wrong and was causing crashes for `std::string` while emitting a padding field:
```
_LIBCPP_NO_UNIQUE_ADDRESS ::std::__compressed_pair_padding<T1> _LIBCPP_CONCAT3(__padding1_, __LINE__, _);
```

rdar://151941799
2025-05-30 17:32:15 +01:00
Slava Pestov
14f6dbfc3a Add tests suggested by @AnthonyLatsis 2025-05-30 11:32:03 -04:00
Slava Pestov
6cc12123b0 Add test case for formerly missing diagnostic
We didn't diagnose conflicting generic signatures involving the
SE-0361 syntax before https://github.com/swiftlang/swift/pull/81304.

Fixes rdar://152170450.
2025-05-30 11:32:03 -04:00
Hamish Knight
c81f0a868e [test] Add a couple more known test-checker crashers 2025-05-30 16:27:32 +01:00
Hamish Knight
b9b2cb25c2 [Basic] Always dump message to stderr in _abortWithMessage
This allows it to be seen while e.g attached with a debugger.
2025-05-30 16:08:37 +01:00
Justice Adams
e493bb5033 [cmake] tweak Synchronization compile flags (#81847)
Adding compiler flags which were missing when comparing the old build to
the new build
2025-05-30 09:41:33 -05:00
Hamish Knight
5d1f219acb Change InlineArray sugar separator x -> of 2025-05-30 13:50:22 +01:00
Susana Monteiro
8ce5f2bf2d Merge pull request #81838 from swiftlang/susmonteiro/metadata-private-fields
[cxx-interop] Ensure field offset vector matches the structs/fields metadata
2025-05-30 12:03:32 +01:00
Kavon Farvardin
ec554da19a Merge pull request #81861 from kavon/kavon/avoid-double-copy
SILGen: avoid double copies with 'copy' expr
2025-05-30 03:57:46 -07:00
eeckstein
0654dc79d0 Merge pull request #81806 from eeckstein/fix-argument-convention
Swift SIL: Fix argument conventions for functions which have both, a direct and indirect result
2025-05-30 12:30:17 +02:00
Guillaume Lessard
653d0e9601 Merge pull request #81816 from glessard/rdar138440979-mutablespan-abi-fix
[stdlib] fix an extraneous symbol exported by MutableSpan
2025-05-30 02:23:44 -07:00
Kuba (Brecka) Mracek
5ea9b7d357 Merge pull request #81857 from kubamracek/embedded-builtin-float
[embedded] Resolve a circular dependency problem in SwiftShims when using pico-libc
2025-05-30 02:12:01 -07:00
Pavel Yaskevich
816ea9fda6 [CodeCompletion] Implement completions in using declaration's specifier position 2025-05-30 00:39:06 -07:00
Pavel Yaskevich
aabfebec03 [AST] Add new declaration - using
Initially this declaration is going to be used to determine
per-file default actor isolation i.e. `using @MainActor` and
`using nonisolated` but it could be extended to support other
file-global settings in the future.
2025-05-30 00:39:06 -07:00
Henrik G. Olsson
1773ea03ea fix test 2025-05-29 22:02:14 -07:00
Andrew Trick
38d89f10f2 Merge pull request #81837 from atrick/builtin-addressof
LifetimeDependenceInsertion: allow dependency on Builtin.addressof()
2025-05-29 20:48:25 -07:00
Kavon Farvardin
32f1ebcfab SILGen: avoid double copies with 'copy' expr 2025-05-29 19:47:26 -07:00
Holly Borla
c283ce12d5 [Concurrency] Remove some dead code from mayExecuteConcurrentlyWith.
This code is no longer used given that region isolation is always enabled
along with strict concurrency checking.
2025-05-29 19:17:52 -07:00
Artem Chikin
74e207b7bb Merge pull request #81713 from artemcm/ClangRemapsForDepScanQueries
[Dependency Scanning] Add ClangImporter's mandatory path remaps to dependency scanning query filesystem
2025-05-29 18:25:30 -07:00
Kuba Mracek
544251bdc2 [embedded] Resolve a circular dependency problem in SwiftShims when using pico-libc 2025-05-29 17:37:32 -07:00
Pavel Yaskevich
f586af422c Merge pull request #81817 from xedin/fix-startSynchronously-to-use-old-symbol
[Concurrent] Restore old symbol for obsoleted `Task.startSynchronously`
2025-05-29 17:20:11 -07:00
Nate Chandler
a9c31b9462 [DestroyAddrHoisting] Don't destructure NC aggs.
When hoisting destroys of aggregates, an attempt is made to fold the
destroys of individual fields into the foregoing instructions.  If the
aggregate is noncopyable, this transformation is illegal.
2025-05-29 16:50:56 -07:00
Nate Chandler
f5a16e4c13 [DestroyAddrHoisting] Don't destructure NE aggs.
When hoisting destroys of aggregates, an attempt is made to fold the
destroys of individual fields into the foregoing instructions.  If the
aggregate is nonescapable, this transformation is illegal.

rdar://152195094
2025-05-29 16:49:46 -07:00
Hamish Knight
dd1e0d796f Merge pull request #81835 from hamishknight/fuzzy
[test] Add some known type-checker + parser crashers
2025-05-30 00:27:10 +01:00
Ryan Mansfield
e7e4c3577a Merge pull request #81841 from rjmansfield/disable_lto_autolink_arm64_32
Re-add UNSUPPORTED for watchos arm64_32 in lto_autolink.swift.
2025-05-29 19:17:34 -04:00
Nate Chandler
f7ca26ce93 [NFC] SIL: This utility takes a func not a module.
In preparation to use the function in the implementation.
2025-05-29 15:36:15 -07:00
nate-chandler
b8b13d8086 Merge pull request #81808 from nate-chandler/bug/20250528/1
[IRGen] This ArtificialLoc requires a debug scope.
2025-05-29 14:40:30 -07:00
Ryan Mansfield
ce0ad87c73 Merge pull request #81813 from rjmansfield/fix_autodiff_device_tests
Add %target-codesign to executables and dylibs in newly added AutoDiff tests
2025-05-29 17:24:14 -04:00
Alexis Laferrière
29d729b0a7 Merge pull request #81481 from xymus/cdecl-includes
PrintAsClang: Print `#include` to import headers used from `@cdecl` functions
2025-05-29 14:17:12 -07:00
Pavel Yaskevich
86390ab91f [TypeCheckEffects] Fix AbstractFunction::getType to look through all levels of optional
A member and a parameter could be wrapped in an arbitrary number
of `Optional`, we need to look through all of them to get to the
underlying function type.

Resolves: rdar://151943924
2025-05-29 13:49:15 -07:00
Alexis Laferrière
7d6447be20 Merge pull request #81519 from xymus/cdecl-diags
Sema: Update more diagnostics for `@cdecl` and representability in the C language
2025-05-29 13:37:29 -07:00
Artem Chikin
a9e0a58b46 [Dependency Scanning] Add ClangImporter's mandatory path remaps to dependency scanning query filesystem
On creation, 'ClangImporter' adds overlay modulemap files for non-modular platform libraries (e.g. glibc, libstdc++), which allows Swift code to import and use those libraries.

This change adds the same filesystem overlay to dependency scanning queries by applying them to the filesystem instantiated for each depndency scanning worker. Without these overlays EBM builds cannot discover and use non-modular system libraries on non-Darwin platforms.

Resolves rdar://151780437
2025-05-29 13:33:36 -07:00
Henrik G. Olsson
4a72c1ee5c [Swiftify] Enable warnings-as-errors in interop test cases (NFC)
This enables -strict-memory-safety -warnings-as-errors on the Swift side
to verify that the macro expansions don't cause any warnings and that
they use `unsafe` correctly. On the clang side it enables -Xcc -Werror.
To reduce noise in the test output and pass -Werror cleanly it also
enables -Xcc -Wno-nullability-completeness. This will make it easier to
detect mistakes when writing tests, because warnings stand out whereas
previously they've been drowned out in the noise.
2025-05-29 13:32:57 -07:00
Henrik G. Olsson
0f0a2ca4bb [Swiftify] Support __sized_by on byte-sized pointee types
Previously we would emit a macro that would error on expansion when
trying to add a safe wrapper to a function with __sized_by on a type
that mapped to UnsafePointer<T> instead of UnsafeRawPointer or
OpaquePointer. __sized_by is acceptable when used on byte-sized pointee
types, so this adds machinery in the macro expansion to support that.
Meanwhile on the ClangImporter side, we add a check so that __sized_by
on pointee types with a size is ignored if that size is larger than 1
byte.

When _SwiftifyImport applies .sizedBy to a pointer of type
UnsafePointer<T> it will still map it to a
RawSpan/UnsafeRawBufferPointer in the safe overload. The assumption is
that any API using __sized_by is dealing with raw bytes, so raw pointers
are a better Swift abstraction than UnsafePointer<CChar> etc. It also
lets the user avoid doing a scary pointer cast from some potentially
larger-than-byte-sized pointer to a byte-sized pointer. Casts to
RawPointers are generally safer and more ergonomic.

rdar://150966684
rdar://150966021
2025-05-29 13:32:53 -07:00