Skip to content

Commit

Permalink
[MC] Remove the last MCFragment::getPrevNode use. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jun 10, 2024
1 parent 13896b6 commit bb4ee27
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions llvm/lib/MC/MCAssembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1094,9 +1094,11 @@ bool MCAssembler::relaxBoundaryAlign(MCAsmLayout &Layout,

uint64_t AlignedOffset = Layout.getFragmentOffset(&BF);
uint64_t AlignedSize = 0;
for (const MCFragment *F = BF.getLastFragment(); F != &BF;
F = F->getPrevNode())
for (const MCFragment *F = BF.getNextNode();; F = F->getNextNode()) {
AlignedSize += computeFragmentSize(Layout, *F);
if (F == BF.getLastFragment())
break;
}

Align BoundaryAlignment = BF.getAlignment();
uint64_t NewSize = needPadding(AlignedOffset, AlignedSize, BoundaryAlignment)
Expand Down

0 comments on commit bb4ee27

Please sign in to comment.