Use the cached subtarget off of the machine function.
authorEric Christopher <echristo@gmail.com>
Fri, 13 Mar 2015 00:38:19 +0000 (00:38 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 13 Mar 2015 00:38:19 +0000 (00:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232128 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 8d14781871b640dd73eeee30f1cd6f1421ebde6d..a88f6ecff1f6863a76ba6825922b6fb7233b2fe5 100644 (file)
@@ -1517,9 +1517,9 @@ static void emitDebugLocValue(const AsmPrinter &AP,
                               const DebugLocEntry::Value &Value,
                               unsigned PieceOffsetInBits) {
   DIVariable DV = Value.getVariable();
-  DebugLocDwarfExpression DwarfExpr(
-      *AP.TM.getSubtargetImpl()->getRegisterInfo(),
-      AP.getDwarfDebug()->getDwarfVersion(), Streamer);
+  DebugLocDwarfExpression DwarfExpr(*AP.MF->getSubtarget().getRegisterInfo(),
+                                    AP.getDwarfDebug()->getDwarfVersion(),
+                                    Streamer);
   // Regular entry.
   if (Value.isInt()) {
     DIBasicType BTy(DV.getType().resolve(TypeIdentifierMap));
@@ -1570,9 +1570,9 @@ void DebugLocEntry::finalize(const AsmPrinter &AP,
       assert(Offset <= PieceOffset && "overlapping or duplicate pieces");
       if (Offset < PieceOffset) {
         // The DWARF spec seriously mandates pieces with no locations for gaps.
-        DebugLocDwarfExpression Expr(
-            *AP.TM.getSubtargetImpl()->getRegisterInfo(),
-            AP.getDwarfDebug()->getDwarfVersion(), Streamer);
+        DebugLocDwarfExpression Expr(*AP.MF->getSubtarget().getRegisterInfo(),
+                                     AP.getDwarfDebug()->getDwarfVersion(),
+                                     Streamer);
         Expr.AddOpPiece(PieceOffset-Offset, 0);
         Offset += PieceOffset-Offset;
       }