- // Update internal data structures to account for the newly inserted MBB.
- // This is almost the same as UpdateForInsertedWaterBlock, except that
- // the Water goes after OrigBB, not NewBB.
- MF.RenumberBlocks(NewBB);
-
- // Insert a size into BBSizes to align it properly with the (newly
- // renumbered) block numbers.
- BBSizes.insert(BBSizes.begin()+NewBB->getNumber(), 0);
-
- // Likewise for BBOffsets.
- BBOffsets.insert(BBOffsets.begin()+NewBB->getNumber(), 0);
-
- // Figure out how large the first NewMBB is.
- unsigned NewBBSize = 0;
- for (MachineBasicBlock::iterator I = NewBB->begin(), E = NewBB->end();
- I != E; ++I)
- NewBBSize += TII->GetInstSizeInBytes(I);
-
- unsigned NewBBI = NewBB->getNumber();
- unsigned JTBBI = JTBB->getNumber();
- // Set the size of NewBB in BBSizes.
- BBSizes[NewBBI] = NewBBSize;
-
- // ...and adjust BBOffsets for NewBB accordingly.
- BBOffsets[NewBBI] = BBOffsets[JTBBI] + BBSizes[JTBBI];
-
- // All BBOffsets following these blocks must be modified.
- AdjustBBOffsetsAfter(NewBB, 4);
-