diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index d1a36299dc4a2..624e1a513ec69 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -924,13 +924,6 @@ DwarfDebug::getOrCreateDwarfCompileUnit(const DICompileUnit *DIUnit) { NewCU.setSection(Asm->getObjFileLowering().getDwarfInfoSection()); } - // Create DIEs for function declarations used for call site debug info. - // Note: Declaration subprograms imported by LTO are not added to the unit's - // list of retained types, so their DIEs are not constructed here. - for (auto Scope : DIUnit->getRetainedTypes()) - if (auto *SP = dyn_cast_or_null(Scope)) - NewCU.getOrCreateSubprogramDIE(SP); - CUMap.insert({DIUnit, &NewCU}); CUDieMap.insert({&NewCU.getUnitDie(), &NewCU}); return NewCU; diff --git a/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-orr-moves.mir b/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-orr-moves.mir index 916a14022ba56..3e7e6cbfdee5e 100644 --- a/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-orr-moves.mir +++ b/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-orr-moves.mir @@ -159,7 +159,7 @@ body: | ... # CHECK: DW_TAG_GNU_call_site -# CHECK-NEXT: DW_AT_abstract_origin (0x0000002a "call_int") +# CHECK-NEXT: DW_AT_abstract_origin ({{.*}} "call_int") # # CHECK: DW_TAG_GNU_call_site_parameter # CHECK-NEXT: DW_AT_location (DW_OP_reg0 W0) @@ -205,7 +205,7 @@ body: | ... # CHECK: DW_TAG_GNU_call_site -# CHECK-NEXT: DW_AT_abstract_origin (0x0000003e "call_long") +# CHECK-NEXT: DW_AT_abstract_origin ({{.*}} "call_long") # # CHECK: DW_TAG_GNU_call_site_parameter # CHECK-NEXT: DW_AT_location (DW_OP_reg0 W0) @@ -265,7 +265,7 @@ body: | ... # CHECK: DW_TAG_GNU_call_site -# CHECK-NEXT: DW_AT_abstract_origin (0x00000052 "call_int_int") +# CHECK-NEXT: DW_AT_abstract_origin ({{.*}} "call_int_int") # # CHECK: DW_TAG_GNU_call_site_parameter # FIXME: The DW_AT_location attribute should actually refer to W0! See PR44118. diff --git a/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir b/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir index e79be66cd4e38..caee15c2a9e64 100644 --- a/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir +++ b/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir @@ -39,17 +39,11 @@ # CHECK-GNU-NEXT: DW_AT_location (DW_OP_reg8 R8) # CHECK-GNU-NEXT: DW_AT_GNU_call_site_value (DW_OP_breg14 R14+3) -# CHECK-DWARF5: [[getValue_SP:.*]]: DW_TAG_subprogram -# CHECK-DWARF5-NEXT: DW_AT_name ("getVal") - -# CHECK-DWARF5: [[foo_SP:.*]]: DW_TAG_subprogram -# CHECK-DWARF5-NEXT: DW_AT_name ("foo") - # CHECK-DWARF5: DW_TAG_call_site -# CHECK-DWARF5: DW_AT_call_origin ([[getValue_SP]]) -# +# CHECK-DWARF5: DW_AT_call_origin ([[getValue_SP:.*]]) + # CHECK-DWARF5: DW_TAG_call_site -# CHECK-DWARF5: DW_AT_call_origin ([[foo_SP]]) +# CHECK-DWARF5: DW_AT_call_origin ([[foo_SP:.*]]) # CHECK-DWARF5: DW_AT_call_return_pc {{.*}} # CHECK-DWARF5-EMPTY: # CHECK-DWARF5: DW_TAG_call_site_parameter @@ -71,6 +65,12 @@ # CHECK-DWARF5-NEXT: DW_AT_location (DW_OP_reg8 R8) # CHECK-DWARF5-NEXT: DW_AT_call_value (DW_OP_breg14 R14+3) +# CHECK-DWARF5: [[getValue_SP]]: DW_TAG_subprogram +# CHECK-DWARF5-NEXT: DW_AT_name ("getVal") + +# CHECK-DWARF5: [[foo_SP]]: DW_TAG_subprogram +# CHECK-DWARF5-NEXT: DW_AT_name ("foo") + --- | ; ModuleID = 'test.c' source_filename = "test.c" diff --git a/llvm/test/DebugInfo/X86/lto-cross-cu-call-origin-ref.ll b/llvm/test/DebugInfo/X86/lto-cross-cu-call-origin-ref.ll index db14b06fc517b..00715841ab5c0 100644 --- a/llvm/test/DebugInfo/X86/lto-cross-cu-call-origin-ref.ll +++ b/llvm/test/DebugInfo/X86/lto-cross-cu-call-origin-ref.ll @@ -49,10 +49,6 @@ ; CHECK: DW_TAG_compile_unit ; CHECK: DW_AT_name ("a.c") -; CHECK: DW_TAG_subprogram -; CHECK: DW_AT_name ("func_from_b") -; CHECK: DW_AT_declaration (true) - ; CHECK: 0x{{0+}}[[NOINLINE_FUNC_IN_A:.*]]: DW_TAG_subprogram ; CHECK: DW_AT_name ("noinline_func_in_a") @@ -81,14 +77,6 @@ ; CHECK: DW_TAG_compile_unit ; CHECK: DW_AT_name ("b.c") -; CHECK: DW_TAG_subprogram -; CHECK: DW_AT_name ("noinline_func_in_a") -; CHECK: DW_AT_declaration (true) - -; CHECK: DW_TAG_subprogram -; CHECK: DW_AT_name ("always_inline_helper_in_a_that_calls_foo") -; CHECK: DW_AT_declaration (true) - ; 3) Validate the cross-CU ref from "call_func_in_b_from_a" in a.c. ; CHECK: 0x{{0+}}[[FUNC_FROM_B]]: DW_TAG_subprogram ; CHECK: DW_AT_name ("func_from_b")