Skip to content

Commit 34fb673

Browse files
committed
MCStreamer: Remove Mach-O specific functions from derived MCObjectStreamer
1 parent 715ad67 commit 34fb673

14 files changed

+3
-80
lines changed

llvm/include/llvm/MC/MCDXContainerStreamer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ class MCDXContainerStreamer : public MCObjectStreamer {
3535

3636
bool emitSymbolAttribute(MCSymbol *, MCSymbolAttr) override { return false; }
3737
void emitCommonSymbol(MCSymbol *, uint64_t, Align) override {}
38-
void emitZerofill(MCSection *, MCSymbol *Symbol = nullptr, uint64_t Size = 0,
39-
Align ByteAlignment = Align(1),
40-
SMLoc Loc = SMLoc()) override {}
4138

4239
private:
4340
void emitInstToData(const MCInst &, const MCSubtargetInfo &) override;

llvm/include/llvm/MC/MCELFStreamer.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ class MCELFStreamer : public MCObjectStreamer {
5656
void emitAssemblerFlag(MCAssemblerFlag Flag) override;
5757
void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
5858
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
59-
void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
6059
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
6160
Align ByteAlignment) override;
6261

@@ -67,11 +66,6 @@ class MCELFStreamer : public MCObjectStreamer {
6766
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
6867
Align ByteAlignment) override;
6968

70-
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
71-
uint64_t Size = 0, Align ByteAlignment = Align(1),
72-
SMLoc L = SMLoc()) override;
73-
void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
74-
Align ByteAlignment = Align(1)) override;
7569
void emitValueImpl(const MCExpr *Value, unsigned Size,
7670
SMLoc Loc = SMLoc()) override;
7771

llvm/include/llvm/MC/MCGOFFStreamer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class MCGOFFStreamer : public MCObjectStreamer {
3030
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
3131
Align ByteAlignment) override {}
3232
void emitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override {}
33-
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
34-
uint64_t Size = 0, Align ByteAlignment = Align(1),
35-
SMLoc Loc = SMLoc()) override {}
3633
};
3734

3835
} // end namespace llvm

llvm/include/llvm/MC/MCSPIRVStreamer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ class MCSPIRVStreamer : public MCObjectStreamer {
3535
}
3636
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
3737
Align ByteAlignment) override {}
38-
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
39-
uint64_t Size = 0, Align ByteAlignment = Align(1),
40-
SMLoc Loc = SMLoc()) override {}
4138

4239
private:
4340
void emitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override;

llvm/include/llvm/MC/MCStreamer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ class MCStreamer {
681681
/// \param ByteAlignment - The alignment of the zerofill symbol.
682682
virtual void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
683683
uint64_t Size = 0, Align ByteAlignment = Align(1),
684-
SMLoc Loc = SMLoc()) = 0;
684+
SMLoc Loc = SMLoc());
685685

686686
/// Emit a thread local bss (.tbss) symbol.
687687
///

llvm/include/llvm/MC/MCWasmStreamer.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class MCWasmStreamer : public MCObjectStreamer {
4747
void emitAssemblerFlag(MCAssemblerFlag Flag) override;
4848
void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
4949
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
50-
void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
5150
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
5251
Align ByteAlignment) override;
5352

@@ -56,12 +55,6 @@ class MCWasmStreamer : public MCObjectStreamer {
5655
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
5756
Align ByteAlignment) override;
5857

59-
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
60-
uint64_t Size = 0, Align ByteAlignment = Align(1),
61-
SMLoc Loc = SMLoc()) override;
62-
void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
63-
Align ByteAlignment = Align(1)) override;
64-
6558
void emitIdent(StringRef IdentString) override;
6659

6760
void finishImpl() override;

llvm/include/llvm/MC/MCWinCOFFStreamer.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ class MCWinCOFFStreamer : public MCObjectStreamer {
6464
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
6565
Align ByteAlignment) override;
6666
void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
67-
void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
68-
Align ByteAlignment, SMLoc Loc = SMLoc()) override;
69-
void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
70-
Align ByteAlignment) override;
7167
void emitIdent(StringRef IdentString) override;
7268
void emitWinEHHandlerData(SMLoc Loc) override;
7369
void emitCGProfileEntry(const MCSymbolRefExpr *From,

llvm/include/llvm/MC/MCXCOFFStreamer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ class MCXCOFFStreamer : public MCObjectStreamer {
2525
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
2626
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
2727
Align ByteAlignment) override;
28-
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
29-
uint64_t Size = 0, Align ByteAlignment = Align(1),
30-
SMLoc Loc = SMLoc()) override;
3128
void emitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override;
3229
void emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size,
3330
MCSymbol *CsectSym, Align Alignment) override;

llvm/lib/MC/MCELFStreamer.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -516,21 +516,6 @@ void MCELFStreamer::finishImpl() {
516516
this->MCObjectStreamer::finishImpl();
517517
}
518518

519-
void MCELFStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
520-
llvm_unreachable("ELF doesn't support this directive");
521-
}
522-
523-
void MCELFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
524-
uint64_t Size, Align ByteAlignment,
525-
SMLoc Loc) {
526-
llvm_unreachable("ELF doesn't support this directive");
527-
}
528-
529-
void MCELFStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
530-
uint64_t Size, Align ByteAlignment) {
531-
llvm_unreachable("ELF doesn't support this directive");
532-
}
533-
534519
void MCELFStreamer::setAttributeItem(unsigned Attribute, unsigned Value,
535520
bool OverwriteExisting) {
536521
// Look for existing attribute item

llvm/lib/MC/MCNullStreamer.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ namespace {
3838

3939
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
4040
Align ByteAlignment) override {}
41-
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
42-
uint64_t Size = 0, Align ByteAlignment = Align(1),
43-
SMLoc Loc = SMLoc()) override {}
4441
void beginCOFFSymbolDef(const MCSymbol *Symbol) override {}
4542
void emitCOFFSymbolStorageClass(int StorageClass) override {}
4643
void emitCOFFSymbolType(int Type) override {}

llvm/lib/MC/MCStreamer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,8 @@ void MCStreamer::emitELFSymverDirective(const MCSymbol *OriginalSym,
12621262
StringRef Name, bool KeepOriginalSym) {}
12631263
void MCStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
12641264
Align ByteAlignment) {}
1265+
void MCStreamer::emitZerofill(MCSection *, MCSymbol *, uint64_t, Align, SMLoc) {
1266+
}
12651267
void MCStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
12661268
uint64_t Size, Align ByteAlignment) {}
12671269
void MCStreamer::changeSection(MCSection *Section, uint32_t) {

llvm/lib/MC/MCWasmStreamer.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,6 @@ void MCWasmStreamer::finishImpl() {
193193
this->MCObjectStreamer::finishImpl();
194194
}
195195

196-
void MCWasmStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
197-
llvm_unreachable("Wasm doesn't support this directive");
198-
}
199-
200-
void MCWasmStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
201-
uint64_t Size, Align ByteAlignment,
202-
SMLoc Loc) {
203-
llvm_unreachable("Wasm doesn't support this directive");
204-
}
205-
206-
void MCWasmStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
207-
uint64_t Size, Align ByteAlignment) {
208-
llvm_unreachable("Wasm doesn't support this directive");
209-
}
210-
211196
MCStreamer *llvm::createWasmStreamer(MCContext &Context,
212197
std::unique_ptr<MCAsmBackend> &&MAB,
213198
std::unique_ptr<MCObjectWriter> &&OW,

llvm/lib/MC/MCWinCOFFStreamer.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -440,17 +440,6 @@ void MCWinCOFFStreamer::emitWeakReference(MCSymbol *AliasS,
440440
Symbol, MCSymbolRefExpr::VK_WEAKREF, getContext()));
441441
}
442442

443-
void MCWinCOFFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
444-
uint64_t Size, Align ByteAlignment,
445-
SMLoc Loc) {
446-
llvm_unreachable("not implemented");
447-
}
448-
449-
void MCWinCOFFStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
450-
uint64_t Size, Align ByteAlignment) {
451-
llvm_unreachable("not implemented");
452-
}
453-
454443
// TODO: Implement this if you want to emit .comment section in COFF obj files.
455444
void MCWinCOFFStreamer::emitIdent(StringRef IdentString) {
456445
llvm_unreachable("not implemented");

llvm/lib/MC/MCXCOFFStreamer.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,6 @@ void MCXCOFFStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
138138
emitZeros(Size);
139139
}
140140

141-
void MCXCOFFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
142-
uint64_t Size, Align ByteAlignment,
143-
SMLoc Loc) {
144-
report_fatal_error("Zero fill not implemented for XCOFF.");
145-
}
146-
147141
void MCXCOFFStreamer::emitInstToData(const MCInst &Inst,
148142
const MCSubtargetInfo &STI) {
149143
MCAssembler &Assembler = getAssembler();

0 commit comments

Comments
 (0)