Skip to content

Commit 4c79fac

Browse files
authored
[BOLT] Remove workaround for flushPendingLabels
The code emits an empty MCDataFragment to ensure that the labels are attached to `SplitSection`. The workaround, due to the removed `flushPendingLabels` mechanism (see 7500646), is now unneeded. Pull Request: #97632
1 parent 2ef5b82 commit 4c79fac

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

bolt/lib/Core/BinaryContext.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,16 +2403,8 @@ BinaryContext::calculateEmittedSize(BinaryFunction &BF, bool FixBranches) {
24032403
Streamer->emitLabel(SplitStartLabel);
24042404
emitFunctionBody(*Streamer, BF, FF, /*EmitCodeOnly=*/true);
24052405
Streamer->emitLabel(SplitEndLabel);
2406-
// To avoid calling MCObjectStreamer::flushPendingLabels() which is
2407-
// private
2408-
Streamer->emitBytes(StringRef(""));
2409-
Streamer->switchSection(Section);
24102406
}
24112407

2412-
// To avoid calling MCObjectStreamer::flushPendingLabels() which is private or
2413-
// MCStreamer::Finish(), which does more than we want
2414-
Streamer->emitBytes(StringRef(""));
2415-
24162408
MCAssembler &Assembler =
24172409
static_cast<MCObjectStreamer *>(Streamer.get())->getAssembler();
24182410
Assembler.layout();

0 commit comments

Comments
 (0)