Partially revert r214761 that asserted that all concrete debug info variables had...
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfDebug.cpp
index dc6081c3b423941bae9691f71c7e746553e175f1..c94eeb943c9e6327f4ddccad80d028d7af31846c 100644 (file)
@@ -48,6 +48,7 @@
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetOptions.h"
 #include "llvm/Target/TargetRegisterInfo.h"
+#include "llvm/Target/TargetSubtargetInfo.h"
 using namespace llvm;
 
 #define DEBUG_TYPE "dwarfdebug"
@@ -318,7 +319,7 @@ DIE &DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU,
 
   attachLowHighPC(SPCU, *SPDie, FunctionBeginSym, FunctionEndSym);
 
-  const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
+  const TargetRegisterInfo *RI = Asm->TM.getSubtargetImpl()->getRegisterInfo();
   MachineLocation Location(RI->getFrameRegister(*Asm->MF));
   SPCU.addAddress(*SPDie, dwarf::DW_AT_frame_base, Location);
 
@@ -1279,7 +1280,7 @@ buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc,
     }
     // Add this value to the list of open ranges.
     if (DIVar.isVariablePiece())
-      OpenRanges.push_back({DIVar, Value});
+      OpenRanges.push_back(std::make_pair(DIVar, Value));
 
     DEBUG(dbgs() << "Values:\n";
           for (auto Value : DebugLoc.back().getValues())
@@ -1532,7 +1533,8 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
   Asm->OutStreamer.EmitLabel(FunctionBeginSym);
 
   // Calculate history for local variables.
-  calculateDbgValueHistory(MF, Asm->TM.getRegisterInfo(), DbgValues);
+  calculateDbgValueHistory(MF, Asm->TM.getSubtargetImpl()->getRegisterInfo(),
+                           DbgValues);
 
   // Request labels for the full history.
   for (const auto &I : DbgValues) {