@@ -84,7 +84,7 @@ void MCObjectStreamer::ensureHeadroom(size_t Headroom) {
8484 addFragment (F);
8585}
8686
87- void MCObjectStreamer::insert (MCFragment *Frag) {
87+ void MCObjectStreamer::addSpecialFragment (MCFragment *Frag) {
8888 assert (Frag->getKind () != MCFragment::FT_Data &&
8989 " F should have a variable-size tail" );
9090 // Frag is not connected to FragSpace. Before modifying CurFrag with
@@ -173,6 +173,7 @@ void MCObjectStreamer::reset() {
173173 EmitDebugFrame = false ;
174174 FragStorage.clear ();
175175 FragSpace = 0 ;
176+ SpecialFragAllocator.Reset ();
176177 MCStreamer::reset ();
177178}
178179
@@ -649,7 +650,7 @@ void MCObjectStreamer::emitCodeAlignment(Align Alignment,
649650void MCObjectStreamer::emitValueToOffset (const MCExpr *Offset,
650651 unsigned char Value,
651652 SMLoc Loc) {
652- insert ( getContext (). allocFragment <MCOrgFragment>(*Offset, Value, Loc) );
653+ newSpecialFragment <MCOrgFragment>(*Offset, Value, Loc);
653654}
654655
655656void MCObjectStreamer::emitRelocDirective (const MCExpr &Offset, StringRef Name,
@@ -681,8 +682,7 @@ void MCObjectStreamer::emitRelocDirective(const MCExpr &Offset, StringRef Name,
681682void MCObjectStreamer::emitFill (const MCExpr &NumBytes, uint64_t FillValue,
682683 SMLoc Loc) {
683684 assert (getCurrentSectionOnly () && " need a section" );
684- insert (
685- getContext ().allocFragment <MCFillFragment>(FillValue, 1 , NumBytes, Loc));
685+ newSpecialFragment<MCFillFragment>(FillValue, 1 , NumBytes, Loc);
686686}
687687
688688void MCObjectStreamer::emitFill (const MCExpr &NumValues, int64_t Size,
@@ -709,15 +709,13 @@ void MCObjectStreamer::emitFill(const MCExpr &NumValues, int64_t Size,
709709
710710 // Otherwise emit as fragment.
711711 assert (getCurrentSectionOnly () && " need a section" );
712- insert (
713- getContext ().allocFragment <MCFillFragment>(Expr, Size, NumValues, Loc));
712+ newSpecialFragment<MCFillFragment>(Expr, Size, NumValues, Loc);
714713}
715714
716715void MCObjectStreamer::emitNops (int64_t NumBytes, int64_t ControlledNopLength,
717716 SMLoc Loc, const MCSubtargetInfo &STI) {
718717 assert (getCurrentSectionOnly () && " need a section" );
719- insert (getContext ().allocFragment <MCNopsFragment>(
720- NumBytes, ControlledNopLength, Loc, STI));
718+ newSpecialFragment<MCNopsFragment>(NumBytes, ControlledNopLength, Loc, STI);
721719}
722720
723721void MCObjectStreamer::emitFileDirective (StringRef Filename) {
0 commit comments