[llvm] r188649 - DebugInfo: don't emit zero-length names for parameters
David Blaikie
dblaikie at gmail.com
Sun Aug 18 20:34:03 PDT 2013
Author: dblaikie
Date: Sun Aug 18 22:34:03 2013
New Revision: 188649
URL: http://llvm.org/viewvc/llvm-project?rev=188649&view=rev
Log:
DebugInfo: don't emit zero-length names for parameters
We check this in many/all other cases, just missed this one it seems.
Perhaps it'd be worth unifying this so we never emit zero-length
DW_AT_names.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/trunk/test/DebugInfo/X86/DW_AT_object_pointer.ll
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=188649&r1=188648&r2=188649&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Sun Aug 18 22:34:03 2013
@@ -1574,7 +1574,8 @@ DIE *CompileUnit::constructVariableDIE(D
addDIEEntry(VariableDie, dwarf::DW_AT_abstract_origin,
dwarf::DW_FORM_ref4, AbsDIE);
else {
- addString(VariableDie, dwarf::DW_AT_name, Name);
+ if (!Name.empty())
+ addString(VariableDie, dwarf::DW_AT_name, Name);
addSourceLine(VariableDie, DV->getVariable());
addType(VariableDie, DV->getType());
}
Modified: llvm/trunk/test/DebugInfo/X86/DW_AT_object_pointer.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/DW_AT_object_pointer.ll?rev=188649&r1=188648&r2=188649&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/DW_AT_object_pointer.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/DW_AT_object_pointer.ll Sun Aug 18 22:34:03 2013
@@ -2,10 +2,12 @@
; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
; CHECK: DW_TAG_formal_parameter [
+; CHECK-NOT: ""
+; CHECK: DW_TAG
; CHECK: DW_TAG_class_type
-; CHECK: DW_AT_object_pointer [DW_FORM_ref4] (cu + 0x00fd => {0x000000fd})
-; CHECK: 0x000000fd: DW_TAG_formal_parameter [13]
-; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "this")
+; CHECK: DW_AT_object_pointer [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[PARAM:0x[0-9a-f]*]]})
+; CHECK: [[PARAM]]: DW_TAG_formal_parameter [13]
+; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "this")
%class.A = type { i32 }
More information about the llvm-commits
mailing list