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 with a relaxed assertion in DebugLocEntry::finalize()
that allows for empty DWARF expressions for constant FP values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230975 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl
2015-03-02 17:21:06 +00:00
parent 2271bfcd9c
commit 9680c9c1a8
11 changed files with 170 additions and 153 deletions

View File

@@ -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);
}