summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-03-17 23:58:03 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-03-17 23:58:03 +0000
commita1f86256623824ba0dadee5a607c047a8aba803d (patch)
tree874ff48c93028749a9912a6fd31520dec8b8feae /llvm/lib/CodeGen/AsmPrinter
parent64e936f41c1b733244809ee1b1f1af6ffa2513b3 (diff)
downloadbcm5719-llvm-a1f86256623824ba0dadee5a607c047a8aba803d.tar.gz
bcm5719-llvm-a1f86256623824ba0dadee5a607c047a8aba803d.zip
DebugInfo: Add ability to not emit DW_AT_vtable_elem_location for virtual functions.
A virtual index of -1u indicates that the subprogram's virtual index is unrepresentable (for example, when using the relative vtable ABI), so do not emit a DW_AT_vtable_elem_location attribute for it. Differential Revision: http://reviews.llvm.org/D18236 llvm-svn: 263765
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index d2cf8effdc2..387921cb46f 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -1218,10 +1218,12 @@ void DwarfUnit::applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie,
unsigned VK = SP->getVirtuality();
if (VK) {
addUInt(SPDie, dwarf::DW_AT_virtuality, dwarf::DW_FORM_data1, VK);
- DIELoc *Block = getDIELoc();
- addUInt(*Block, dwarf::DW_FORM_data1, dwarf::DW_OP_constu);
- addUInt(*Block, dwarf::DW_FORM_udata, SP->getVirtualIndex());
- addBlock(SPDie, dwarf::DW_AT_vtable_elem_location, Block);
+ if (SP->getVirtualIndex() != -1u) {
+ DIELoc *Block = getDIELoc();
+ addUInt(*Block, dwarf::DW_FORM_data1, dwarf::DW_OP_constu);
+ addUInt(*Block, dwarf::DW_FORM_udata, SP->getVirtualIndex());
+ addBlock(SPDie, dwarf::DW_AT_vtable_elem_location, Block);
+ }
ContainingTypeMap.insert(
std::make_pair(&SPDie, resolve(SP->getContainingType())));
}
OpenPOWER on IntegriCloud