summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-11-27 23:53:52 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-11-27 23:53:52 +0000
commitbc7e0d43bfa15046a9614b5a6298c12a091c898a (patch)
treed4f77d751dc00c57efd703aab1c66e3464803bb4 /llvm/lib
parentf9a0ec4fc485428c3d8dd15f237fb0313e317b60 (diff)
downloadbcm5719-llvm-bc7e0d43bfa15046a9614b5a6298c12a091c898a.tar.gz
bcm5719-llvm-bc7e0d43bfa15046a9614b5a6298c12a091c898a.zip
DebugInfo: Do not include variables only referenced by templates in aranges.
ARanges included even extern variables referenced by pointer non-type template parameters even though that variable isn't part of this compilation unit. llvm-svn: 195895
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 893df15e50b..e6b3331cf62 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -292,7 +292,6 @@ void CompileUnit::addLabelAddress(DIE *Die, dwarf::Attribute Attribute,
/// form given and an op of either DW_FORM_addr or DW_FORM_GNU_addr_index.
///
void CompileUnit::addOpAddress(DIEBlock *Die, const MCSymbol *Sym) {
- DD->addArangeLabel(SymbolCU(this, Sym));
if (!DD->useSplitDwarf()) {
addUInt(Die, dwarf::DW_FORM_data1, dwarf::DW_OP_addr);
addLabel(Die, dwarf::DW_FORM_udata, Sym);
@@ -1618,8 +1617,10 @@ void CompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
}
// 3) followed by a custom OP to make the debugger do a TLS lookup.
addUInt(Block, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_push_tls_address);
- } else
+ } else {
+ DD->addArangeLabel(SymbolCU(this, Sym));
addOpAddress(Block, Sym);
+ }
// Do not create specification DIE if context is either compile unit
// or a subprogram.
if (GVContext && GV.isDefinition() && !GVContext.isCompileUnit() &&
@@ -1656,7 +1657,9 @@ void CompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
// GV is a merged global.
DIEBlock *Block = new (DIEValueAllocator) DIEBlock();
Value *Ptr = CE->getOperand(0);
- addOpAddress(Block, Asm->getSymbol(cast<GlobalValue>(Ptr)));
+ MCSymbol *Sym = Asm->getSymbol(cast<GlobalValue>(Ptr));
+ DD->addArangeLabel(SymbolCU(this, Sym));
+ addOpAddress(Block, Sym);
addUInt(Block, dwarf::DW_FORM_data1, dwarf::DW_OP_constu);
SmallVector<Value *, 3> Idx(CE->op_begin() + 1, CE->op_end());
addUInt(Block, dwarf::DW_FORM_udata,
OpenPOWER on IntegriCloud