Commit Graph

195523 Commits

Author SHA1 Message Date
Ben Barham
b29a0a9b3d Fix up the userdocs index
A few docs weren't added to the index, re-run the generation and fix the
test to actually run in order to catch future issues.
2025-12-06 10:18:19 +10:00
Artem Chikin
3f0732f0d9 Merge pull request #85849 from artemcm/FixScanDepsPerfRegression
[Dependency Scanning] Do not re-query a given clang module identifier more than once
2025-12-05 14:33:49 -08:00
Slava Pestov
bf3170691e Merge pull request #85863 from slavapestov/fix-rdar165909327
Sema: Re-visit @specialize attribute where clause in interface resolution stage
2025-12-05 16:21:35 -05:00
eeckstein
e987c925f7 Merge pull request #85855 from eeckstein/fix-silcombine
DeadCodeElimination,SILCombine: don't insert destroys for removed values in dead-end blocks
2025-12-05 22:04:07 +01:00
Henrik G. Olsson
4419ce5bbd Merge pull request #85528 from hnrklssn/diag-verify-fixes
[DiagnosticVerifier] improve output for expansions in clang attributes
2025-12-05 12:51:29 -08:00
eeckstein
d0f8ccef28 Merge pull request #85857 from eeckstein/fix-vtable-specialization
Embedded: allow generic class constructors
2025-12-05 20:17:52 +01:00
Pavel Yaskevich
767c569f89 Merge pull request #85847 from xedin/issue-84509-test-case
[Tests] NFC: Add a test-case for https://github.com/swiftlang/swift/i…
2025-12-05 09:24:17 -08:00
Ben Cohen
0f99458900 Allow Comparable: ~Copyable (#85747)
Builds on #85746 which covers Equatable
2025-12-05 08:37:36 -08:00
Erik Eckstein
c0017a2701 DeadCodeElimination: don't insert destroys for removed values in dead-end blocks
When an owned value has no lifetime ending uses it means that it is in a dead-end region.
We must not remove and inserting compensating destroys for it because that would potentially destroy the value too early.
Initialization of an object might be cut off and removed after a dead-end loop or an `unreachable`.
In this case a class destructor would see uninitialized fields.

Fixes a mis-compile
https://github.com/swiftlang/swift/issues/85851
rdar://165876726
2025-12-05 17:08:51 +01:00
Erik Eckstein
953d692e53 SILCombine: don't remove dead Array adoptStorage call
If followed by a dead infinite loop, the array initialization might have beed removed.
Therefore when inserting a compensating destroy of the array buffer can lead to a crash.

https://github.com/swiftlang/swift/issues/85851
rdar://165876726
2025-12-05 17:08:51 +01:00
Slava Pestov
459a874f00 Sema: Re-visit @specialize attribute where clause in interface resolution stage
As with all other where clauses, we must resolve the requirements twice;
first in structural stage to build the generic signature, and second in
interface stage to check that any generic types that appear within
satisfy requirements. We weren't doing the latter for @specialize, which
would result in SIL crashes if such invalid SIL types appeared therein.

Fixes rdar://165909327.
2025-12-05 09:53:46 -05:00
Saleem Abdulrasool
a7f996651c Merge pull request #85532 from 0xpablo/patch-1
Platform: add `DirectX.Direct2D` module to WinSDK
2025-12-05 08:16:25 -06:00
Aidan Hall
21aa6b2ea2 Merge pull request #85836 from aidan-hall/revert-debuginfo
Revert "[DebugInfo] Salvage more in -O builds"
2025-12-05 14:14:17 +00:00
Arnold Schwaighofer
055f3e074d Merge pull request #85838 from aschwaighofer/embedded_exist_deferred_codegen
[embedded] When using existentials in embedded value witness tables can also have non unique definitions
2025-12-05 05:15:02 -08:00
Erik Eckstein
8b496f668f Embedded: allow generic class constructors
For example:

```
  public class C: MyClass {
    public init(p: some P) {
      // ...
    }
  }
```

Constructors are not called via the vtable (except "required" constructors).
Therefore we can allow generic constructors.

https://github.com/swiftlang/swift/issues/78150
rdar://138576752
2025-12-05 11:35:00 +01:00
Erik Eckstein
332b253a2e SIL: fix vtable cache updating in SILVTable::replaceEntries
We first have to remove _all_ old entries from the cache, then add the new entries.
Otherwise we'll wrongly remove an existing entry from the cache again if a previous entry was deleted from the vtable.
2025-12-05 11:34:55 +01:00
Erik Eckstein
7eedc18965 Swift AST: add ConstructorDecl.isInheritable
and make `AbstractFunctionDecl.isOverridden` final
2025-12-05 11:34:54 +01:00
Anthony Latsis
153dd02cd8 Merge pull request #85833 from swiftlang/jepa-main
[NFC] "SwiftVersion" → "LanguageMode" in `DiagnosticEngine::warnUntilSwiftVersion`, etc.
2025-12-05 09:34:30 +00:00
Dan Blackwell
161d00f803 [Sanitizers] Add support for -sanitize=memtag-stack (#85515)
This sanitizer adds MTE (memory tagging extension) checks to stack
variable accesses. Enablement simply requires setting an attribute on
function definitions, and the instrumentation is added by LLVM.

The corresponding swift-driver change is at:
https://github.com/swiftlang/swift-driver/pull/2016.

rdar://161721201
2025-12-05 08:51:42 +00:00
eeckstein
8c12e0094d Merge pull request #85843 from eeckstein/fix-verifier
Don't verify that there are no stores in read-only access scopes if there is a conflicting scope
2025-12-05 06:28:11 +01:00
Carl Peto
4a664da0e4 Temporarily disable CrashWithThreads cosmetic test on Linux (#85848)
This test is destabilising the pipeline on Linux and only tests cosmetic functionality. Disable it for now.

rdar://165728982
2025-12-04 19:23:52 -08:00
Michael Gottesman
26d83d4393 Merge pull request #85827 from gottesmm/pr-50a580749c0f00c1a29b7985f98b412538950dce
[mangling.rst] Add a more indepth discussion of what padding bytes are used for when encoding relative symbolic references into mangled names.
2025-12-04 17:27:02 -08:00
Pavel Yaskevich
f50770e4aa Merge pull request #85841 from ultramiraculous/patch-5
Fix BuilderTransform.cpp `buildFialBlock` typo
2025-12-04 17:26:18 -08:00
Michael Gottesman
7b5a479d57 Merge pull request #85795 from gottesmm/pr-f54feb20e8e8bcda1ba5d3e95cd49d9159c64ea2
[irgen] Add test for b6dfb30f1e.
2025-12-04 15:46:55 -08:00
Artem Chikin
7b00603077 [Dependency Scanning] Do not re-query a given clang module identifier more than once
During parallel clang module dependency resolution, an unintended side-effect of https://github.com/swiftlang/swift/pull/84929 is that we stopped uniquing the module identifiers we query to the Clang dependency scanner.

This change ensures we do not query the same identifier more than once.

Resolves rdar://165133617
2025-12-04 14:33:37 -08:00
Pavel Yaskevich
d6ffad06e1 [Tests] NFC: Add a test-case for https://github.com/swiftlang/swift/issues/84509
Looks like the issue has been fixed already, so adding a
test-case to make sure that it doesn't regress in the future.

Resolves: https://github.com/swiftlang/swift/issues/84509
Resolves: rdar://161307898
2025-12-04 13:39:07 -08:00
Ryan Mansfield
95cc52d363 Merge pull request #74431 from rjmansfield/build-toolchain-sccache
Mention --sccache in built-toolchain usage message.
2025-12-04 16:25:19 -05:00
Becca Royal-Gordon
9ce4d1d0be Merge pull request #85829 from beccadax/rdar149982943
[NFC] [IRGen] Move construction of CalleeInfo
2025-12-04 13:23:56 -08:00
Kavon Farvardin
38542054c2 Merge pull request #85745 from blevine1/address-only-enum-trivial-load-payload
[SILGen] Fix load ownership for trivial tuple elements in consuming switch
2025-12-04 12:24:55 -08:00
3405691582
4f3541958b Merge pull request #85714 from 3405691582/tar
OpenBSD needs this tar invocation as well.
2025-12-04 15:22:28 -05:00
Erik Eckstein
9ceb8b83c1 SIL-Verifier: Don't verify that there are no stores in read-only access scopes if there is a conflicting scope
This is a programming error, but the compiler should not crash. The violation is caught at runtime.
2025-12-04 21:12:32 +01:00
Saleem Abdulrasool
cfc122140b Merge pull request #85831 from compnerd/spacey-cas
tests: adjust invocation of python tools
2025-12-04 13:42:49 -06:00
Chris Williams
8050318626 Fix BuilderTransform.cpp buildFialBlock typo
I was poking around this file looking into #85837 and noticed this typo...
2025-12-04 14:01:07 -05:00
Saleem Abdulrasool
290bcb5423 Merge pull request #85629 from compnerd/python
utils: adjust the python path
2025-12-04 12:49:45 -06:00
Pavel Yaskevich
a724f4c7d3 Merge pull request #85828 from xedin/tilde-sendable-with-inheritance-and-isolation
[Concurrency] TildeSendable: Fix handling of isolated types and inherited conformances
2025-12-04 09:26:40 -08:00
Arnold Schwaighofer
729cc1e08f [embedded] When using existentials in embedded value witness tables can also have non unique definitions 2025-12-04 09:11:50 -08:00
Evan Wilde
4ad6bea8c2 Merge pull request #85825 from etcwilde/ewilde/concurrency-tracing
Concurrency Runtime: Enable tracing with `SWIFT_STDLIB_TRACING`
2025-12-04 08:17:22 -08:00
Ryan Mansfield
56a90bf23f Mention --sccache in build-toolchain usage message. 2025-12-04 11:06:23 -05:00
Aidan Hall
b1eb70bf45 Revert "[DebugInfo] Salvage more in -O builds"
This reverts commit a95d2979f9.

rdar://165667449
2025-12-04 15:39:39 +00:00
Anthony Latsis
88220a33c3 [NFC] "SwiftVersion" → "LanguageMode" in DiagnosticEngine::warnUntilSwiftVersion, etc. 2025-12-04 15:11:07 +00:00
Saleem Abdulrasool
d7991c8f52 tests: adjust invocatio of python tools
These test commands were relying on an arcane Unix specific behaviour
that is non-portable to execute the commands. Python scripts cannot be
run and must be interpreted - they must specify the interpreter.
Explicitly invoke the tools with the configured python interpreter to
allow running the tool on other platforms.
2025-12-04 08:22:08 -06:00
Ryan Mansfield
223fc0895f Merge pull request #85721 from rjmansfield/fix-issue-78598-back-deployment
[Test] Fix Interpreter/issue-78598.swift to work with back deployment
2025-12-04 08:59:56 -05:00
eeckstein
4ebdcf27a6 Merge pull request #85814 from eeckstein/no-destroy-hoisting-in-dce
Optimizer: don't hoist destroys in DeadCodeElimination and the InstructionDeleter
2025-12-04 14:22:14 +01:00
Anthony Latsis
38c4867e8c Merge pull request #85798 from swiftlang/jepa-main4
Address `llvm::StringSwitch` deprecations in advance
2025-12-04 13:19:08 +00:00
Danny Canter
51c1358778 Merge pull request #85726 from dcantah/add-errno-to-linux-lock-failures
Synchronization: Add errno to some linux lock fatalErrors
2025-12-04 03:58:55 -08:00
Doug Gregor
dcebf64e32 Merge pull request #85808 from DougGregor/unicode-data-without-shims
Move Unicode Data declarations from SwiftShims to `@_extern(c)`
2025-12-04 01:50:41 -08:00
Daniil Kovalev
b73676ee68 Bridging: Implement several optional- and enum-related bridges (#85756)
In #85757, part of the changes resolving #68944 is submitted. Most
bridges required for #85757 were previously implemented in #84648. After
#82653 got merged, we have demand for several new bridges in order to
properly support optimizing derivatives of throwing functions via
AutoDiff Closure Specialization pass.

This patch implements:

- **AST:**

   * `var optionalObjectType: Type` property of `Type` struct
   
   * `var optionalType: Type` property of `Type` struct

- **SIL:**

  * `let name: StringRef` property of `EnumCase` struct

* `func createOptionalSome(operand: Value, type: Type) -> EnumInst`
method of `Builder`

* `func createOptionalNone(type: Type) -> EnumInst` method of `Builder`
2025-12-04 08:26:44 +00:00
Kavon Farvardin
12cb3f9a9a Merge pull request #85704 from kavon/suppressed-assoc-types-with-defaults
Sema: introduce SuppressedAssociatedTypesWithDefaults
2025-12-03 23:07:40 -08:00
Becca Royal-Gordon
5c2fe422fb Merge pull request #85517 from beccadax/mod-squad-bound-by-its-word
Don’t repeat lookup work that may not round-trip
2025-12-03 20:40:07 -08:00
Arnold Schwaighofer
7ea48e595f Merge pull request #85826 from aschwaighofer/exist_cast_fails_test_optimize_none
[embedded] Disable test that only works in non optimized mode
2025-12-03 20:37:21 -08:00