diff --git a/llvm/include/llvm/MC/MCStreamer.h b/llvm/include/llvm/MC/MCStreamer.h index fa8e5c6fe81057..1d3057a140d8a1 100644 --- a/llvm/include/llvm/MC/MCStreamer.h +++ b/llvm/include/llvm/MC/MCStreamer.h @@ -439,12 +439,6 @@ class MCStreamer { MCSymbol *endSection(MCSection *Section); - /// Sets the symbol's section. - /// - /// Each emitted symbol will be tracked in the ordering table, - /// so we can sort on them later. - void assignFragment(MCSymbol *Symbol, MCFragment *Fragment); - /// Returns the mnemonic for \p MI, if the streamer has access to a /// instruction printer and returns an empty string otherwise. virtual StringRef getMnemonic(MCInst &MI) { return ""; } diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index df5cedb27b8f64..0050923f3cd9da 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -1080,7 +1080,7 @@ void MCAsmStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size, Align ByteAlignment, SMLoc Loc) { if (Symbol) - assignFragment(Symbol, &Section->getDummyFragment()); + Symbol->setFragment(&Section->getDummyFragment()); // Note: a .zerofill directive does not switch sections. OS << ".zerofill "; @@ -1106,9 +1106,8 @@ void MCAsmStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol, // e.g. _a. void MCAsmStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, Align ByteAlignment) { - assignFragment(Symbol, &Section->getDummyFragment()); + Symbol->setFragment(&Section->getDummyFragment()); - assert(Symbol && "Symbol shouldn't be NULL!"); // Instead of using the Section we'll just use the shortcut. assert(Section->getVariant() == MCSection::SV_MachO && diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp index 470c673a897d8b..a3f67941c10157 100644 --- a/llvm/lib/MC/MCStreamer.cpp +++ b/llvm/lib/MC/MCStreamer.cpp @@ -411,11 +411,6 @@ void MCStreamer::initSections(bool NoExecStack, const MCSubtargetInfo &STI) { switchSection(getContext().getObjectFileInfo()->getTextSection()); } -void MCStreamer::assignFragment(MCSymbol *Symbol, MCFragment *Fragment) { - assert(Fragment); - Symbol->setFragment(Fragment); -} - void MCStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) { Symbol->redefineIfPossible(); diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFStreamer.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFStreamer.cpp index 1eaa57e162607d..53eb3610535f8f 100644 --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFStreamer.cpp +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFStreamer.cpp @@ -76,7 +76,7 @@ void PPCELFStreamer::emitPrefixedInstruction(const MCInst &Inst, // label to the top of the fragment containing the aligned instruction that // was just added. if (InstLine == LabelLine) { - assignFragment(LastLabel, InstructionFragment); + LastLabel->setFragment(InstructionFragment); LastLabel->setOffset(0); } }