Fix check. PHI nodes must be handled specially, of course.

llvm-svn: 10842
This commit is contained in:
Chris Lattner 2004-01-14 05:42:52 +00:00
parent ec5089a223
commit 02062823f7
1 changed files with 5 additions and 4 deletions

View File

@ -507,14 +507,15 @@ void Verifier::visitInstruction(Instruction &I) {
else if (Instruction *Op = dyn_cast<Instruction>(I.getOperand(i))) {
BasicBlock *OpBlock = Op->getParent();
// Invoke results are only usable in the normal destination, not in the
// exceptional destination.
if (InvokeInst *II = dyn_cast<InvokeInst>(Op))
OpBlock = II->getNormalDest();
// Check that a definition dominates all of its uses.
//
if (!isa<PHINode>(I)) {
// Invoke results are only usable in the normal destination, not in the
// exceptional destination.
if (InvokeInst *II = dyn_cast<InvokeInst>(Op))
OpBlock = II->getNormalDest();
// Definition must dominate use unless use is unreachable!
Assert2(DS->dominates(OpBlock, BB) ||
!DS->dominates(&BB->getParent()->getEntryBlock(), BB),