-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[MC] Replace fragment ilist with singly-linked lists #95077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -831,6 +831,19 @@ void MCAssembler::layout(MCAsmLayout &Layout) { | |
MCSection *Sec = Layout.getSectionOrder()[i]; | ||
Sec->setLayoutOrder(i); | ||
|
||
// Chain together fragments from all subsections. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is not in a bottleneck, I'll keep simple and avoid the condition. |
||
MCDummyFragment Dummy(Sec); | ||
MCFragment *Tail = &Dummy; | ||
for (auto &[_, List] : Sec->Subsections) { | ||
if (!List.Head) | ||
continue; | ||
Tail->Next = List.Head; | ||
Tail = List.Tail; | ||
} | ||
Sec->Subsections.clear(); | ||
Sec->Subsections.push_back({0u, {Dummy.getNext(), Tail}}); | ||
Sec->CurFragList = &Sec->Subsections[0].second; | ||
|
||
unsigned FragmentIndex = 0; | ||
for (MCFragment &Frag : *Sec) | ||
Frag.setLayoutOrder(FragmentIndex++); | ||
|
@@ -1094,7 +1107,7 @@ bool MCAssembler::relaxBoundaryAlign(MCAsmLayout &Layout, | |
|
||
uint64_t AlignedOffset = Layout.getFragmentOffset(&BF); | ||
uint64_t AlignedSize = 0; | ||
for (const MCFragment *F = BF.getNextNode();; F = F->getNextNode()) { | ||
for (const MCFragment *F = BF.getNext();; F = F->getNext()) { | ||
AlignedSize += computeFragmentSize(Layout, *F); | ||
if (F == BF.getLastFragment()) | ||
break; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This postfix increment operator does not change its own value. It does not seem to be used so far, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for noticing this unused/misleading function. I'll remove it.