diff options
author | Devang Patel <dpatel@apple.com> | 2010-08-09 21:39:24 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-08-09 21:39:24 +0000 |
commit | 2739896cdd3c987de3d7f9a41217b4b954287c8d (patch) | |
tree | b353ed867fde20ab2d487c63c4a2f35959b01644 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 84681572781ccbda4d73e75bf59d68b75c9b77f2 (diff) |
Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index c687d74589..1f4e2b73dd 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1190,7 +1190,7 @@ static StringRef getRealLinkageName(StringRef LinkageName) { DIE *DwarfDebug::createGlobalVariableDIE(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.Verify()) return NULL; if (GV.getDisplayName().empty()) return NULL; DIE *GVDie = new DIE(dwarf::DW_TAG_variable); @@ -1908,6 +1908,10 @@ void DwarfDebug::constructGlobalVariableDIE(const MDNode *N) { // Add to context owner. DIDescriptor GVContext = DI_GV.getContext(); + DIEBlock *Block = new (DIEValueAllocator) DIEBlock(); + addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_addr); + addLabel(Block, 0, dwarf::DW_FORM_udata, + Asm->Mang->getSymbol(DI_GV.getGlobal())); // Do not create specification DIE if context is either compile unit // or a subprogram. if (DI_GV.isDefinition() && !GVContext.isCompileUnit() && @@ -1917,18 +1921,10 @@ void DwarfDebug::constructGlobalVariableDIE(const MDNode *N) { DIE *VariableSpecDIE = new DIE(dwarf::DW_TAG_variable); addDIEEntry(VariableSpecDIE, dwarf::DW_AT_specification, dwarf::DW_FORM_ref4, VariableDie); - DIEBlock *Block = new (DIEValueAllocator) DIEBlock(); - addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_addr); - addLabel(Block, 0, dwarf::DW_FORM_udata, - Asm->Mang->getSymbol(DI_GV.getGlobal())); addBlock(VariableSpecDIE, dwarf::DW_AT_location, 0, Block); addUInt(VariableDie, dwarf::DW_AT_declaration, dwarf::DW_FORM_flag, 1); TheCU->addDie(VariableSpecDIE); } else { - DIEBlock *Block = new (DIEValueAllocator) DIEBlock(); - addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_addr); - addLabel(Block, 0, dwarf::DW_FORM_udata, - Asm->Mang->getSymbol(DI_GV.getGlobal())); addBlock(VariableDie, dwarf::DW_AT_location, 0, Block); } addToContextOwner(VariableDie, GVContext); |