Commit Graph

184973 Commits

Author SHA1 Message Date
Guillaume Lessard
bc59aedc3f [test] UTF8Span from inline-stored String instances 2025-06-07 07:48:33 -07:00
Hamish Knight
bc655eb144 Merge pull request #82087 from hamishknight/disable-test
[test] Disable `7cee1719e3503ef6.swift` for now
2025-06-07 15:20:45 +01:00
Hamish Knight
eca93d6f90 [test] Disable 7cee1719e3503ef6.swift for now
This is crashing non-deterministically.
2025-06-07 10:44:56 +01:00
Guillaume Lessard
3a96d085c7 Merge pull request #82064 from glessard/generalize-expectNotNil
[stdlibUnittest] generalize `expectNotNil(_:)`
2025-06-06 22:04:59 -07:00
Slava Pestov
28af54a778 Merge pull request #80913 from stzn/fix-crash-self-keypath-root
[SILGen]Check if baseType is DynamicSelfType
2025-06-06 22:35:47 -04:00
Allan Shortlidge
8ceba34f62 AST: Add a warning group for @_implementationOnly deprecation diagnostics.
This allows developers to control the level of these diagnostics.

Resolves rdar://152735425.
2025-06-06 19:12:32 -07:00
Allan Shortlidge
85444fd1e5 AST: Diagnose unrecognized platforms as errors with CustomAvailability enabled.
When the CustomAvailability experimental feature is enabled, make it an error
to specify an unrecognized availability domain name. Also, add these
diagnostics to a diagnostic group so that developers can control their behavior
when they are warnings.

Resolves rdar://152741624.
2025-06-06 17:30:01 -07:00
Anthony Latsis
d10dfb3ae9 Merge pull request #82020 from AnthonyLatsis/camellia-sinensis
Sema: Never record argument label mismatches for unlabeled trailing closures
2025-06-07 01:29:54 +01:00
Pavel Yaskevich
74471e858b [ClangImporter] Use DefaultsToSendable with completion handler parameter
This lifts the check for the feature flag up into the `importParameterType`
from `importType` and means that completion handler type for `async` variant
is no longer gains `@Sendable` attribute.
2025-06-06 17:08:22 -07:00
Evan Wilde
93603987dd Move availability args to response file
The availability flags keep increasing the number of characters on the
command line overflowing the maximum character length on Windows and
making the commands harder to read. This patch moves the generated
arguments into a separate response file so that they can continue to
grow without running into argument length limitations.
2025-06-06 16:58:12 -07:00
Guillaume Lessard
d38b961cb7 Merge pull request #82013 from glessard/rdar152615917-addressable-string-types
[stdlib] adjust addressable attribute on String type family
2025-06-06 16:55:57 -07:00
eeckstein
49e01ba56f Merge pull request #82062 from eeckstein/fix-test
tests: run SILOptimizer/static_inline_arrays.swift only on macos, linux and windows
2025-06-07 01:35:47 +02:00
Adrian Prantl
540df142d7 [RemoteInspection] Add a hook to process addresses before converting
them to hex strings when creating anonymous context descriptors. This
aims to solve a problem when LLDB reads reflection metadata directly
from local binary files instead of downloading them from in-process
memory.

LLDB's MemoryReader implements this to convert the file address into
an in-process address, so mangled names created from instance metadata
can be matched with the field info data read from the local files.

rdar://152743797
2025-06-06 16:24:18 -07:00
Evan Wilde
8ea765728b Use a response file for stdlib sources
The experimental stdlib runtime build has several sources files,
resulting in an absolutely massive commandline. This seems to be
approaching, or passing, the maximum command line length on Windows.
Switch the Windows build to use a response file generated by CMake to
pass the source files to the compiler.
2025-06-06 15:54:45 -07:00
Gábor Horváth
a2a760ab27 Merge pull request #82019 from swiftlang/gaborh/ambiguous-overloads
[cxx-interop] Support _LIBCPP_PREFERRED_OVERLOAD
2025-06-06 23:44:23 +01:00
Ben Barham
3982ebbbb3 [Build] Pass the toolchain version through to Swift's compilation
Passes the value of the environment variable `TOOLCHAIN_VERSION` through
to Swift's `SWIFT_TOOLCHAIN_VERSION` for use in eg.
`-print-target-info` (and some day, `--version`).
2025-06-06 15:09:21 -07:00
Saleem Abdulrasool
083cb114b3 Merge pull request #82065 from compnerd/import-shims
ClangImporter: import SwiftShims properly for static linking
2025-06-06 15:05:04 -07:00
Saleem Abdulrasool
be13a2ed87 Runtimes: allow enabling prespecialization and library evolution
Adjust the StringProcessing module to follow the defaults of SwiftCore
with regards to generic metadata prespecialization and the library
evolution modes.
2025-06-06 14:41:32 -07:00
Pavel Yaskevich
6bbc101a98 [Diagnostics] Correctly diagnose situations when immutable value is passed to inout parameter
Currently the note is going to point to the "callee" but that is
incorrect when the failure is related to an argument of a call.

Detect this situation in `RValueTreatedAsLValueFailure::diagnoseAsNote`
and produce a correct note.

Resolves: rdar://150689994
2025-06-06 14:36:19 -07:00
Slava Pestov
7c78224877 Add regression test for rdar://152700122 2025-06-06 17:10:42 -04:00
Slava Pestov
9c01ee2c1b Move some availability tests into a new test/Availability directory 2025-06-06 17:10:42 -04:00
Pavel Yaskevich
aa92bcf9b0 Merge pull request #82004 from xedin/rdar-151911135
[Concurrency] Fix `SendableMetatype` conformance failures to behave l…
2025-06-06 14:07:55 -07:00
John McCall
237e617fab Merge pull request #82008 from rjmccall/dont-copy-print-options
Prevent PrintOptions from being implicitly copied
2025-06-06 17:06:02 -04:00
Arnold Schwaighofer
11942d70bd Merge pull request #81995 from aschwaighofer/fix_looprotate_densemap_subscript_bug
LoopRotate: Fix a by reference map bug under reallocation
2025-06-06 12:56:10 -07:00
Joe Groff
46213b2048 Merge pull request #82028 from Steelskin/fabrice/line-directive-stop-expanding-response-files
line-directive: Actually stop expanding response files
2025-06-06 12:52:00 -07:00
Saleem Abdulrasool
2a988f1dd0 Merge pull request #82023 from Steelskin/fabrice/line-directive-update-comment
line-directive: Update outdated comment
2025-06-06 12:51:00 -07:00
Artem Chikin
8c8a754145 Merge pull request #82030 from artemcm/FixSILOptCycleCmake
Resolve unit test link error due to a build cycle
2025-06-06 12:46:40 -07:00
Steven Wu
debdd224d5 Merge pull request #81990 from cachemeifyoucan/eng/PR-152441866
[CAS] Allow uncached job from CAS based dependency scanning
2025-06-06 12:08:21 -07:00
Hamish Knight
1979c78b06 Merge pull request #82059 from hamishknight/fuzzy
[test] Add a few more known type-checker crashers
2025-06-06 19:47:53 +01:00
nate-chandler
17798c781f Merge pull request #82043 from nate-chandler/rdar152580661
[TypeLowering] Record pack used in aggregate signature.
2025-06-06 11:37:24 -07:00
Allan Shortlidge
21fa0b4024 Merge pull request #82046 from tshortli/back-deployed-attr-remap
AST: Fix iOS -> visionOS version remap for `@backDeployed` attrs
2025-06-06 11:30:25 -07:00
Erik Eckstein
696e8142a5 tests: run SILOptimizer/static_inline_arrays.swift only on macos, linux and windows
rdar://152288605
2025-06-06 20:12:06 +02:00
Erik Eckstein
d6cbaf6ebd MandatoryPerformanceOptimizations: only set the [perf_constraint] flag for callees of performance constraint functions
It used to also set it for functions which are referenced from a global with a const/section attribute - even if not performance attribute was present in the whole module. This is unnecessary and can lead to worse code generation.

rdar://152665294
2025-06-06 20:08:16 +02:00
Ben Barham
5dadb5dfd9 Merge pull request #82002 from bnbarham/update-feature-docs
Add groupings for the various diagnostics
2025-06-06 10:23:14 -07:00
Gabor Horvath
27879c7bfa [cxx-interop] Support _LIBCPP_PREFERRED_OVERLOAD
Some functions like memchr are defined both in libc++ and libc.
Including both would result in ambiguous references at the call sites.
This is worked around by an attribute that tells the compiler to prefer
one overload over the others. This attribute was not interpreted by
Swift. As a result, importing both libc and libc++ and calling such
functions resulted in compilation errors due to ambiguous overloads.
This PR modifies the lookup logic to exclude the non-preferred Clang
functions from the overload set whenever a preferred overload is
available.

rdar://152192945
2025-06-06 18:05:35 +01:00
Mike Ash
95977351ea Merge pull request #81955 from mikeash/os-unfair-recursive-lock-declarations
[Runtime] Don't redeclare os_unfair_recursive_lock et al if the SDK has them.
2025-06-06 13:05:24 -04:00
Artem Chikin
10cd7baef0 [Legacy Driver] Obsolete and remove batch compilation mode from the legacy driver
It is a maintenance burden and having the legacy driver exist in a simplified state reduces the possibility of things going wrong and hitting old bugs.
2025-06-06 09:51:00 -07:00
Saleem Abdulrasool
43b2b596fe ClangImporter: import SwiftShims properly for static linking
When building against the static standard library, we should define
`SWIFT_STATIC_STDLIB` to indicate to the shims that the declarations
should be giving hidden visibility and default DLL storage. This is
required to ensure that these symbols are known to be `dso_local` when
compiling to avoid an unnecessary look up through the PLT/GOT or the
indirection through the synthesized `__imp_` symbol and the IAT. This
corrects a number of incorrect code generation cases on Windows with the
static standard library.
2025-06-06 09:35:51 -07:00
Gábor Horváth
296726aa12 Merge pull request #82016 from swiftlang/gaborh/swiftify-private
[cxx-interop] Avoid swiftifying private and protected methods
2025-06-06 17:19:46 +01:00
Gábor Horváth
e2ab10b1ab Merge pull request #81973 from swiftlang/gaborh/disable-non-aliased-instantiations
[cxx-interop] Only swiftify template instantiations behind type aliases
2025-06-06 17:18:10 +01:00
Guillaume Lessard
5895077382 [stdlibUnittest] generalize expectNotNil(_:)
Generalizes it for non-copyable and non-escapable values.
2025-06-06 09:14:27 -07:00
Pavel Yaskevich
aaf153d7a1 [Concurrency] Fix SendableMetatype conformance failures to behave like Sendable ones
No warnings with minimal checking, warnings with `strict-concurrency=complete` and
if declaration is `@preconcurrency` until next major swift version.

Resolves: rdar://151911135
Resolves: https://github.com/swiftlang/swift/issues/81739
2025-06-06 08:48:29 -07:00
Guillaume Lessard
998b329019 [test] adjust type used in lifetime semantics test 2025-06-06 08:21:49 -07:00
Guillaume Lessard
401eef5472 [test] adjust api-digester data 2025-06-06 08:21:49 -07:00
Guillaume Lessard
9e8019a0fe [stdlib] make annotation adjustments 2025-06-06 08:21:48 -07:00
Pavel Yaskevich
f5b30b06b8 Merge pull request #82034 from xedin/rdar-152665294
[Demangle] Implement missing `Node::Kind::OutlinedInitializeWithTakeN…
2025-06-06 08:21:25 -07:00
Pavel Yaskevich
86d036ddca Merge pull request #81960 from xedin/rdar-146027395
[Concurrency] Downgrade errors to warnings when `Sendable` requirement is inferred from a preconcurrency protocol
2025-06-06 08:20:45 -07:00
Doug Gregor
89628ab2ec Merge pull request #82040 from DougGregor/sendable-metatype-docs 2025-06-06 08:04:32 -07:00
eeckstein
a33ff9879a Merge pull request #81969 from eeckstein/temp-lvalue-elimination
Optimizer: improve TempLValueOpt
2025-06-06 15:30:29 +02:00
eeckstein
98aeec6563 Merge pull request #82014 from eeckstein/address-walkers
SIL: handle `drop_deinit` in WalkUtils
2025-06-06 15:28:09 +02:00