Skip to content

Commit dd64e4f

Browse files
committed
[MC] Remove assignFragment
Follow-up to f6fc503 ("[MC] Remove MCStreamer::SymbolOrdering").
1 parent f6fc503 commit dd64e4f

File tree

4 files changed

+3
-15
lines changed

4 files changed

+3
-15
lines changed

llvm/include/llvm/MC/MCStreamer.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,6 @@ class MCStreamer {
439439

440440
MCSymbol *endSection(MCSection *Section);
441441

442-
/// Sets the symbol's section.
443-
///
444-
/// Each emitted symbol will be tracked in the ordering table,
445-
/// so we can sort on them later.
446-
void assignFragment(MCSymbol *Symbol, MCFragment *Fragment);
447-
448442
/// Returns the mnemonic for \p MI, if the streamer has access to a
449443
/// instruction printer and returns an empty string otherwise.
450444
virtual StringRef getMnemonic(MCInst &MI) { return ""; }

llvm/lib/MC/MCAsmStreamer.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ void MCAsmStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
10801080
uint64_t Size, Align ByteAlignment,
10811081
SMLoc Loc) {
10821082
if (Symbol)
1083-
assignFragment(Symbol, &Section->getDummyFragment());
1083+
Symbol->setFragment(&Section->getDummyFragment());
10841084

10851085
// Note: a .zerofill directive does not switch sections.
10861086
OS << ".zerofill ";
@@ -1106,9 +1106,8 @@ void MCAsmStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
11061106
// e.g. _a.
11071107
void MCAsmStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
11081108
uint64_t Size, Align ByteAlignment) {
1109-
assignFragment(Symbol, &Section->getDummyFragment());
1109+
Symbol->setFragment(&Section->getDummyFragment());
11101110

1111-
assert(Symbol && "Symbol shouldn't be NULL!");
11121111
// Instead of using the Section we'll just use the shortcut.
11131112

11141113
assert(Section->getVariant() == MCSection::SV_MachO &&

llvm/lib/MC/MCStreamer.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,6 @@ void MCStreamer::initSections(bool NoExecStack, const MCSubtargetInfo &STI) {
411411
switchSection(getContext().getObjectFileInfo()->getTextSection());
412412
}
413413

414-
void MCStreamer::assignFragment(MCSymbol *Symbol, MCFragment *Fragment) {
415-
assert(Fragment);
416-
Symbol->setFragment(Fragment);
417-
}
418-
419414
void MCStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
420415
Symbol->redefineIfPossible();
421416

llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFStreamer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void PPCELFStreamer::emitPrefixedInstruction(const MCInst &Inst,
7676
// label to the top of the fragment containing the aligned instruction that
7777
// was just added.
7878
if (InstLine == LabelLine) {
79-
assignFragment(LastLabel, InstructionFragment);
79+
LastLabel->setFragment(InstructionFragment);
8080
LastLabel->setOffset(0);
8181
}
8282
}

0 commit comments

Comments
 (0)