Skip to content

Commit 64fc43e

Browse files
committed
Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2025-02-06-a' of github.com:swiftlang/swift into cal--fix-nested-weak-self-issue
Tag build swift-DEVELOPMENT-SNAPSHOT-2025-02-06-a
2 parents 31528da + 57234f8 commit 64fc43e

File tree

317 files changed

+8701
-2572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

317 files changed

+8701
-2572
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ root = true
55
[*]
66
indent_style = space
77
indent_size = 2
8-
trim_trailing_whitespace = true
8+
trim_trailing_whitespace = false
99
insert_final_newline = true

SwiftCompilerSources/Sources/Basic/Utils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ extension Optional where Wrapped == UnsafeMutablePointer<BridgedSwiftObject> {
173173

174174
extension BridgedArrayRef {
175175
public func withElements<T, R>(ofType ty: T.Type, _ c: (UnsafeBufferPointer<T>) -> R) -> R {
176-
let start = data?.bindMemory(to: ty, capacity: count)
176+
let start = data?.assumingMemoryBound(to: ty)
177177
let buffer = UnsafeBufferPointer(start: start, count: count)
178178
return c(buffer)
179179
}

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/DestroyHoisting.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@ private extension InstructionRange {
188188
}
189189
defer { visitor.deinitialize() }
190190

191+
// This is important to visit begin_borrows which don't have an end_borrow in dead-end blocks.
192+
// TODO: we can remove this once we have complete lifetimes.
193+
visitor.innerScopeHandler = {
194+
if let inst = $0.definingInstruction {
195+
liverange.insert(inst)
196+
}
197+
return .continueWalk
198+
}
199+
191200
_ = visitor.visitUses()
192201
self = liverange
193202
}

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyRefCasts.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ private extension UnaryInstruction {
8686
operand.set(to: replacement, context)
8787
}
8888

89+
if let ccb = self as? CheckedCastBranchInst {
90+
// Make sure that updating the formal type with the operand type is
91+
// legal.
92+
if operand.value.type.isLegalFormalType {
93+
ccb.updateSourceFormalTypeFromOperandLoweredType()
94+
}
95+
}
8996
if canEraseInst {
9097
context.erase(instructionIncludingDebugUses: inst)
9198
}

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,6 +1696,10 @@ final public class CheckedCastBranchInst : TermInst, UnaryInstruction {
16961696
public var source: Value { operand.value }
16971697
public var successBlock: BasicBlock { bridged.CheckedCastBranch_getSuccessBlock().block }
16981698
public var failureBlock: BasicBlock { bridged.CheckedCastBranch_getFailureBlock().block }
1699+
1700+
public func updateSourceFormalTypeFromOperandLoweredType() {
1701+
bridged.CheckedCastBranch_updateSourceFormalTypeFromOperandLoweredType()
1702+
}
16991703
}
17001704

17011705
final public class CheckedCastAddrBranchInst : TermInst {

SwiftCompilerSources/Sources/SIL/Type.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ public struct Type : CustomStringConvertible, NoReflectionChildren {
104104
public var isBuiltinVector: Bool { bridged.isBuiltinVector() }
105105
public var builtinVectorElementType: Type { bridged.getBuiltinVectorElementType().type }
106106

107+
public var isLegalFormalType: Bool { bridged.isLegalFormalType() }
108+
107109
public func isBuiltinInteger(withFixedWidth width: Int) -> Bool {
108110
bridged.isBuiltinFixedWidthInteger(width)
109111
}

cmake/modules/DarwinSDKs.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set(SUPPORTED_IOS_SIMULATOR_ARCHS "x86_64;arm64")
33
set(SUPPORTED_TVOS_ARCHS "arm64")
44
set(SUPPORTED_TVOS_SIMULATOR_ARCHS "x86_64;arm64")
55
set(SUPPORTED_WATCHOS_ARCHS "armv7k;arm64_32")
6-
set(SUPPORTED_WATCHOS_SIMULATOR_ARCHS "i386;x86_64;arm64")
6+
set(SUPPORTED_WATCHOS_SIMULATOR_ARCHS "x86_64;arm64")
77
set(SUPPORTED_OSX_ARCHS "x86_64;arm64")
88
set(SUPPORTED_XROS_ARCHS "arm64;arm64e")
99
set(SUPPORTED_XROS_SIMULATOR_ARCHS "arm64")

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ function(remove_sdk_unsupported_archs name os sdk_path deployment_version archit
9191
# 32-bit watchOS is not listed explicitly in SDK settings.
9292
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
9393
list(APPEND architectures ${arch})
94-
elseif(arch STREQUAL "i386" AND os STREQUAL "watchsimulator")
95-
# 32-bit watchOS simulator is not listed explicitly in SDK settings.
96-
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
97-
list(APPEND architectures ${arch})
9894
else()
9995
message(STATUS "${name} SDK at ${sdk_path} does not support architecture ${arch}")
10096
endif()
@@ -431,7 +427,7 @@ macro(configure_sdk_unix name architectures)
431427
string(REGEX REPLACE "[-].*" "" freebsd_system_version ${CMAKE_SYSTEM_VERSION})
432428
message(STATUS "FreeBSD Version: ${freebsd_system_version}")
433429

434-
set(SWIFT_SDK_FREEBSD_ARCH_${arch}_TRIPLE "${arch}-unknown-freebsd${freebsd_system_version}")
430+
set(SWIFT_SDK_FREEBSD_ARCH_${arch}_TRIPLE "${arch}-unknown-freebsd")
435431
elseif("${prefix}" STREQUAL "OPENBSD")
436432
if(NOT arch STREQUAL "x86_64" AND NOT arch STREQUAL "aarch64")
437433
message(FATAL_ERROR "unsupported arch for OpenBSD: ${arch}")

docs/SIL/Instructions.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,15 +2005,19 @@ Builtin.RawPointer or a struct containing the same.
20052005
`%base` may have either object or address type. In the latter case, the
20062006
dependency is on the current value stored in the address.
20072007

2008-
The optional `nonescaping` attribute indicates that no value derived from
2009-
`%value` escapes the lifetime of `%base`. As with escaping `mark_dependence`,
2010-
all values transitively forwarded from `%value` must be destroyed within the
2011-
lifetime of `base`. Unlike escaping`mark_dependence`, this must be statically
2012-
verifiable. Additionally, unlike escaping`mark_dependence`, derived values
2013-
include copies of`%value`and values transitively forwarded from those copies.
2014-
If`%base`must not be identical to`%value`. Unlike escaping`mark_dependence`,
2015-
no value derived from`%value`may have a bitwise escape (conversion to
2016-
UnsafePointer) or pointer escape (unknown use).
2008+
The optional `nonescaping` attribute indicates that no value derived
2009+
from `%value` escapes the lifetime of `%base`. As with escaping
2010+
`mark_dependence`, all values transitively forwarded from `%value`
2011+
must be destroyed within the lifetime of `base`. Unlike escaping
2012+
`mark_dependence`, this must be statically verifiable. Additionally,
2013+
unlike escaping `mark_dependence`, nonescaping `mark_dependence` may
2014+
produce a value of non-`Escapable` type. A non-`Escapable`
2015+
`mark_dependence` extends the lifetime of `%base` into copies of
2016+
`%value` and values transitively forwarded from those copies. If the
2017+
`mark_dependence` forwards an address, then it extends the lifetime
2018+
through loads from that address. Unlike escaping `mark_dependence`, no
2019+
value derived from `%value` may have a bitwise escape (conversion to
2020+
UnsafePointer) or pointer escape (unknown use).
20172021

20182022
### is_unique
20192023

include/swift-c/DependencyScan/DependencyScan.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/// SWIFTSCAN_VERSION_MINOR should increase when there are API additions.
2626
/// SWIFTSCAN_VERSION_MAJOR is intended for "major" source/ABI breaking changes.
2727
#define SWIFTSCAN_VERSION_MAJOR 2
28-
#define SWIFTSCAN_VERSION_MINOR 0
28+
#define SWIFTSCAN_VERSION_MINOR 1
2929

3030
SWIFTSCAN_BEGIN_DECLS
3131

@@ -222,6 +222,14 @@ SWIFTSCAN_PUBLIC swiftscan_string_ref_t
222222
swiftscan_swift_textual_detail_get_user_module_version(
223223
swiftscan_module_details_t details);
224224

225+
SWIFTSCAN_PUBLIC swiftscan_string_ref_t
226+
swiftscan_swift_textual_detail_get_chained_bridging_header_path(
227+
swiftscan_module_details_t details);
228+
229+
SWIFTSCAN_PUBLIC swiftscan_string_ref_t
230+
swiftscan_swift_textual_detail_get_chained_bridging_header_content(
231+
swiftscan_module_details_t details);
232+
225233
//=== Swift Binary Module Details query APIs ------------------------------===//
226234

227235
SWIFTSCAN_PUBLIC swiftscan_string_ref_t

0 commit comments

Comments
 (0)