diff options
author | Dan Gohman <gohman@apple.com> | 2010-07-07 14:33:51 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-07-07 14:33:51 +0000 |
commit | 88c547ede957e7f9325812ccb4db5eb478705f5c (patch) | |
tree | 1ba3f430672355a9454e29c929eac9de86c40010 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 5b0a8a863f9ff540091e8c8333d497f715f5bf6a (diff) | |
download | bcm5719-llvm-88c547ede957e7f9325812ccb4db5eb478705f5c.tar.gz bcm5719-llvm-88c547ede957e7f9325812ccb4db5eb478705f5c.zip |
Add a getFirstNonPHI utility function.
llvm-svn: 107778
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index dee478671f6..a27ee479433 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -139,6 +139,13 @@ void ilist_traits<MachineInstr>::deleteNode(MachineInstr* MI) { Parent->getParent()->DeleteMachineInstr(MI); } +MachineBasicBlock::iterator MachineBasicBlock::getFirstNonPHI() { + iterator I = begin(); + while (I != end() && I->isPHI()) + ++I; + return I; +} + MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator() { iterator I = end(); while (I != begin() && (--I)->getDesc().isTerminator()) |