CodeGen: Stop using DIDescriptor::is*() and auto-casting
[oota-llvm.git] / lib / CodeGen / LiveDebugVariables.cpp
index 69869fd616a9dc656f6033be267530fb35f7f091..cf02e31240fe95d86184cbd44eecb9e5510c3ad1 100644 (file)
@@ -358,7 +358,7 @@ public:
 } // namespace
 
 void UserValue::print(raw_ostream &OS, const TargetRegisterInfo *TRI) {
-  DIVariable DV(Variable);
+  DIVariable DV = cast<MDLocalVariable>(Variable);
   OS << "!\"";
   DV.printExtendedName(OS);
   OS << "\"\t";
@@ -944,7 +944,8 @@ void UserValue::insertDebugValue(MachineBasicBlock *MBB, SlotIndex Idx,
   MachineOperand &Loc = locations[LocNo];
   ++NumInsertedDebugValues;
 
-  assert(DIVariable(Variable)->isValidLocationForIntrinsic(getDebugLoc()) &&
+  assert(cast<MDLocalVariable>(Variable)
+             ->isValidLocationForIntrinsic(getDebugLoc()) &&
          "Expected inlined-at fields to agree");
   if (Loc.isReg())
     BuildMI(*MBB, I, getDebugLoc(), TII.get(TargetOpcode::DBG_VALUE),