mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This commit is similar tocbb89c78d, but for explosions. emitShadowCopyIfNeeded() has some extra code that was added when function arguments were moved out of the async context to ensure that they are being lifetime-extended, and there is also code that generates an incorrect load from the shadow copy. However, emitShadowCopyIfNeeded is supposed return either an alloca or the value, and IRGenDebugInfo knows to describe the value in the alloca already. The load is counterproductive it's only valid until whatever register it ends up in is clobbered, whereas the alloca is valid throughout the function. This patch removes the load and updates the tests accordingly. rdar://81565869 (cherry picked from commitb7e2b2a6e7)
23 lines
706 B
Swift
23 lines
706 B
Swift
// RUN: %target-swift-frontend %s -emit-ir -g -o - \
|
|
// RUN: -module-name a -disable-availability-checking \
|
|
// RUN: | %FileCheck %s --check-prefix=CHECK
|
|
// REQUIRES: concurrency
|
|
|
|
func getString() async -> String {
|
|
return ""
|
|
}
|
|
|
|
func wait() async throws {}
|
|
|
|
public func makeDinner() async throws -> String {
|
|
let local_constant = 5
|
|
let local = await getString()
|
|
try await wait()
|
|
// CHECK-LABEL: define {{.*}} void @"$s1a10makeDinnerSSyYaKFTQ0_"
|
|
// CHECK-NEXT: entryresume.0:
|
|
// CHECK-NOT: {{ ret }}
|
|
// CHECK: call void @llvm.dbg.declare(metadata {{.*}}%0, metadata ![[LOCAL:[0-9]+]], {{.*}}!DIExpression(DW_OP_plus_uconst
|
|
// CHECK: ![[LOCAL]] = !DILocalVariable(name: "local"
|
|
return local
|
|
}
|