mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This commit adds a DebugVariable field that is shared by - AllocBoxInst - AllocStackInst - DebugValueInst - DebugValueAddrInst Currently DebugVariable only holds the Swift argument number. This allows us to retire several expensive heuristics in IRGen that attempted to identify which local variables actually where arguments and recover their relative order. Memory footprint notes: This commit adds a 4-byte field to 4 SILInstructin subclasses. This was offset by8ab1e2dd50which removed 20 bytes from *every* SILInstruction. Caveats: This commit surfaces a known bug in FunctionSigantureOpts, tracked in rdar://problem/23727705 — debug info for exploded function arguments cannot be expressed until this is fixed. This reappliesed2b16dc5awith a bugfix for generic function arrguments and an additional testcase. <rdar://problem/21185379&22705926>
21 lines
559 B
Swift
21 lines
559 B
Swift
// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
|
|
class C {
|
|
func withClosure(_ : () -> ()) -> () {}
|
|
|
|
func f() {
|
|
// CHECK: define{{.*}}_TFFC11capturelist1C1fFT_T_U_FT_T_
|
|
// There should not be a local weak variable "self" shadowing the
|
|
// implicit self argument.
|
|
// let self
|
|
// CHECK: call void @llvm.dbg
|
|
// let s
|
|
// CHECK: call void @llvm.dbg
|
|
// var weak self
|
|
// CHECK-NOT: call void @llvm.dbg
|
|
// CHECK: ret void
|
|
withClosure { [weak self] in
|
|
guard let s = self else { return }
|
|
}
|
|
}
|
|
}
|