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;
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;
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;
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;
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,
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, "");
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");
}
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())
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);
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");