diff options
author | Eric Christopher <echristo@gmail.com> | 2015-03-02 19:01:47 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2015-03-02 19:01:47 +0000 |
commit | d8cacd2e9727439ab83844e4bdcca59eaed4074c (patch) | |
tree | 52f57d9adfac9f163aef26b81cd748df63935dea /llvm | |
parent | b111ec94b3474c4eff15b19a74cd815cdb469aaa (diff) | |
download | llvm-d8cacd2e9727439ab83844e4bdcca59eaed4074c.zip llvm-d8cacd2e9727439ab83844e4bdcca59eaed4074c.tar.gz llvm-d8cacd2e9727439ab83844e4bdcca59eaed4074c.tar.bz2 |
For the dwarf expression code get the subtarget off of the current
MachineFunction.
llvm-svn: 230990
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp index d602660..1b4e4cf 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp @@ -16,6 +16,7 @@ #include "DwarfExpression.h" #include "llvm/ADT/Twine.h" #include "llvm/CodeGen/AsmPrinter.h" +#include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/IR/DataLayout.h" #include "llvm/MC/MCAsmInfo.h" @@ -191,7 +192,7 @@ void AsmPrinter::EmitSectionOffset(const MCSymbol *Label, /// EmitDwarfRegOp - Emit dwarf register operation. void AsmPrinter::EmitDwarfRegOp(ByteStreamer &Streamer, const MachineLocation &MLoc) const { - DebugLocDwarfExpression Expr(*TM.getSubtargetImpl()->getRegisterInfo(), + DebugLocDwarfExpression Expr(*MF->getSubtarget().getRegisterInfo(), getDwarfDebug()->getDwarfVersion(), Streamer); const MCRegisterInfo *MRI = MMI->getContext().getRegisterInfo(); int Reg = MRI->getDwarfRegNum(MLoc.getReg(), false); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 56e8f11..ce394a8 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -17,6 +17,7 @@ #include "DwarfDebug.h" #include "DwarfExpression.h" #include "llvm/ADT/APFloat.h" +#include "llvm/CodeGen/MachineFunction.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DIBuilder.h" #include "llvm/IR/DataLayout.h" @@ -43,11 +44,11 @@ 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) {} +DIEDwarfExpression::DIEDwarfExpression(const AsmPrinter &AP, DwarfUnit &DU, + DIELoc &DIE) + : DwarfExpression(*AP.MF->getSubtarget().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); |