mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Do not gate the coroutine extension points on the LLVM passes. Without running this pass, the generated IR cannot be used by the LLVM tooling. This allows generating the LLVM IR to debug issues in the LLVM backend. I encountered this when trying to isolate a debug info generation bug which seems to be caused by the SRoA pass in LLVM. By allowing to emit the LLVM IR without the LLVM optimizations, it is possible to isolate the LLVM pass operation via `opt` from LLVM.
17 lines
513 B
Swift
17 lines
513 B
Swift
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns -disable-swift-specific-llvm-optzns -primary-file %s | %FileCheck %s
|
|
extension Dictionary {
|
|
subscript(alternate key: Key) -> Value? {
|
|
get {
|
|
return self[key]
|
|
}
|
|
_modify {
|
|
var value: Value? = nil
|
|
yield &value
|
|
}
|
|
}
|
|
}
|
|
|
|
// CHECK-LABEL: define {{.*}}sSD14modifyaccessorE9alternateq_Sgx_tciM
|
|
// CHECK: [[COROALLOCA:%.*]] = call token @llvm.coro.alloca.alloc
|
|
// CHECK: call void @llvm.coro.alloca.free(token [[COROALLOCA]])
|