Commit Graph

195754 Commits

Author SHA1 Message Date
Erik Eckstein
aa4e77a46c SILCombine: don't sink forwarding instructions with address operands
We don't do memory lifetime analysis for this peephole optimization.
Therefore we can't risk sinking instructions with address operands out of the addressed memory's lifetime.

For example:
```
  %3 = mark_dependence %2 on %1 : $*T  // must not be moved after the destroy_addr
  destroy_addr %1
```

Fixes a verifier crash
rdar://166240751
2025-12-12 16:11:13 +01:00
Saleem Abdulrasool
f82cf1ebfb Merge pull request #85993 from compnerd/scanning
swift-scan-test: adjust frontend detection for Windows
2025-12-12 02:25:52 -08:00
Egor Zhdan
ab275373fe Merge pull request #85979 from egorzhdan/egorzhdan/android-ptrauth
[cxx-interop] Handle missing `<ptrauth.h>`
2025-12-12 10:04:02 +00:00
Michael Gottesman
22d182552c Merge pull request #85999 from gottesmm/pr-c29e9002447c10b77a408ede1f7b7e42c5034dbf
[rbi] When looking for closure uses, handle unresolved_non_copyable_value and store_borrow temporaries.
2025-12-12 00:09:08 -08:00
Michael Gottesman
79eee82b87 Merge pull request #85997 from gottesmm/pr-10810fd33c3e8d8fd1e4072f78d63d3200d35aa7
[rbi] Remove highlights from errors.
2025-12-11 23:57:55 -08:00
Chris Williams
fe0191c62c [CSSimplify] Parameter pack wrapping logic incorrectly considers tuple LValueTypes to not be tuples (#85962)
In #65125 (and beyond) `matchTypes`, has logic to attempt to wrap an
incoming parameter in a tuple under certain conditions that might help
with type expansion.

In the case the incoming type was backed by a `var`, it would be wrapped
by an `LValueType` then be subsequently mis-diagnosed as not-a-tuple.

More details in #85924 , this this is also the cause of (and fix for)
#85837 as well...
2025-12-11 22:29:42 -08:00
Slava Pestov
ca12185204 Merge pull request #85967 from slavapestov/dont-copy-that-floppy
Sema: Avoid copying BindingSets
2025-12-12 00:18:47 -05:00
Michael Gottesman
e186e5e5d0 Merge pull request #85972 from gottesmm/pr-9663abc1697da1382a8514e6877a6c3ce3f439b9
[concurrency] Hide Concurrency StackNesting builtins behind a feature flag
2025-12-11 21:16:37 -08:00
Michael Gottesman
d64fda488e [rbi] When looking for closure uses, handle unresolved_non_copyable_value and store_borrow temporaries.
This ensures that in cases like the following:

+func testNoncopyableNonsendableStructWithNonescapingMainActorAsync() {
+  let x = NoncopyableStructNonsendable()    <=========
+  let _ = {
+    nonescapingAsyncClosure { @MainActor in
+      useValueNoncopyable(x) // expected-warning {{sending 'x' risks causing data races}}
+      // expected-note @-1 {{task-isolated 'x' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses}}
+    }
+  }
+}

We emit the diagnostic on the use instead of the <=====.

rdar://166347485
2025-12-11 18:45:06 -08:00
Michael Gottesman
8bea3518f5 [rbi] Remove highlights from errors.
I have noticed over time when working on the command line, we often times
highlight too large of an expression due to the locations provided to us by
earlier parts of the compiler. This isn't technically necessary and the
following doesn't look nice... so remove it.

```
test5.swift:171:16: error: sending 'x' risks causing data races [#SendingRisksDataRace]
169 |   let _ = {
170 |     nonescapingAsyncUse { @MainActor in
171 | _ _ _ _ _u_s_e_V_a_l_u_e_(_x_)
    |                |- error: sending 'x' risks causing data races [#SendingRisksDataRace]
    |                `- note: task-isolated 'x' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
172 |     }
173 |   }
```
2025-12-11 17:29:20 -08:00
Mishal Shah
ef9e3efaaf Merge pull request #85995 from swiftlang/revert-85542-revert-85534-revert-71422-docc
Revert "Revert "Revert "build: setup a CMake based build for DocC"""
2025-12-11 16:27:53 -08:00
Mishal Shah
6f32ad0dae Revert "Revert "Revert "build: setup a CMake based build for DocC""" 2025-12-11 16:25:44 -08:00
Saleem Abdulrasool
9918933045 Merge pull request #85896 from Steelskin/fabrice/update-bootstrap-arm64-toolchain
utils: Update the bootstrap Windows toolchain
2025-12-11 16:02:30 -08:00
Karoy Lorentey
a233485029 Merge pull request #82055 from vanvoorden/string-identical
[SE-0494][StdLib] Add `isTriviallyIdentical(to:)` Methods to String and Substring
2025-12-11 15:55:11 -08:00
Saleem Abdulrasool
54f5837c7b swift-scan-test: adjust frontend detection for Windows
Ensure that we account for file system arc separators and extensions by
using the LLVM functions rather than trying to simply do string
matching. This allows us to properly handle inputs on Windows.
2025-12-11 15:29:56 -08:00
Andrew Trick
d609889e87 Merge pull request #85934 from atrick/fix-closure-liveness
Fix InteriorUseWalker: consider partial_apply [on_stack] an escape
2025-12-11 15:05:21 -08:00
Ben Cohen
9dd9e96e1d Allow Hashable: ~Copyable (#85748)
Builds on #85746 which covers Equatable.
2025-12-11 14:47:36 -08:00
Ben Barham
b8e3e4b7b2 Merge pull request #85966 from bnbarham/disable-userdoc-freebsd
[Test] Disable userdoc validation on freebsd
2025-12-12 08:00:29 +10:00
Ben Barham
2dee8c4dac Merge pull request #85974 from bnbarham/so-long-and-thanks-for-all-the-fish
Remove Ben Barham from code owners
2025-12-12 07:58:16 +10:00
Dario Rexin
1f8e88d659 Merge pull request #85908 from drexin/wip-163631865
[IRGen] Use proper linkage for async function pointers to partial app…
2025-12-11 09:52:51 -08:00
Joe Groff
560eb9deaa Merge pull request #85954 from jckarter/sil-require-require-instruction
SIL verifier: The `atInstruction`/`atArgument` parameter to `require` should not be optional.
2025-12-11 09:43:43 -08:00
Joe Groff
f9fcd88298 Merge pull request #85959 from jckarter/borrow-accessor-address-only-non-escapable
SIL: Handle address ReturnInsts from borrow accessors as yielding uses.
2025-12-11 09:43:27 -08:00
Evan Wilde
3b99b43d91 Merge pull request #85931 from etcwilde/ewilde/stringprocessing-flags
CMake: StringProcessing: More apple flags
2025-12-11 09:22:21 -08:00
Arnold Schwaighofer
c1c05e1298 Merge pull request #85948 from aschwaighofer/embedded_enable_existential_support
[embedded] Enable support for existentials/boxed protocol types per default
2025-12-11 07:16:26 -08:00
Hamish Knight
088bda7424 Merge pull request #85952 from hamishknight/skip-body-macro
[AST] Avoid walking macro expanded bodies in non-expanded mode
2025-12-11 14:08:45 +00:00
Egor Zhdan
063b906966 [cxx-interop] Handle missing <ptrauth.h>
Android NDK, as of version 28, does not include the `ptrauth.h` header. This causes CI failures when building the Swift SDK for Android on Windows.

rdar://166242941
2025-12-11 11:39:20 +00:00
Susana Monteiro
91d1d2e06f Merge pull request #85793 from susmonteiro/susmonteiro/diagnose-swift-attrs
[cxx-interop] Diagnose invalid swift attributes
2025-12-11 11:06:41 +00:00
Max Desiatov
125a63d349 docs/WebAssembly.md: add Wasm stdlib testing steps (#85947)
Added instructions for building and running Wasm stdlib tests, including filtering options and environment variable usage.
2025-12-11 09:06:42 +00:00
Slava Pestov
956dc0c1a2 Merge pull request #85955 from slavapestov/fix-issue-85860
SILGen: Fix keypath descriptor emission for class nested inside generic context
swift-DEVELOPMENT-SNAPSHOT-2025-12-11-a
2025-12-11 00:36:18 -05:00
Saleem Abdulrasool
6253a0d60b Merge pull request #85900 from compnerd/library-binning
test: adjust the path compuation for plugins
2025-12-10 21:26:09 -08:00
Ben Barham
432935e37d Remove Ben Barham from code owners 2025-12-11 14:28:24 +10:00
Hiroshi Yamauchi
5634d99c4f Add several headers to WinSDK (#85915)
This was needed for explicit module builds to work for internal apps.
2025-12-10 19:31:27 -08:00
Michael Gottesman
7b9281fcb8 [concurrency] Hide Concurrency StackNesting builtins behind a feature flag.
rdar://166244033
2025-12-10 16:02:18 -08:00
Slava Pestov
56baeac901 Sema: More descriptive comment for determineLiteralCoverage() 2025-12-10 18:48:47 -05:00
Slava Pestov
205d8e6640 Sema: Remove unnecessary operator new overload 2025-12-10 18:48:47 -05:00
Slava Pestov
ba7df4013e Sema: Avoid copying BindingSets
They're stored inside the ConstraintGraphNode now, so returning a
`const BindingSet *` from within determineBestBindings() should
be safe.
2025-12-10 18:48:00 -05:00
Ben Barham
92070a655d [Test] Disable userdoc validation on freebsd
Currently failing to find Foundation when running
`generate-doc-index.swift`. This really only needs to run on a single
platform anyway, so let's just disable it from freebsd for now.
2025-12-11 09:41:44 +10:00
Guillaume Lessard
e293876e4f Merge pull request #85597 from glessard/substring-test-tweaks 2025-12-10 14:09:13 -08:00
Andrew Trick
10e1be4387 Merge pull request #85870 from atrick/comment-copyprop
Add a FIXME to CopyPropagation to highlight an incomplete fix.
2025-12-10 13:51:30 -08:00
Joe Groff
79225fa841 Add missing feature flags to borrow_accessor_address_only_non_escapable.swift 2025-12-10 13:40:34 -08:00
Egor Zhdan
f995144c1d Merge pull request #85906 from egorzhdan/egorzhdan/reland-cxx-string-cs
Reapply "[ConstraintSystem] C++ Interop: Binding a string literal to `std.string` shouldn't increase the score"
2025-12-10 21:04:15 +00:00
Joe Groff
4479b49fd8 SIL: Handle address ReturnInsts from borrow accessors as yielding uses.
This avoids a spurious lifetime error when an address-only borrow accessor returns a
non-`Escapable` value from a non-`Escapable` aggregate.
2025-12-10 11:44:41 -08:00
Saleem Abdulrasool
528cca0c2f test: adjust the path compuation for plugins
DLLs on Windows are built/installed into the binary directory while only
import libraries are placed into the library directory to differentitate
between the distributable and developer content. Introduce a helper to
compute the appropriate plugin path.
2025-12-10 11:26:29 -08:00
Steven Wu
da8b721654 Merge pull request #85926 from cachemeifyoucan/eng/PR-ebm-scirpt
[TEST-ONLY] Add utility to perform explicit module build
2025-12-10 10:52:03 -08:00
Tim Kientzle
efdd00892c Merge pull request #85797 from tbkka/tbkka-float-parsing
Reimplement Floating-Point Parsing in pure Swift
2025-12-10 18:42:41 +00:00
Slava Pestov
1013d25746 SILGen: Fix keypath descriptor emission for class nested inside generic context
hasGenericParamList() is the wrong thing to check -- we actually need to
know if any parent context is generic, as well.

- Fixes https://github.com/swiftlang/swift/issues/85860.
2025-12-10 13:28:54 -05:00
Joe Groff
da4e72cf2d SIL verifier: The atInstruction/atArgument parameter to require should not be optional.
The underlying C++ code expects a non-null `Instruction*` or `SILArgument*` pointer, and
most of the contextual information in a verifier error is derived from these arguments,
so it doesn't really make sense for the Swift level interface to present these arguments
as optional.
2025-12-10 10:27:56 -08:00
Meghana Gupta
96cfec4f84 Merge pull request #85935 from meg-gupta/lifetimeflags
Fix swiftinterface printing of accessors and inferred lifetime dependencies when Lifetimes feature is enabled
2025-12-10 10:01:01 -08:00
Hamish Knight
a9ad4e2cae [AST] Avoid walking macro expanded bodies in non-expanded mode
Make sure we don't walk into the expansion of a body macro if the AST
walker is configured not to walk macro expansions.
2025-12-10 17:41:00 +00:00
Hamish Knight
f0d4572a92 [SourceKit] Always check buffer in SemanticAnnotator
Make sure we don't ever try to record semantic tokens for a different
buffer. This works around an ASTWalker issue where it will walk macro
expanded bodies even in non-macro-expansion mode.

rdar://165420658
2025-12-10 17:41:00 +00:00