diff options
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCBranchSelector.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCBranchSelector.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp b/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp index 8e90c1c04f4..4d63c5b5703 100644 --- a/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp +++ b/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp @@ -107,10 +107,9 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) { } unsigned BlockSize = 0; - for (MachineBasicBlock::iterator MBBI = MBB->begin(), EE = MBB->end(); - MBBI != EE; ++MBBI) - BlockSize += TII->GetInstSizeInBytes(MBBI); - + for (MachineInstr &MI : *MBB) + BlockSize += TII->GetInstSizeInBytes(MI); + BlockSizes[MBB->getNumber()] = BlockSize; FuncSize += BlockSize; } @@ -156,7 +155,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) { Dest = I->getOperand(0).getMBB(); if (!Dest) { - MBBStartOffset += TII->GetInstSizeInBytes(I); + MBBStartOffset += TII->GetInstSizeInBytes(*I); continue; } |