From d4de180e19548b0de60126c8f63353aeeed5325a Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Fri, 10 Oct 2014 15:51:02 +0000 Subject: [PATCH] [dwarfdump] Resolve also variable specifications/abstract_origins. DW_AT_specification and DW_AT_abstract_origin resolving was only performed on subroutine DIEs because it used the getSubroutineName method. Introduce a more generic getName() and use it to dump the reference attributes. Testcases have been updated to check the printed names instead of the offsets except when the name could be ambiguous. Reviewers: dblaikie, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5625 llvm-svn: 219506 --- llvm/include/llvm/DebugInfo/DIContext.h | 6 ++++- llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp | 22 ++++++++++------- llvm/lib/DebugInfo/DWARFDebugInfoEntry.h | 9 ++++--- llvm/test/DebugInfo/PR20038.ll | 6 ++--- .../DebugInfo/X86/concrete_out_of_line.ll | 2 +- .../X86/dbg-value-inlined-parameter.ll | 12 +++++----- .../DebugInfo/X86/debug-info-static-member.ll | 24 +++++++++---------- llvm/test/DebugInfo/X86/gnu-public-names.ll | 24 +++++++++---------- llvm/test/DebugInfo/cross-cu-inlining.ll | 4 ++-- .../DebugInfo/missing-abstract-variable.ll | 10 ++++---- .../namespace_inline_function_definition.ll | 4 ++-- 11 files changed, 68 insertions(+), 55 deletions(-) diff --git a/llvm/include/llvm/DebugInfo/DIContext.h b/llvm/include/llvm/DebugInfo/DIContext.h index 6fba4f956ce9..160d450c08eb 100644 --- a/llvm/include/llvm/DebugInfo/DIContext.h +++ b/llvm/include/llvm/DebugInfo/DIContext.h @@ -66,11 +66,15 @@ class DIInliningInfo { } }; +/// A DINameKind is passed to name search methods to specify a +/// preference regarding the type of name resolution the caller wants. +enum class DINameKind { None, ShortName, LinkageName }; + /// DILineInfoSpecifier - controls which fields of DILineInfo container /// should be filled with data. struct DILineInfoSpecifier { enum class FileLineInfoKind { None, Default, AbsoluteFilePath }; - enum class FunctionNameKind { None, ShortName, LinkageName }; + typedef DINameKind FunctionNameKind; FileLineInfoKind FLIKind; FunctionNameKind FNKind; diff --git a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp index 6d2e51a64dcf..559667299ca3 100644 --- a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp +++ b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp @@ -18,7 +18,6 @@ #include "llvm/Support/raw_ostream.h" using namespace llvm; using namespace dwarf; -typedef DILineInfoSpecifier::FunctionNameKind FunctionNameKind; // Small helper to extract a DIE pointed by a reference // attribute. It looks up the Unit containing the DIE and calls @@ -129,8 +128,7 @@ void DWARFDebugInfoEntryMinimal::dumpAttribute(raw_ostream &OS, uint32_t Ref = formValue.getAsReference(u).getValue(); DWARFDebugInfoEntryMinimal DIE; if (const DWARFUnit *RefU = findUnitAndExtractFast(DIE, u, &Ref)) - if (const char *Ref = DIE.getSubroutineName(RefU, - FunctionNameKind::LinkageName)) + if (const char *Ref = DIE.getName(RefU, DINameKind::LinkageName)) OS << " \"" << Ref << '\"'; } @@ -331,11 +329,19 @@ bool DWARFDebugInfoEntryMinimal::addressRangeContainsAddress( const char * DWARFDebugInfoEntryMinimal::getSubroutineName(const DWARFUnit *U, - FunctionNameKind Kind) const { - if (!isSubroutineDIE() || Kind == FunctionNameKind::None) + DINameKind Kind) const { + if (!isSubroutineDIE()) + return nullptr; + return getName(U, Kind); +} + +const char * +DWARFDebugInfoEntryMinimal::getName(const DWARFUnit *U, + DINameKind Kind) const { + if (Kind == DINameKind::None) return nullptr; // Try to get mangled name only if it was asked for. - if (Kind == FunctionNameKind::LinkageName) { + if (Kind == DINameKind::LinkageName) { if (const char *name = getAttributeValueAsString(U, DW_AT_MIPS_linkage_name, nullptr)) return name; @@ -351,7 +357,7 @@ DWARFDebugInfoEntryMinimal::getSubroutineName(const DWARFUnit *U, if (spec_ref != -1U) { DWARFDebugInfoEntryMinimal spec_die; if (const DWARFUnit *RefU = findUnitAndExtractFast(spec_die, U, &spec_ref)) { - if (const char *name = spec_die.getSubroutineName(RefU, Kind)) + if (const char *name = spec_die.getName(RefU, Kind)) return name; } } @@ -362,7 +368,7 @@ DWARFDebugInfoEntryMinimal::getSubroutineName(const DWARFUnit *U, DWARFDebugInfoEntryMinimal abs_origin_die; if (const DWARFUnit *RefU = findUnitAndExtractFast(abs_origin_die, U, &abs_origin_ref)) { - if (const char *name = abs_origin_die.getSubroutineName(RefU, Kind)) + if (const char *name = abs_origin_die.getName(RefU, Kind)) return name; } } diff --git a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.h b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.h index 3f912e97b327..7e7efb98ba79 100644 --- a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.h +++ b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.h @@ -125,9 +125,12 @@ public: /// returns its mangled name (or short name, if mangled is missing). /// This name may be fetched from specification or abstract origin /// for this subprogram. Returns null if no name is found. - const char * - getSubroutineName(const DWARFUnit *U, - DILineInfoSpecifier::FunctionNameKind Kind) const; + const char *getSubroutineName(const DWARFUnit *U, DINameKind Kind) const; + + /// Return the DIE name resolving DW_AT_sepcification or + /// DW_AT_abstract_origin references if necessary. + /// Returns null if no name is found. + const char *getName(const DWARFUnit *U, DINameKind Kind) const; /// Retrieves values of DW_AT_call_file, DW_AT_call_line and /// DW_AT_call_column from DIE (or zeroes if they are missing). diff --git a/llvm/test/DebugInfo/PR20038.ll b/llvm/test/DebugInfo/PR20038.ll index 60fb8bb403c1..2cd40fb68abe 100644 --- a/llvm/test/DebugInfo/PR20038.ll +++ b/llvm/test/DebugInfo/PR20038.ll @@ -14,7 +14,7 @@ ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "C" ; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[C_DTOR_DECL:.*]]: DW_TAG_subprogram +; CHECK: DW_TAG_subprogram ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "~C" @@ -22,7 +22,7 @@ ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN1CD1Ev" ; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[D1_THIS_ABS:.*]]: DW_TAG_formal_parameter +; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "this" @@ -36,7 +36,7 @@ ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_THIS_ABS]]} +; CHECK: DW_AT_abstract_origin {{.*}} "this" ; FIXME: D2 is actually inlined into D1 but doesn't show up here, possibly due ; to there being no work in D2 (calling another member function from the dtor diff --git a/llvm/test/DebugInfo/X86/concrete_out_of_line.ll b/llvm/test/DebugInfo/X86/concrete_out_of_line.ll index fb156eb11f0c..43f881e2719c 100644 --- a/llvm/test/DebugInfo/X86/concrete_out_of_line.ll +++ b/llvm/test/DebugInfo/X86/concrete_out_of_line.ll @@ -53,7 +53,7 @@ ; CHECK: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev" ; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_THIS_ABS]]} +; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_THIS_ABS]]} "this" ; CHECK: DW_TAG_inlined_subroutine ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev" diff --git a/llvm/test/DebugInfo/X86/dbg-value-inlined-parameter.ll b/llvm/test/DebugInfo/X86/dbg-value-inlined-parameter.ll index 60662d19d7b5..2f0454e28ce3 100644 --- a/llvm/test/DebugInfo/X86/dbg-value-inlined-parameter.ll +++ b/llvm/test/DebugInfo/X86/dbg-value-inlined-parameter.ll @@ -9,18 +9,18 @@ ; CHECK: DW_AT_abstract_origin {{.*}} "foo" ; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_abstract_origin {{.*}}{[[ABS_SP:.*]]} +; CHECK: DW_AT_abstract_origin {{.*}} "sp" ; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_abstract_origin {{.*}}{[[ABS_NUMS:.*]]} +; CHECK: DW_AT_abstract_origin {{.*}} "nums" ; CHECK: DW_TAG_subprogram ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "foo" -; CHECK: [[ABS_SP]]: DW_TAG_formal_parameter +; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "sp" -; CHECK: [[ABS_NUMS]]: DW_TAG_formal_parameter +; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "nums" @@ -34,9 +34,9 @@ ;CHECK: DW_TAG_formal_parameter ;FIXME: Linux shouldn't drop this parameter either... ;CHECK-NOT: DW_TAG -;DARWIN: DW_AT_abstract_origin {{.*}}{[[ABS_SP]]} +;DARWIN: DW_AT_abstract_origin {{.*}} "sp" ;DARWIN: DW_TAG_formal_parameter -;CHECK: DW_AT_abstract_origin {{.*}}{[[ABS_NUMS]]} +;CHECK: DW_AT_abstract_origin {{.*}} "nums" ;CHECK-NOT: DW_TAG_formal_parameter %struct.S1 = type { float*, i32 } diff --git a/llvm/test/DebugInfo/X86/debug-info-static-member.ll b/llvm/test/DebugInfo/X86/debug-info-static-member.ll index cf149a4a57de..9f1cbacf3a6a 100644 --- a/llvm/test/DebugInfo/X86/debug-info-static-member.ll +++ b/llvm/test/DebugInfo/X86/debug-info-static-member.ll @@ -97,7 +97,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone ; PRESENT: .debug_info contents: ; PRESENT: DW_TAG_class_type ; PRESENT-NEXT: DW_AT_name {{.*}} "C" -; PRESENT: 0x[[DECL_A:[0-9a-f]+]]: DW_TAG_member +; PRESENT: DW_TAG_member ; PRESENT-NEXT: DW_AT_name {{.*}} "a" ; PRESENT: DW_AT_external ; PRESENT: DW_AT_declaration @@ -108,14 +108,14 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone ; PRESENT: DW_AT_declaration ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_private) ; PRESENT: DW_AT_const_value {{.*}} (1) -; PRESENT: 0x[[DECL_B:[0-9a-f]+]]: DW_TAG_member +; PRESENT: DW_TAG_member ; PRESENT-NEXT: DW_AT_name {{.*}} "b" ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) ; PRESENT: DW_TAG_member ; PRESENT-NEXT: DW_AT_name {{.*}} "const_b" ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) ; PRESENT: DW_AT_const_value [DW_FORM_udata] (1078523331) -; PRESENT: 0x[[DECL_C:[0-9a-f]+]]: DW_TAG_member +; PRESENT: DW_TAG_member ; PRESENT-NEXT: DW_AT_name {{.*}} "c" ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) ; PRESENT: DW_TAG_member @@ -131,15 +131,15 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone ; PRESENT: NULL ; Definitions point back to their declarations, and have a location. ; PRESENT: DW_TAG_variable -; PRESENT-NEXT: DW_AT_specification {{.*}} {0x[[DECL_A]]} +; PRESENT-NEXT: DW_AT_specification {{.*}} "a" ; PRESENT-NEXT: DW_AT_location ; PRESENT-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1aE" ; PRESENT: DW_TAG_variable -; PRESENT-NEXT: DW_AT_specification {{.*}} {0x[[DECL_B]]} +; PRESENT-NEXT: DW_AT_specification {{.*}} "b" ; PRESENT-NEXT: DW_AT_location ; PRESENT-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1bE" ; PRESENT: DW_TAG_variable -; PRESENT-NEXT: DW_AT_specification {{.*}} {0x[[DECL_C]]} +; PRESENT-NEXT: DW_AT_specification {{.*}} "c" ; PRESENT-NEXT: DW_AT_location ; PRESENT-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1cE" @@ -147,7 +147,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone ; DARWINP: .debug_info contents: ; DARWINP: DW_TAG_class_type ; DARWINP-NEXT: DW_AT_name {{.*}} "C" -; DARWINP: 0x[[DECL_A:[0-9a-f]+]]: DW_TAG_member +; DARWINP: DW_TAG_member ; DARWINP-NEXT: DW_AT_name {{.*}} "a" ; DARWINP: DW_AT_external ; DARWINP: DW_AT_declaration @@ -158,14 +158,14 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone ; DARWINP: DW_AT_declaration ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_private) ; DARWINP: DW_AT_const_value {{.*}} (1) -; DARWINP: 0x[[DECL_B:[0-9a-f]+]]: DW_TAG_member +; DARWINP: DW_TAG_member ; DARWINP-NEXT: DW_AT_name {{.*}} "b" ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) ; DARWINP: DW_TAG_member ; DARWINP-NEXT: DW_AT_name {{.*}} "const_b" ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) ; DARWINP: DW_AT_const_value [DW_FORM_udata] (1078523331) -; DARWINP: 0x[[DECL_C:[0-9a-f]+]]: DW_TAG_member +; DARWINP: DW_TAG_member ; DARWINP-NEXT: DW_AT_name {{.*}} "c" ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) ; DARWINP: DW_TAG_member @@ -181,15 +181,15 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone ; DARWINP: NULL ; Definitions point back to their declarations, and have a location. ; DARWINP: DW_TAG_variable -; DARWINP-NEXT: DW_AT_specification {{.*}} {0x[[DECL_A]]} +; DARWINP-NEXT: DW_AT_specification {{.*}} "a" ; DARWINP-NEXT: DW_AT_location ; DARWINP-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1aE" ; DARWINP: DW_TAG_variable -; DARWINP-NEXT: DW_AT_specification {{.*}} {0x[[DECL_B]]} +; DARWINP-NEXT: DW_AT_specification {{.*}} "b" ; DARWINP-NEXT: DW_AT_location ; DARWINP-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1bE" ; DARWINP: DW_TAG_variable -; DARWINP-NEXT: DW_AT_specification {{.*}} {0x[[DECL_C]]} +; DARWINP-NEXT: DW_AT_specification {{.*}} "c" ; DARWINP-NEXT: DW_AT_location ; DARWINP-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1cE" diff --git a/llvm/test/DebugInfo/X86/gnu-public-names.ll b/llvm/test/DebugInfo/X86/gnu-public-names.ll index 2663fffce7a7..72ae5b29346a 100644 --- a/llvm/test/DebugInfo/X86/gnu-public-names.ll +++ b/llvm/test/DebugInfo/X86/gnu-public-names.ll @@ -52,7 +52,7 @@ ; CHECK: [[C:0x[0-9a-f]+]]: DW_TAG_structure_type ; CHECK-NEXT: DW_AT_name {{.*}} "C" -; CHECK: [[STATIC_MEM_DECL:0x[0-9a-f]+]]: DW_TAG_member +; CHECK: DW_TAG_member ; CHECK-NEXT: DW_AT_name {{.*}} "static_member_variable" ; CHECK: DW_TAG_subprogram @@ -67,7 +67,7 @@ ; CHECK-NEXT: DW_AT_name {{.*}} "int" ; CHECK: [[STATIC_MEM_VAR:0x[0-9a-f]+]]: DW_TAG_variable -; CHECK-NEXT: DW_AT_specification {{.*}} {[[STATIC_MEM_DECL]]} +; CHECK-NEXT: DW_AT_specification {{.*}} "static_member_variable" ; CHECK: [[GLOB_VAR:0x[0-9a-f]+]]: DW_TAG_variable ; CHECK-NEXT: DW_AT_name {{.*}} "global_variable" @@ -75,10 +75,10 @@ ; CHECK: [[NS:0x[0-9a-f]+]]: DW_TAG_namespace ; CHECK-NEXT: DW_AT_name {{.*}} "ns" -; CHECK: [[GLOB_NS_VAR_DECL:0x[0-9a-f]+]]: DW_TAG_variable +; CHECK: DW_TAG_variable ; CHECK-NEXT: DW_AT_name {{.*}} "global_namespace_variable" -; CHECK: [[D_VAR_DECL:0x[0-9a-f]+]]: DW_TAG_variable +; CHECK: DW_TAG_variable ; CHECK-NEXT: DW_AT_name {{.*}} "d" ; CHECK: [[D:0x[0-9a-f]+]]: DW_TAG_structure_type @@ -91,10 +91,10 @@ ; CHECK: DW_AT_name {{.*}} "global_namespace_function" ; CHECK: [[GLOB_NS_VAR:0x[0-9a-f]+]]: DW_TAG_variable -; CHECK-NEXT: DW_AT_specification {{.*}} {[[GLOB_NS_VAR_DECL]]} +; CHECK-NEXT: DW_AT_specification {{.*}} "_ZN2ns25global_namespace_variableE" ; CHECK: [[D_VAR:0x[0-9a-f]+]]: DW_TAG_variable -; CHECK-NEXT: DW_AT_specification {{.*}} {[[D_VAR_DECL]]} +; CHECK-NEXT: DW_AT_specification {{.*}} "_ZN2ns1dE" ; CHECK: DW_TAG_subprogram ; CHECK-NOT: DW_TAG @@ -116,7 +116,7 @@ ; CHECK: [[OUTER_ANON:.*]]: DW_TAG_namespace ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK-NOT: DW_AT_name -; CHECK: [[OUTER_ANON_C_DECL:.*]]: DW_TAG_variable +; CHECK: DW_TAG_variable ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "c" ; CHECK-NOT: {{DW_TAG|NULL}} @@ -131,7 +131,7 @@ ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: [[OUTER_ANON_C:.*]]: DW_TAG_variable ; CHECK-NOT: DW_TAG -; CHECK-NEXT: DW_AT_specification {{.*}} {[[OUTER_ANON_C_DECL]]} +; CHECK-NEXT: DW_AT_specification {{.*}} "_ZN5outer12_GLOBAL__N_11cE" ; CHECK: [[ANON:.*]]: DW_TAG_namespace ; CHECK-NOT: DW_AT_name @@ -139,13 +139,13 @@ ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "inner" ; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[ANON_INNER_B_DECL:.*]]: DW_TAG_variable +; CHECK: DW_TAG_variable ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "b" ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: NULL ; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[ANON_I_DECL:.*]]: DW_TAG_variable +; CHECK: DW_TAG_variable ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "i" ; CHECK-NOT: {{DW_TAG|NULL}} @@ -153,10 +153,10 @@ ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: [[ANON_INNER_B:.*]]: DW_TAG_variable ; CHECK-NOT: DW_TAG -; CHECK-NEXT: DW_AT_specification {{.*}} {[[ANON_INNER_B_DECL]]} +; CHECK-NEXT: DW_AT_specification {{.*}} "_ZN12_GLOBAL__N_15inner1bE" ; CHECK: [[ANON_I:.*]]: DW_TAG_variable ; CHECK-NOT: DW_TAG -; CHECK-NEXT: DW_AT_specification {{.*}} {[[ANON_I_DECL]]} +; CHECK-NEXT: DW_AT_specification {{.*}} "_ZN12_GLOBAL__N_11iE" ; CHECK: [[MEM_FUNC:0x[0-9a-f]+]]: DW_TAG_subprogram ; CHECK-NOT: DW_TAG diff --git a/llvm/test/DebugInfo/cross-cu-inlining.ll b/llvm/test/DebugInfo/cross-cu-inlining.ll index d799295ffe5b..4ccb3ffbb5fb 100644 --- a/llvm/test/DebugInfo/cross-cu-inlining.ll +++ b/llvm/test/DebugInfo/cross-cu-inlining.ll @@ -27,7 +27,7 @@ ; CHECK: DW_TAG_inlined_subroutine ; CHECK: DW_AT_abstract_origin {{.*}}[[ABS_FUNC:........]] "_Z4funci" ; CHECK: DW_TAG_formal_parameter -; CHECK: DW_AT_abstract_origin {{.*}}[[ABS_VAR:........]]) +; CHECK: DW_AT_abstract_origin {{.*}}[[ABS_VAR:........]] "x" ; Check the abstract definition is in the 'b.cpp' CU and doesn't contain any ; concrete information (address range or variable location) @@ -50,7 +50,7 @@ ; CHECK: DW_AT_abstract_origin {{.*}} {0x[[ABS_FUNC]]} "_Z4funci" ; CHECK: DW_TAG_formal_parameter ; CHECK: DW_AT_location -; CHECK: DW_AT_abstract_origin {{.*}} {0x[[ABS_VAR]]} +; CHECK: DW_AT_abstract_origin {{.*}} {0x[[ABS_VAR]]} "x" @i = external global i32 diff --git a/llvm/test/DebugInfo/missing-abstract-variable.ll b/llvm/test/DebugInfo/missing-abstract-variable.ll index 286088fa8b7e..104080a99777 100644 --- a/llvm/test/DebugInfo/missing-abstract-variable.ll +++ b/llvm/test/DebugInfo/missing-abstract-variable.ll @@ -41,13 +41,13 @@ ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "x" ; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[ABS_B:.*]]: DW_TAG_formal_parameter +; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "b" ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_TAG_lexical_block ; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[ABS_S:.*]]: DW_TAG_variable +; CHECK: DW_TAG_variable ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "s" @@ -61,7 +61,7 @@ ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_B]]} +; CHECK: DW_AT_abstract_origin {{.*}} "b" ; Notice 'x's local variable 's' is missing. Not necessarily a bug here, ; since it's been optimized entirely away and it should be described in ; abstract subprogram. @@ -85,14 +85,14 @@ ; fastisel succeeds). ; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_B]]} +; CHECK: DW_AT_abstract_origin {{.*}} "b" ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_TAG_lexical_block ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_TAG_variable ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_S]]} +; CHECK: DW_AT_abstract_origin {{.*}} "s" @t = external global i32 diff --git a/llvm/test/DebugInfo/namespace_inline_function_definition.ll b/llvm/test/DebugInfo/namespace_inline_function_definition.ll index d500e536d9bb..943a836902c5 100644 --- a/llvm/test/DebugInfo/namespace_inline_function_definition.ll +++ b/llvm/test/DebugInfo/namespace_inline_function_definition.ll @@ -19,7 +19,7 @@ ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN2ns4funcEi" ; CHECK-NOT: DW_TAG -; CHECK: [[ABS_PRM:0x.*]]: DW_TAG_formal_parameter +; CHECK: DW_TAG_formal_parameter ; CHECK: NULL ; CHECK-NOT: NULL ; CHECK: DW_TAG_subprogram @@ -27,7 +27,7 @@ ; CHECK: DW_AT_abstract_origin {{.*}} "_ZN2ns4funcEi" ; CHECK-NOT: DW_TAG ; CHECK: DW_TAG_formal_parameter -; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_PRM]]} +; CHECK: DW_AT_abstract_origin {{.*}} "i" ; CHECK: NULL ; CHECK: NULL ; CHECK: NULL