X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FBasicBlock.cpp;h=64711fea0c7751861c084cb6f5dfff8e0fbc929b;hb=56867520990a4fea1353d55f71bb74a0126554e6;hp=17469d6bdb2f9b1d61f03977eddd909249568ad9;hpb=280a6e607d8eb7401749a92db624a82de47da777;p=oota-llvm.git diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp index 17469d6bdb2..64711fea0c7 100644 --- a/lib/VMCore/BasicBlock.cpp +++ b/lib/VMCore/BasicBlock.cpp @@ -143,15 +143,14 @@ const TerminatorInst *BasicBlock::getTerminator() const { return dyn_cast(&InstList.back()); } -Instruction* BasicBlock::getFirstNonPHI() -{ - BasicBlock::iterator i = begin(); - // All valid basic blocks should have a terminator, - // which is not a PHINode. If we have invalid basic - // block we'll get assert when dereferencing past-the-end - // iterator. - while (isa(i)) ++i; - return &*i; +Instruction* BasicBlock::getFirstNonPHI() { + BasicBlock::iterator i = begin(); + // All valid basic blocks should have a terminator, + // which is not a PHINode. If we have an invalid basic + // block we'll get an assertion failure when dereferencing + // a past-the-end iterator. + while (isa(i)) ++i; + return &*i; } void BasicBlock::dropAllReferences() {