summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-03-02 22:02:33 +0000
committerAdrian Prantl <aprantl@apple.com>2015-03-02 22:02:33 +0000
commit92da14b24402ece7602f4ee5d283e8baad7959c5 (patch)
tree0b7cc3d94029975c102a4f511e96149b45e46f53 /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
parent446a0d1329b7621f41d229c7108962d7b554db37 (diff)
downloadbcm5719-llvm-92da14b24402ece7602f4ee5d283e8baad7959c5.tar.gz
bcm5719-llvm-92da14b24402ece7602f4ee5d283e8baad7959c5.zip
Refactor DebugLocDWARFExpression so it doesn't require access to the
TargetRegisterInfo. DebugLocEntry now holds a buffer with the raw bytes of the pre-calculated DWARF expression. Ought to be NFC, but it does slightly alter the output format of the textual assembly. This reapplies 230930 without the assertion in DebugLocEntry::finalize() because not all Machine registers can be lowered into DWARF register numbers and floating point constants cannot be expressed. llvm-svn: 231023
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index b0c7d48140f..56e8f11c16a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -43,6 +43,12 @@ GenerateDwarfTypeUnits("generate-type-units", cl::Hidden,
cl::desc("Generate DWARF4 type units."),
cl::init(false));
+DIEDwarfExpression::DIEDwarfExpression(const AsmPrinter &AP,
+ DwarfUnit &DU, DIELoc &DIE)
+ : DwarfExpression(*AP.TM.getSubtargetImpl()->getRegisterInfo(),
+ AP.getDwarfDebug()->getDwarfVersion()),
+ AP(AP), DU(DU), DIE(DIE) {}
+
void DIEDwarfExpression::EmitOp(uint8_t Op, const char* Comment) {
DU.addUInt(DIE, dwarf::DW_FORM_data1, Op);
}
@@ -53,7 +59,7 @@ void DIEDwarfExpression::EmitUnsigned(unsigned Value) {
DU.addUInt(DIE, dwarf::DW_FORM_udata, Value);
}
bool DIEDwarfExpression::isFrameRegister(unsigned MachineReg) {
- return MachineReg == getTRI()->getFrameRegister(*AP.MF);
+ return MachineReg == TRI.getFrameRegister(*AP.MF);
}
OpenPOWER on IntegriCloud