For the dwarf expression code get the subtarget off of the current
authorEric Christopher <echristo@gmail.com>
Mon, 2 Mar 2015 19:01:47 +0000 (19:01 +0000)
committerEric Christopher <echristo@gmail.com>
Mon, 2 Mar 2015 19:01:47 +0000 (19:01 +0000)
MachineFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230990 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.cpp

index d602660b3bd8cf7c80231e3ac24cf786787401a1..1b4e4cfc4f8133e4a4929f7824094293e4fe6ad8 100644 (file)
@@ -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);
index 56e8f11c16a2e6b3126958f26643e8079d009166..ce394a85f028a5b8c227e79012d95ae30f0ae712 100644 (file)
@@ -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);