Sets insertion point of fake cond branch to the last phi node in the block
[oota-llvm.git] / lib / IR / Verifier.cpp
index 9198b0e1fb587f4df09dd5c64ace9e647757e0c5..37b56f8efc769aa21cf0a96a2a13b9e899948714 100644 (file)
@@ -1974,6 +1974,10 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
              "PHI nodes must have at least one entry.  If the block is dead, "
              "the PHI should be removed!",
              PN);
+      if (PN->getNumIncomingValues() != Preds.size()) {
+        dbgs() << "Problematic function: \n" << *PN->getParent()->getParent() << "\n";
+        dbgs() << "Problematic block: \n" << *PN->getParent() << "\n";
+      }
       Assert(PN->getNumIncomingValues() == Preds.size(),
              "PHINode should have one entry for each predecessor of its "
              "parent basic block!",
@@ -3354,6 +3358,9 @@ void Verifier::verifyDominatesUse(Instruction &I, unsigned i) {
   }
 
   const Use &U = I.getOperandUse(i);
+  if (!(InstsInThisBlock.count(Op) || DT.dominates(Op, U))) {
+    dbgs() << "Problematic function: \n" << *I.getParent()->getParent() << "\n";
+  }
   Assert(InstsInThisBlock.count(Op) || DT.dominates(Op, U),
          "Instruction does not dominate all uses!", Op, &I);
 }