summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-03-16 02:01:51 +0000
committerBill Wendling <isanbard@gmail.com>2010-03-16 02:01:51 +0000
commite03ecd01aa0b5a9c1c62086f6d376f7b1fee892f (patch)
tree729f69c0c112f1bf4ec505b8f7f342dfe1782d24
parent31d7f0d96a511ab097b1f5c922f78043b994b7fd (diff)
downloadbcm5719-llvm-e03ecd01aa0b5a9c1c62086f6d376f7b1fee892f.tar.gz
bcm5719-llvm-e03ecd01aa0b5a9c1c62086f6d376f7b1fee892f.zip
Use getFirstTerminator().
llvm-svn: 98604
-rw-r--r--llvm/lib/CodeGen/RegAllocLocal.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLocal.cpp b/llvm/lib/CodeGen/RegAllocLocal.cpp
index d61c3ff2cb5..194fc14848b 100644
--- a/llvm/lib/CodeGen/RegAllocLocal.cpp
+++ b/llvm/lib/CodeGen/RegAllocLocal.cpp
@@ -671,9 +671,10 @@ void RALocal::ComputeLocalLiveness(MachineBasicBlock& MBB) {
// Live-out (of the function) registers contain return values of the function,
// so we need to make sure they are alive at return time.
- bool BBEndsInReturn = !MBB.empty() && MBB.back().getDesc().isReturn();
- if (BBEndsInReturn) {
- MachineInstr* Ret = &MBB.back();
+ MachineBasicBlock::iterator Ret = MBB.getFirstTerminator();
+ bool BBEndsInReturn = (Ret != MBB.end() && Ret->getDesc().isReturn());
+
+ if (BBEndsInReturn)
for (MachineRegisterInfo::liveout_iterator
I = MF->getRegInfo().liveout_begin(),
E = MF->getRegInfo().liveout_end(); I != E; ++I)
@@ -681,7 +682,6 @@ void RALocal::ComputeLocalLiveness(MachineBasicBlock& MBB) {
Ret->addOperand(MachineOperand::CreateReg(*I, false, true));
LastUseDef[*I] = std::make_pair(Ret, Ret->getNumOperands()-1);
}
- }
// Finally, loop over the final use/def of each reg
// in the block and determine if it is dead.
OpenPOWER on IntegriCloud