From 02062823f76f1baec46ed4c17cb5107cac7aee44 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 14 Jan 2004 05:42:52 +0000 Subject: [PATCH] Fix check. PHI nodes must be handled specially, of course. llvm-svn: 10842 --- llvm/lib/VMCore/Verifier.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index a9bcbd5f8f27..1a66a9f9656d 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/lib/VMCore/Verifier.cpp @@ -507,14 +507,15 @@ void Verifier::visitInstruction(Instruction &I) { else if (Instruction *Op = dyn_cast(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(Op)) - OpBlock = II->getNormalDest(); // Check that a definition dominates all of its uses. // if (!isa(I)) { + // Invoke results are only usable in the normal destination, not in the + // exceptional destination. + if (InvokeInst *II = dyn_cast(Op)) + OpBlock = II->getNormalDest(); + // Definition must dominate use unless use is unreachable! Assert2(DS->dominates(OpBlock, BB) || !DS->dominates(&BB->getParent()->getEntryBlock(), BB),