diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-14 02:12:54 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-14 02:12:54 +0000 |
commit | c38102889f56cc628a2d8f98ae34ec2d8a92c0d2 (patch) | |
tree | 7d6174443de60da640a0b10ca66df5f53869dcf1 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 21a64979f143b0f63374148b637986c23cc44b13 (diff) | |
download | llvm-c38102889f56cc628a2d8f98ae34ec2d8a92c0d2.zip llvm-c38102889f56cc628a2d8f98ae34ec2d8a92c0d2.tar.gz llvm-c38102889f56cc628a2d8f98ae34ec2d8a92c0d2.tar.bz2 |
Revert r123419. It still breaks llvm-gcc-i386-linux-selfhost.
llvm-svn: 123423
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 3696387..ad1ab28 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -155,22 +155,11 @@ MachineBasicBlock::SkipPHIsAndLabels(MachineBasicBlock::iterator I) { } MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator() { - iterator B = begin(), I = end(); - iterator Term = I; - while (I != B) { - --I; - // Ignore any debug values after the first terminator. - if (I->isDebugValue()) - continue; - // Stop once we see a non-debug non-terminator. - if (!I->getDesc().isTerminator()) - break; - // Earliest terminator so far. - Term = I; - } - // Return the first terminator, or end(). - // Everything after Term is terminators and debug values. - return Term; + iterator I = end(); + while (I != begin() && (--I)->getDesc().isTerminator()) + ; /*noop */ + if (I != end() && !I->getDesc().isTerminator()) ++I; + return I; } MachineBasicBlock::iterator MachineBasicBlock::getLastNonDebugInstr() { |