mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 16:36:40 +00:00
Do not bother to emit debug info for nameless global variable.
llvm-svn: 86259
This commit is contained in:
parent
4daaf9d3f4
commit
0d1f6a9d0e
@ -366,6 +366,9 @@ bool DIGlobalVariable::Verify() const {
|
||||
if (isNull())
|
||||
return false;
|
||||
|
||||
if (!getDisplayName())
|
||||
return false;
|
||||
|
||||
if (getContext().isNull())
|
||||
return false;
|
||||
|
||||
|
@ -1098,8 +1098,8 @@ DIE *DwarfDebug::ConstructEnumTypeDIE(CompileUnit *DW_Unit, DIEnumerator *ETy) {
|
||||
DIE *DwarfDebug::CreateGlobalVariableDIE(CompileUnit *DW_Unit,
|
||||
const DIGlobalVariable &GV) {
|
||||
// If the global variable was optmized out then no need to create debug info entry.
|
||||
if (!GV.getGlobal())
|
||||
return NULL;
|
||||
if (!GV.getGlobal()) return NULL;
|
||||
if (!GV.getDisplayName()) return NULL;
|
||||
|
||||
DIE *GVDie = new DIE(dwarf::DW_TAG_variable);
|
||||
AddString(GVDie, dwarf::DW_AT_name, dwarf::DW_FORM_string,
|
||||
|
8
test/DebugInfo/2009-11-06-NamelessGlobalVariable.ll
Normal file
8
test/DebugInfo/2009-11-06-NamelessGlobalVariable.ll
Normal file
@ -0,0 +1,8 @@
|
||||
; RUN: llc %s -o /dev/null
|
||||
@0 = internal constant i32 1 ; <i32*> [#uses=1]
|
||||
|
||||
!llvm.dbg.gv = !{!0}
|
||||
|
||||
!0 = metadata !{i32 458804, i32 0, metadata !1, metadata !"", metadata !"", metadata !"", metadata !1, i32 378, metadata !2, i1 true, i1 true, i32* @0}; [DW_TAG_variable ]
|
||||
!1 = metadata !{i32 458769, i32 0, i32 1, metadata !"cbdsqr.f", metadata !"/home/duncan/LLVM/dragonegg/unsolved/", metadata !"4.5.0 20091030 (experimental)", i1 true, i1 false, metadata !"", i32 0}; [DW_TAG_compile_unit ]
|
||||
!2 = metadata !{i32 458788, metadata !1, metadata !"integer(kind=4)", metadata !1, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5}; [DW_TAG_base_type ]
|
Loading…
Reference in New Issue
Block a user