mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places to
use it instead of duplicating its functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51499 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -143,15 +143,14 @@ const TerminatorInst *BasicBlock::getTerminator() const {
|
||||
return dyn_cast<TerminatorInst>(&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<PHINode>(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<PHINode>(i)) ++i;
|
||||
return &*i;
|
||||
}
|
||||
|
||||
void BasicBlock::dropAllReferences() {
|
||||
|
Reference in New Issue
Block a user