MCStreamer: Simplify with newFragment. NFC

This commit is contained in:
Fangrui Song
2025-07-19 12:40:36 -07:00
parent fed6db45df
commit dc89a910aa
2 changed files with 2 additions and 2 deletions

View File

@@ -161,7 +161,7 @@ void MCMachOStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
// We have to create a new fragment if this is an atom defining symbol,
// fragments cannot span atoms.
if (cast<MCSymbolMachO>(Symbol)->isSymbolLinkerVisible())
insert(getContext().allocFragment<MCFragment>());
newFragment();
MCObjectStreamer::emitLabel(Symbol, Loc);

View File

@@ -567,7 +567,7 @@ void X86AsmBackend::emitInstructionEnd(MCObjectStreamer &OS,
// DataFragment, so that we can get the size of instructions later in
// MCAssembler::relaxBoundaryAlign. The easiest way is to insert a new empty
// DataFragment.
OS.insert(OS.getContext().allocFragment<MCFragment>());
OS.newFragment();
// Update the maximum alignment on the current section if necessary.
MCSection *Sec = OS.getCurrentSectionOnly();