Skip to content

Commit

Permalink
[MC] Remove assignFragment
Browse files Browse the repository at this point in the history
Follow-up to f6fc503 ("[MC] Remove MCStreamer::SymbolOrdering").
  • Loading branch information
MaskRay committed Jun 30, 2024
1 parent f6fc503 commit dd64e4f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
6 changes: 0 additions & 6 deletions llvm/include/llvm/MC/MCStreamer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""; }
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/MC/MCAsmStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ";
Expand All @@ -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 &&
Expand Down
5 changes: 0 additions & 5 deletions llvm/lib/MC/MCStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit dd64e4f

Please sign in to comment.