DebugInfo: Assert dbg.declare/value insts are valid
[oota-llvm.git] / lib / CodeGen / SelectionDAG / FastISel.cpp
index 5ffb826956e83394c26035bce1dbfaca687ecdb9..dafbc63dbd03192c4d55446c34e044bae4f017d8 100644 (file)
@@ -1088,8 +1088,8 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) {
   }
   case Intrinsic::dbg_declare: {
     const DbgDeclareInst *DI = cast<DbgDeclareInst>(II);
-    DIVariable DIVar = DI->getVariable();
-    if (!DIVar || !FuncInfo.MF->getMMI().hasDebugInfo()) {
+    assert(DI->getVariable() && "Missing variable");
+    if (!FuncInfo.MF->getMMI().hasDebugInfo()) {
       DEBUG(dbgs() << "Dropping debug info for " << *DI << "\n");
       return true;
     }