diff --git a/tools/llvm-diff/DifferenceEngine.cpp b/tools/llvm-diff/DifferenceEngine.cpp index 7d379ef5dc4..456560b093a 100644 --- a/tools/llvm-diff/DifferenceEngine.cpp +++ b/tools/llvm-diff/DifferenceEngine.cpp @@ -599,7 +599,7 @@ void FunctionDifferenceEngine::runBlockDiff(BasicBlock::iterator LStart, TerminatorInst *RTerm = RStart->getParent()->getTerminator(); if (isa(LTerm) && isa(RTerm)) { if (cast(LTerm)->isConditional()) return; - BasicBlock::iterator I = LTerm; + BasicBlock::iterator I = LTerm->getIterator(); if (I == LStart->getParent()->begin()) return; --I; if (!isa(*I)) return; @@ -612,7 +612,7 @@ void FunctionDifferenceEngine::runBlockDiff(BasicBlock::iterator LStart, tryUnify(LTerm->getSuccessor(0), RInvoke->getNormalDest()); } else if (isa(LTerm) && isa(RTerm)) { if (cast(RTerm)->isConditional()) return; - BasicBlock::iterator I = RTerm; + BasicBlock::iterator I = RTerm->getIterator(); if (I == RStart->getParent()->begin()) return; --I; if (!isa(*I)) return;