summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-04-16 18:01:08 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-04-16 18:01:08 +0000
commit8dc8a8d8af69cdb04f84377957d7b6b5674f9bb9 (patch)
tree60909d6f3398db217b5b03b8fb8b5c9f47bc48b3 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parent4675c4e7e72480d5f75bd2c667ff20c203d9aa82 (diff)
downloadbcm5719-llvm-8dc8a8d8af69cdb04f84377957d7b6b5674f9bb9.tar.gz
bcm5719-llvm-8dc8a8d8af69cdb04f84377957d7b6b5674f9bb9.zip
Empty basic block should have an empty range.
llvm-svn: 49800
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index 9f72035bc90..d8ca141c669 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -108,7 +108,9 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
}
// Set the MBB2IdxMap entry for this MBB.
- MBB2IdxMap[MBB->getNumber()] = std::make_pair(StartIdx, MIIndex - 1);
+ MBB2IdxMap[MBB->getNumber()] = (StartIdx == MIIndex)
+ ? std::make_pair(StartIdx, StartIdx) // Empty MBB
+ : std::make_pair(StartIdx, MIIndex - 1);
Idx2MBBMap.push_back(std::make_pair(StartIdx, MBB));
}
std::sort(Idx2MBBMap.begin(), Idx2MBBMap.end(), Idx2MBBCompare());
OpenPOWER on IntegriCloud