Commit Graph

195121 Commits

Author SHA1 Message Date
Pavel Yaskevich
cac74c361e Merge pull request #85905 from xedin/rdar-165862285-6.3
[6.3][CSRanking] Disambiguate static vs. instance method that used to be s…
swift-6.3-DEVELOPMENT-SNAPSHOT-2025-12-10-a
2025-12-10 06:48:36 -08:00
Eric Miotto
7a7ad4c2fb Merge pull request #85920 from edymtt/edymtt/android-build-builtin-float-before-math-6.3
[6.3] CMake Android: ensure _Builtin_float is built before _math
2025-12-10 06:16:31 -08:00
Hamish Knight
d925bc4ea6 Merge pull request #85918 from hamishknight/retraction-6.3
[6.3] [Demangler] Handle invertible reqs for extensions in `findDeclContext`
2025-12-10 00:06:46 +00:00
John Hui
8f8dc15510 Merge pull request #85909 from j-hui/release-6.3-check-cache-for-enums
[6.3🍒][ClangImporter] Do not import enum when already imported via DeclContext
2025-12-09 13:02:53 -08:00
Eric Miotto
6b3692208e [6.3] CMake Android: ensure _Builtin_float is built before _math
_math would be able to build against either the Swift or the clang
module for _Builtin_float; however the build will fail if the Swift
module is present but does not contain the architectures we need, with errors
like

```
<unknown>:0: error: could not find module
'_Builtin_float' for target 'armv7-unknown-linux-android'; found:
aarch64-unknown-linux-android, x86_64-unknown-linux-android, at:
/home/build-user/build/swift-project/Ninja-Release/swift-linux-x86_64/lib/swift/android/_Builtin_float.swiftmodule/armv7-unknown-linux-android
```

In other words, in this situation we are not falling back to the clang
module.

Addresses rdar://165768601

(cherry picked from commit 817a890a67)
2025-12-09 09:20:47 -08:00
Hamish Knight
82c1e6aa46 [Demangler] Handle invertible reqs for extensions in findDeclContext
If we didn't find an extension result, try again disregarding
invertible requirements since `demangleGenericSignature` won't
include them. This is just meant to be a quick low risk fix that we
can cherry-pick, the proper fix here is to delete all this logic and
just return the nominal along with the ABI module name to filter
lookup results.

rdar://165639044
2025-12-09 14:33:22 +00:00
Slava Pestov
c1db0236d3 Merge pull request #85901 from slavapestov/too-complex-source-loc-6.3
Sema: Fix source location bookkeeping for 'reasonable time' diagnostic [6.3]
2025-12-09 07:26:39 -05:00
Adrian Prantl
2a03662877 Merge pull request #85484 from charles-zablit/charles-zablit/windows/upgrade-python-to-3.10-to-6.3
🍒 [windows] add Embeddable Python to build.ps1
2025-12-08 11:32:08 -08:00
John Hui
7b2dc1f8fe [ClangImporter] Do not import enum when already imported via DeclContext (#85424)
If we try to import this in ObjC interop mode:

```objc
typedef CF_OPTIONS(uint32_t, MyFlags) {
  ...
} CF_SWIFT_NAME(MyCtx.Flags);

struct MyStruct {
  MyFlags flags;
  ...
} CF_SWIFT_NAME(MyCtx);
```

ClangImporter tries to import `MyCtx/MyStruct` before it imports
`MyFlags` (via `importDeclContextOf()`), which in turn tries to import
`MyFlags` again due to the `flags` field. The existing cycle-breaking
mechanism prevents us from looping infinitely, but leads us to import
two copies of the Swift `EnumDecl`, which can cause errors later during
CodeGen.

~~This patch adds an assertion to catch such issues earlier, and breaks
the cycle by checking the cache again.~~ This patch no longer does so
because that caused issues beyond the scope of this patch.

rdar://162317760
(cherry picked from commit f830b1c665)
2025-12-08 11:26:42 -08:00
Xi Ge
00dd88ca6e Merge pull request #85548 from cachemeifyoucan/eng/PR-164903080-release
[6.3] Revert "[Caching][NFC] Using llvm::cas::CASConfiguration"
2025-12-08 10:43:10 -08:00
Pavel Yaskevich
58d6a5c8fc [CSRanking] Disambiguate static vs. instance method that used to be supported by a performance hack
Handle the following situation:

```swift
struct S {
   func test() {}
   static func test(_: S) {}
}
```

Calling `S.test(s)` where `s` has a type `S` without any other context
should prefer a complete call to a static member over a partial
application of an instance once based on the choice of the base type.

The behavior is consistent for double-applies as well i.e.
`S.test(s)()` if static method produced a function type it would be
preferred.

Resolves: rdar://165862285
(cherry picked from commit 7c32c2a21b)
2025-12-08 10:08:10 -08:00
Augusto Noronha
3686529709 Merge pull request #85824 from augusto2112/use-anonymous-address-6.3
[RemoteInspection] Use the address returned by resolveRemoteAddress
2025-12-08 08:55:29 -08:00
Pavel Yaskevich
045852bbc7 [Tests] NFC: Restrict new SwiftUI to macOS
Frontend invocation targets macOS so attempting it on simulators
results in failures different from intended "too complex".
2025-12-08 09:53:40 -05:00
Slava Pestov
a647024040 Sema: Fix source location bookkeeping for 'reasonable time' diagnostic
We already had bookkeeping to track which statement in a multi-statement
closure we were looking at, but this was only used for the 'reasonable time'
diagnostic in the case that we hit the expression timer, which was almost
never hit, and is now off by default. The scope, memory, and trial limits
couldn't use this information, so they would always diagnose the entire
target being type checked.

Move it up from ExpressionTimer to ConstraintSystem, so that we get the
right source location there too. Also, factor out some code duplication
in BuilderTransform to ensure we get the same benefit for result builders
applied to function bodies too.
2025-12-08 09:49:53 -05:00
Slava Pestov
9e283e2822 Sema: Fix SolutionResult move constructor 2025-12-08 09:49:53 -05:00
Slava Pestov
fafb362056 Sema: Fix latent bug due to unhandled cases in constraints::simplifyLocator() 2025-12-08 09:49:53 -05:00
Anthony Latsis
884c5011cc Merge pull request #85839 from swiftlang/jepa-release2
[6.3][NFC] "SwiftVersion" → "LanguageMode" in `DiagnosticEngine::warnUntilSwiftVersion`, etc.
swift-6.3-DEVELOPMENT-SNAPSHOT-2025-12-07-a
2025-12-07 04:23:37 +00:00
Anthony Latsis
8d00ceb8cf Merge pull request #85561 from swiftlang/jepa-release
AST: Properly disallow isa/cast/dyn_cast on `Type`
2025-12-06 23:17:29 +00:00
Slava Pestov
b8053df2a9 Merge pull request #85864 from slavapestov/fix-rdar165909327-6.3
Sema: Re-visit @specialize attribute where clause in interface resolution stage [6.3]
2025-12-06 10:47:16 -05:00
Artem Chikin
8bf0adb5b2 Merge pull request #85853 from artemcm/63-FixScanDepsPerfRegression
[6.3 🍒][Dependency Scanning] Do not re-query a given clang module identifier more than once
swift-6.3-DEVELOPMENT-SNAPSHOT-2025-12-06-a
2025-12-06 01:17:05 -08:00
Evan Wilde
c7847e113f Merge pull request #85618 from etcwilde/ewilde-6.3/stdlib-tracing
🍒6.3: CMake: Runtimes: Enable tracing on Apple OSs
swift-6.3-DEVELOPMENT-SNAPSHOT-2025-12-05-a
2025-12-05 10:00:07 -08:00
Slava Pestov
be658956df 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:54:41 -05:00
Charles Zablit
44392a5018 [windows] remove pip installation
(cherry picked from commit d73c6c7766)
2025-12-05 11:27:36 +00:00
Saleem Abdulrasool
7bbbe63547 utils: adjust the python path
Adjust the python relative path when building LLDB to account for the
restructuring in the packaging.

(cherry picked from commit 8c66755133)
2025-12-05 11:27:30 +00:00
Charles Zablit
40e0460539 [windows] add Embeddable Python to build.ps1
(cherry picked from commit 04e07b32c7)
2025-12-05 11:27:26 +00:00
Artem Chikin
54294e79c9 [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 16:41:08 -08:00
Evan Wilde
b46b5efe9e CMake: Verify os_signpost_*/os_log with tracing
Adding check to CMake to verify that we have the os_signpost and os_log
API available in order to accept enabling the runtime tracing.

(cherry picked from commit 20cfe0a4e0)
2025-12-04 10:43:14 -08:00
Evan Wilde
f38693a80f CMake: Runtime: Enable tracing on Apple platforms
Adding tracing to concurrency, and enable tracing on the standard
library on Apple OSs.

rdar://164925172
(cherry picked from commit 01eb3990be)
2025-12-04 10:43:12 -08:00
Anthony Latsis
1e64183064 [NFC] "SwiftVersion" → "LanguageMode" in DiagnosticEngine::warnUntilSwiftVersion, etc.
(cherry picked from commit 88220a33c3)
2025-12-04 17:27:08 +00:00
Egor Zhdan
896e1fbe81 Merge pull request #85585 from egorzhdan/egorzhdan/6.3-revert-cs-std-string
🍒Revert "[ConstraintSystem] C++ Interop: Binding a string literal to `std.string` shouldn't increase the score"
2025-12-04 16:56:34 +00:00
Alex Hoppen
c0508f2aa6 Merge pull request #85788 from ahoppen/6.3/pretty-index-stacktrace
[6.3] Add pretty stack trace entry for all index operations
2025-12-04 17:53:20 +01:00
Slava Pestov
6596c74e0d Merge pull request #85684 from slavapestov/lazy-opaque-type-decl-6.3
Serialization: Lazily deserialize OpaqueTypeDecl's underlying substitutions [6.3]
2025-12-04 10:21:54 -05:00
Adrian Prantl
2421cef176 Merge pull request #85815 from adrian-prantl/debuglog-seterror-6.3
[LLDB] Replace more instances of the DEBUG_LOG macro with setError
2025-12-03 19:43:49 -08:00
Tony Allevato
e95f5a14b3 Merge pull request #85813 from allevato/json-ast-fixes-6.3
[6.3 🍒] [ASTDumper] Fix some crashers and malformed AST dumps
2025-12-03 17:47:53 -05:00
Augusto Noronha
7c9ac6044e [RemoteInspection] Use the address returned by resolveRemoteAddress
A previous change introduced the "resolveRemoteAddress" API in the
MemoryReader interface, along with one use of it. However, the resolved
memory address is created, but left accidentally unused.

rdar://161919584
(cherry picked from commit 3472c00cba)
2025-12-03 14:06:12 -08:00
Adrian Prantl
6267454f82 Merge pull request #85752 from felipepiovezan/felipe/cherry_pick_dbgdeclarevalue_swift
[IRGenDebugInfo] Replace llvm.dbg.coroframe_entry with dbg.declare_value
2025-12-03 10:59:20 -08:00
Pavel Yaskevich
c5c0e06ac1 Merge pull request #85686 from clackary/fix/6.3/85020-metatype-resolution
[6.3 🍒][CSOptimizer] Also favor existential metatype candidates in paramType isAny fast path
2025-12-03 10:29:22 -08:00
Gábor Horváth
97f8be5e06 Merge pull request #85782 from Xazax-hun/virtual-move-only-types-on-6.3
[6.3][cxx-interop] Fix crash when virtual methods take move-only types
2025-12-03 18:07:11 +00:00
Gábor Horváth
8ddfe8259c Merge pull request #85783 from Xazax-hun/const-frts-collision-on-6.3
[6.3][cxx-interop] Do not drop CV qualifiers during printing template names
2025-12-03 18:06:55 +00:00
Pavel Yaskevich
75432c03ae Merge pull request #85805 from xedin/rdar-122963120-6.3
[6.3][ASTPrinter] Print a fully resolved type for an outermost property wr…
2025-12-03 09:42:55 -08:00
Adrian Prantl
b831890994 [LLDB] Replace more instances of the DEBUG_LOG macro with setError
This allows LLDB to query the last error and produce more helpful
diagnostics. This is NFC for the runtime.

(cherry picked from commit 90f4b4fc8e)
2025-12-03 08:32:08 -08:00
Tony Allevato
674b51eef0 [ASTDumper] Fix malformed JSON for async let _ = ....
By calling `printCommon` twice, this inserts a JSON object into
another JSON object without a key. This asserts inside LLVM's
JSON helper, but only if the compiler is built with assertions
enabled (which Xcode's compiler doesn't).

This also fixes the S-expression version, which is similarly busted:

```
(pattern_entry
  (async_let  type="Int"              (pattern_any type="Int")
  (original_init=call_expr type="Int" ...
```
2025-12-03 08:25:48 -05:00
Tony Allevato
e2a3fb4bc1 [ASTDumper] Print decl-refs, not full decls, for function captures.
This avoids infinite recursion when a function captures itself; e.g.,

```swift
func foo() {
  func bar() {
    bar()
  }
  bar()
}
```

It also just avoids printing unnecessarily verbose information,
since those decls would have already been dumped elsewhere in the
tree.
2025-12-03 08:25:38 -05:00
Tony Allevato
d67784ccea [ASTDumper] Don't attempt to compute type USR for ModuleTypes.
`ModuleType`s show up in some rare places, like the left-hand-side of
a `DotSyntaxBaseIgnoredExpr` for a module-qualified function call.
ASTMangler does not support these because they're not real types.
2025-12-03 08:25:33 -05:00
Egor Zhdan
51fcd6c9d1 Merge pull request #85799 from egorzhdan/egorzhdan/6.3-wrap-in-objc
🍒[cxx-interop] Wrap methods that take Obj-C params in `#if defined(__OBJC__)`
2025-12-03 11:43:23 +00:00
eeckstein
8ae936d29b Merge pull request #85784 from eeckstein/fix-sil-combine-6.3
[6.3] SILCombine: fix propagation of concrete existentials in enums
2025-12-03 06:47:26 +01:00
Kavon Farvardin
59cbba17f4 Merge pull request #85801 from kavon/6.3-keypath-metadata-fix
[6.3] IRGen/ABI: fix count of requirements in getAddrOfGenericEnvironment
2025-12-02 21:20:34 -08:00
Adrian Prantl
b5da61bfbe Merge pull request #85764 from adrian-prantl/161134092-6.3
[6.3][Debug Info] Represent type alias existentials in debug info
2025-12-02 19:11:59 -08:00
Doug Gregor
0e0c925f72 Merge pull request #85786 from eeckstein/embedded-witness-method-specialization-6.3
[6.3] embedded: change the function representation of directly called witness methods
2025-12-02 15:02:21 -08:00
Pavel Yaskevich
d4d45d3dac [ASTPrinter] Print a fully resolved type for an outermost property wrapper in swift interfaces
The type of an outermost property wrapper should be printed together
with (inferred) generic arguments because otherwise if a any wrapper
in the chain has generic parameters that are not involved in
`wrappedValue:` argument it won't be impossible to infer them while
type-checking the interface file where it appears.

Resolves: rdar://122963120
(cherry picked from commit 5b665a8426)
2025-12-02 12:00:14 -08:00