mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
MC: De-duplicate the object streamer implementations of EmitFileDirective into MCObjectStreamer. NFCI.
llvm-svn: 296912
This commit is contained in:
parent
9876c44779
commit
86ef78c460
@ -62,8 +62,6 @@ public:
|
||||
void EmitValueImpl(const MCExpr *Value, unsigned Size,
|
||||
SMLoc Loc = SMLoc()) override;
|
||||
|
||||
void EmitFileDirective(StringRef Filename) override;
|
||||
|
||||
void EmitIdent(StringRef IdentString) override;
|
||||
|
||||
void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override;
|
||||
|
@ -152,6 +152,7 @@ public:
|
||||
SMLoc Loc = SMLoc()) override;
|
||||
void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
|
||||
SMLoc Loc = SMLoc()) override;
|
||||
void EmitFileDirective(StringRef Filename) override;
|
||||
|
||||
void FinishImpl() override;
|
||||
|
||||
|
@ -62,8 +62,6 @@ public:
|
||||
void EmitValueImpl(const MCExpr *Value, unsigned Size,
|
||||
SMLoc Loc = SMLoc()) override;
|
||||
|
||||
void EmitFileDirective(StringRef Filename) override;
|
||||
|
||||
void EmitIdent(StringRef IdentString) override;
|
||||
|
||||
void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override;
|
||||
|
@ -60,7 +60,6 @@ public:
|
||||
unsigned ByteAlignment) override;
|
||||
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
|
||||
unsigned ByteAlignment) override;
|
||||
void EmitFileDirective(StringRef Filename) override;
|
||||
void EmitIdent(StringRef IdentString) override;
|
||||
void EmitWinEHHandlerData() override;
|
||||
void FinishImpl() override;
|
||||
|
@ -902,6 +902,8 @@ void ELFObjectWriter::computeSymbolTable(
|
||||
|
||||
StrTabBuilder.finalize();
|
||||
|
||||
// File symbols are emitted first and handled separately from normal symbols,
|
||||
// i.e. a non-STT_FILE symbol with the same name may appear.
|
||||
for (const std::string &Name : FileNames)
|
||||
Writer.writeSymbol(StrTabBuilder.getOffset(Name),
|
||||
ELF::STT_FILE | ELF::STB_LOCAL, 0, 0, ELF::STV_DEFAULT,
|
||||
|
@ -348,13 +348,6 @@ void MCELFStreamer::EmitValueToAlignment(unsigned ByteAlignment,
|
||||
ValueSize, MaxBytesToEmit);
|
||||
}
|
||||
|
||||
// Add a symbol for the file name of this module. They start after the
|
||||
// null symbol and don't count as normal symbol, i.e. a non-STT_FILE symbol
|
||||
// with the same name may appear.
|
||||
void MCELFStreamer::EmitFileDirective(StringRef Filename) {
|
||||
getAssembler().addFileName(Filename);
|
||||
}
|
||||
|
||||
void MCELFStreamer::EmitIdent(StringRef IdentString) {
|
||||
MCSection *Comment = getAssembler().getContext().getELFSection(
|
||||
".comment", ELF::SHT_PROGBITS, ELF::SHF_MERGE | ELF::SHF_STRINGS, 1, "");
|
||||
|
@ -99,13 +99,6 @@ public:
|
||||
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
|
||||
unsigned ByteAlignment = 0) override;
|
||||
|
||||
void EmitFileDirective(StringRef Filename) override {
|
||||
// FIXME: Just ignore the .file; it isn't important enough to fail the
|
||||
// entire assembly.
|
||||
|
||||
// report_fatal_error("unsupported directive: '.file'");
|
||||
}
|
||||
|
||||
void EmitIdent(StringRef IdentString) override {
|
||||
llvm_unreachable("macho doesn't support this directive");
|
||||
}
|
||||
|
@ -572,6 +572,10 @@ void MCObjectStreamer::emitFill(const MCExpr &NumValues, int64_t Size,
|
||||
MCStreamer::emitFill(IntNumValues, Size, Expr);
|
||||
}
|
||||
|
||||
void MCObjectStreamer::EmitFileDirective(StringRef Filename) {
|
||||
getAssembler().addFileName(Filename);
|
||||
}
|
||||
|
||||
void MCObjectStreamer::FinishImpl() {
|
||||
// If we are generating dwarf for assembly source files dump out the sections.
|
||||
if (getContext().getGenDwarfForAssembly())
|
||||
|
@ -142,13 +142,6 @@ void MCWasmStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
|
||||
MaxBytesToEmit);
|
||||
}
|
||||
|
||||
// Add a symbol for the file name of this module. They start after the
|
||||
// null symbol and don't count as normal symbol, i.e. a non-STT_FILE symbol
|
||||
// with the same name may appear.
|
||||
void MCWasmStreamer::EmitFileDirective(StringRef Filename) {
|
||||
getAssembler().addFileName(Filename);
|
||||
}
|
||||
|
||||
void MCWasmStreamer::EmitIdent(StringRef IdentString) {
|
||||
MCSection *Comment = getAssembler().getContext().getWasmSection(
|
||||
".comment", 0, 0);
|
||||
|
@ -278,10 +278,6 @@ void MCWinCOFFStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
|
||||
llvm_unreachable("not implemented");
|
||||
}
|
||||
|
||||
void MCWinCOFFStreamer::EmitFileDirective(StringRef Filename) {
|
||||
getAssembler().addFileName(Filename);
|
||||
}
|
||||
|
||||
// TODO: Implement this if you want to emit .comment section in COFF obj files.
|
||||
void MCWinCOFFStreamer::EmitIdent(StringRef IdentString) {
|
||||
llvm_unreachable("not implemented");
|
||||
|
Loading…
x
Reference in New Issue
Block a user