mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When emitting a method definition in debug info, the compiler should also emit the method's declaration, because LLVM LTO can't unify type definitions when a child DIE is a full subprogram definition. This is already the behavior for standard methods, this patch implements the same behavior for witness and objc methods as well. rdar://123334375
17 lines
720 B
Swift
17 lines
720 B
Swift
// RUN: %target-swift-frontend -primary-file %s -emit-ir -gdwarf-types -o - | %FileCheck %s
|
|
|
|
// Verify that we added a declaration for a witness method.
|
|
|
|
// CHECK: define{{.*}}@"$s4main14PutCharPrinterCAA09CharacterD0A2aDPxycfCTW"{{.*}} !dbg ![[INIT_DEF_DBG:[0-9]+]]
|
|
// CHECK: ![[INIT_DEF_DBG]] = distinct !DISubprogram(name: "init", linkageName: "$s4main14PutCharPrinterCAA09CharacterD0A2aDPxycfCTW"
|
|
// CHECK-SAME: DISPFlagDefinition{{.*}} declaration: ![[FUNC_DEF_DBG:[0-9]+]]
|
|
// CHECK: ![[FUNC_DEF_DBG]] = !DISubprogram(name: "init", linkageName: "$s4main14PutCharPrinterCAA09CharacterD0A2aDPxycfCTW"
|
|
|
|
protocol CharacterPrinter {
|
|
init()
|
|
}
|
|
|
|
class PutCharPrinter: CharacterPrinter {
|
|
public required init() {}
|
|
}
|