mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-17 00:27:31 +00:00
Refactor loop for better readability.
Excellent suggestion from Ben Kramer. llvm-svn: 149417
This commit is contained in:
parent
5a7c34d3ef
commit
2f211187f7
@ -829,12 +829,11 @@ unsigned ARMConstantIslands::GetOffsetOf(MachineInstr *MI) const {
|
||||
unsigned Offset = BBInfo[MBB->getNumber()].Offset;
|
||||
|
||||
// Sum instructions before MI in MBB.
|
||||
for (MachineBasicBlock::iterator I = MBB->begin(); ; ++I) {
|
||||
for (MachineBasicBlock::iterator I = MBB->begin(); &*I != MI; ++I) {
|
||||
assert(I != MBB->end() && "Didn't find MI in its own basic block?");
|
||||
if (&*I == MI) return Offset;
|
||||
Offset += TII->GetInstSizeInBytes(I);
|
||||
}
|
||||
// Unreachable.
|
||||
return Offset;
|
||||
}
|
||||
|
||||
/// CompareMBBNumbers - Little predicate function to sort the WaterList by MBB
|
||||
|
Loading…
Reference in New Issue
Block a user