summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-03-06 00:00:56 +0000
committerEric Christopher <echristo@gmail.com>2014-03-06 00:00:56 +0000
commitdd508382ccba8f38643d654e9a09e95a9b2c93e9 (patch)
tree60eba5cd01fd16a10629b908fe22c806f5db59d2 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent411bd590d118ba84718bc72e9c770e6b4dec3dc0 (diff)
downloadbcm5719-llvm-dd508382ccba8f38643d654e9a09e95a9b2c93e9.tar.gz
bcm5719-llvm-dd508382ccba8f38643d654e9a09e95a9b2c93e9.zip
Remove the last of the special case code for emitting attributes.
This works by moving the existing code into the DIEValue hierarchy and using the DwarfDebug pointer off of the AsmPrinter to access any global information we need. llvm-svn: 203033
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp40
1 files changed, 2 insertions, 38 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 315c09f4dab..25667a22777 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2003,44 +2003,8 @@ void DwarfDebug::emitDIE(DIE *Die) {
cast<DIEInteger>(Values[i])->getValue()));
}
- switch (Attr) {
- case dwarf::DW_AT_abstract_origin:
- case dwarf::DW_AT_type:
- case dwarf::DW_AT_friend:
- case dwarf::DW_AT_specification:
- case dwarf::DW_AT_import:
- case dwarf::DW_AT_containing_type: {
- DIEEntry *E = cast<DIEEntry>(Values[i]);
- DIE *Origin = E->getEntry();
- unsigned Addr = Origin->getOffset();
- if (Form == dwarf::DW_FORM_ref_addr) {
- assert(!useSplitDwarf() && "TODO: dwo files can't have relocations.");
- // For DW_FORM_ref_addr, output the offset from beginning of debug info
- // section. Origin->getOffset() returns the offset from start of the
- // compile unit.
- DwarfCompileUnit *CU = CUDieMap.lookup(Origin->getUnit());
- assert(CU && "CUDie should belong to a CU.");
- Addr += CU->getDebugInfoOffset();
- if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
- Asm->EmitLabelPlusOffset(CU->getSectionSym(), Addr,
- DIEEntry::getRefAddrSize(Asm));
- else
- Asm->EmitLabelOffsetDifference(CU->getSectionSym(), Addr,
- CU->getSectionSym(),
- DIEEntry::getRefAddrSize(Asm));
- } else {
- // Make sure Origin belong to the same CU.
- assert(Die->getUnit() == Origin->getUnit() &&
- "The referenced DIE should belong to the same CU in ref4");
- Asm->EmitInt32(Addr);
- }
- break;
- }
- default:
- // Emit an attribute using the defined form.
- Values[i]->EmitValue(Asm, Form);
- break;
- }
+ // Emit an attribute using the defined form.
+ Values[i]->EmitValue(Asm, Form);
}
// Emit the DIE children if any.
OpenPOWER on IntegriCloud