File tree Expand file tree Collapse file tree 4 files changed +4
-19
lines changed Expand file tree Collapse file tree 4 files changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -198,18 +198,6 @@ class MCSection {
198
198
iterator end () const { return {}; }
199
199
bool empty () const { return !CurFragList->Head ; }
200
200
201
- void addFragment (MCFragment &F) {
202
- // The formal layout order will be finalized in MCAssembler::layout.
203
- if (CurFragList->Tail ) {
204
- CurFragList->Tail ->Next = &F;
205
- F.setLayoutOrder (CurFragList->Tail ->getLayoutOrder () + 1 );
206
- } else {
207
- CurFragList->Head = &F;
208
- assert (F.getLayoutOrder () == 0 );
209
- }
210
- CurFragList->Tail = &F;
211
- }
212
-
213
201
void dump () const ;
214
202
215
203
virtual void printSwitchToSection (const MCAsmInfo &MAI, const Triple &T,
Original file line number Diff line number Diff line change @@ -201,7 +201,8 @@ MCDataFragment *MCContext::allocInitialFragment(MCSection &Sec) {
201
201
assert (!Sec.curFragList ()->Head );
202
202
auto *F = allocFragment<MCDataFragment>();
203
203
F->setParent (&Sec);
204
- Sec.addFragment (*F);
204
+ Sec.curFragList ()->Head = F;
205
+ Sec.curFragList ()->Tail = F;
205
206
return F;
206
207
}
207
208
Original file line number Diff line number Diff line change @@ -596,9 +596,7 @@ void MCMachOStreamer::createAddrSigSection() {
596
596
MCSection *AddrSigSection =
597
597
Asm.getContext ().getObjectFileInfo ()->getAddrSigSection ();
598
598
changeSection (AddrSigSection);
599
- auto *Frag = getContext ().allocFragment <MCDataFragment>();
600
- Frag->setParent (AddrSigSection);
601
- AddrSigSection->addFragment (*Frag);
599
+ auto *Frag = cast<MCDataFragment>(AddrSigSection->curFragList ()->Head );
602
600
// We will generate a series of pointer-sized symbol relocations at offset
603
601
// 0x0. Set the section size to be large enough to contain a single pointer
604
602
// (instead of emitting a zero-sized section) so these relocations are
Original file line number Diff line number Diff line change @@ -205,9 +205,7 @@ void MCWinCOFFStreamer::emitCOFFSafeSEH(MCSymbol const *Symbol) {
205
205
changeSection (SXData);
206
206
SXData->ensureMinAlignment (Align (4 ));
207
207
208
- auto *F = getContext ().allocFragment <MCSymbolIdFragment>(Symbol);
209
- F->setParent (SXData);
210
- SXData->addFragment (*F);
208
+ insert (getContext ().allocFragment <MCSymbolIdFragment>(Symbol));
211
209
getAssembler ().registerSymbol (*Symbol);
212
210
CSymbol->setIsSafeSEH ();
213
211
You can’t perform that action at this time.
0 commit comments