Empty basic block should have an empty range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49800 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-04-16 18:01:08 +00:00
parent 48325f4b08
commit 76249966ee

View File

@ -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());