mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
And unbreak the LLDB testsuite. This patch fixes three problems with the original implementation: - Use SILBuilderWithScope instead of SILBuilder to avoid holes in the lexical scopes. - Use an artificial location for stores to the alloca to avoid the debugger stopping before the variable is initialized. - Recognize debug_value_addr instructions referring to an alloc_stack instruction to avoid introducing an extra indirection in the debug info. rdar://problem/31975108
26 lines
676 B
Swift
26 lines
676 B
Swift
// RUN: %target-swift-frontend %s -module-name A -emit-ir -g -o - | %FileCheck %s
|
|
// REQUIRES: CPU=x86_64
|
|
public struct Continuation<A> {
|
|
private let magicToken = "Hello World"
|
|
fileprivate let f: (() -> A)?
|
|
|
|
public func run() {}
|
|
}
|
|
|
|
public typealias ContinuationU = Continuation<()>
|
|
|
|
// CHECK: %2 = alloca %T1A12ContinuationV, align 8
|
|
// CHECK-NEXT: call void @llvm.dbg.declare(metadata %T1A12ContinuationV* %2,
|
|
// CHECK-SAME: metadata ![[X:.*]], metadata !DIExpression())
|
|
// CHECK: ![[X]] = !DILocalVariable(name: "x",
|
|
|
|
public func f<A>(_ xs: [Continuation<A>]) -> (() -> A?) {
|
|
return {
|
|
for x in xs {
|
|
x.run()
|
|
}
|
|
return nil
|
|
}
|
|
}
|
|
|