mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Refactor loop for better readability.
Excellent suggestion from Ben Kramer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149417 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c73f42b540
commit
0c3cfefca6
@ -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…
x
Reference in New Issue
Block a user