class MCTargetStreamer
Declaration
class MCTargetStreamer { /* full declaration omitted */ };
Description
Target specific streamer interface. This is used so that targets can implement support for target specific assembly directives. If target foo wants to use this, it should implement 3 classes: * FooTargetStreamer : public MCTargetStreamer * FooTargetAsmStreamer : public FooTargetStreamer * FooTargetELFStreamer : public FooTargetStreamer FooTargetStreamer should have a pure virtual method for each directive. For example, for a ".bar symbol_name" directive, it should have virtual emitBar(const MCSymbol &Symbol ) = 0; The FooTargetAsmStreamer and FooTargetELFStreamer classes implement the method. The assembly streamer just prints ".bar symbol_name". The object streamer does whatever is needed to implement .bar in the object file. In the assembly printer and parser the target streamer can be used by calling getTargetStreamer and casting it to FooTargetStreamer: MCTargetStreamer &TS = OutStreamer.getTargetStreamer(); FooTargetStreamer &ATS = static_cast <FooTargetStreamer & >(TS); The base classes FooTargetAsmStreamer and FooTargetELFStreamer should *never* be treated differently. Callers should always talk to a FooTargetStreamer.
Declared at: llvm/include/llvm/MC/MCStreamer.h:91
Member Variables
- protected llvm::MCStreamer& Streamer
Method Overview
- public MCTargetStreamer(llvm::MCStreamer & S)
- public virtual void changeSection(const llvm::MCSection * CurSection, llvm::MCSection * Section, const llvm::MCExpr * SubSection, llvm::raw_ostream & OS)
- public virtual void emitAssignment(llvm::MCSymbol * Symbol, const llvm::MCExpr * Value)
- public virtual void emitDwarfFileDirective(llvm::StringRef Directive)
- public virtual void emitLabel(llvm::MCSymbol * Symbol)
- public virtual void emitRawBytes(llvm::StringRef Data)
- public virtual void emitValue(const llvm::MCExpr * Value)
- public virtual void finish()
- public llvm::MCStreamer & getStreamer()
- public virtual void prettyPrintAsm(llvm::MCInstPrinter & InstPrinter, uint64_t Address, const llvm::MCInst & Inst, const llvm::MCSubtargetInfo & STI, llvm::raw_ostream & OS)
- public virtual ~MCTargetStreamer()
Methods
¶MCTargetStreamer(llvm::MCStreamer& S)
MCTargetStreamer(llvm::MCStreamer& S)
Declared at: llvm/include/llvm/MC/MCStreamer.h:96
Parameters
¶virtual void changeSection(
const llvm::MCSection* CurSection,
llvm::MCSection* Section,
const llvm::MCExpr* SubSection,
llvm::raw_ostream& OS)
virtual void changeSection(
const llvm::MCSection* CurSection,
llvm::MCSection* Section,
const llvm::MCExpr* SubSection,
llvm::raw_ostream& OS)
Description
Update streamer for a new active section. This is called by PopSection and SwitchSection, if the current section changes.
Declared at: llvm/include/llvm/MC/MCStreamer.h:116
Parameters
- const llvm::MCSection* CurSection
- llvm::MCSection* Section
- const llvm::MCExpr* SubSection
- llvm::raw_ostream& OS
¶virtual void emitAssignment(
llvm::MCSymbol* Symbol,
const llvm::MCExpr* Value)
virtual void emitAssignment(
llvm::MCSymbol* Symbol,
const llvm::MCExpr* Value)
Declared at: llvm/include/llvm/MC/MCStreamer.h:104
Parameters
- llvm::MCSymbol* Symbol
- const llvm::MCExpr* Value
¶virtual void emitDwarfFileDirective(
llvm::StringRef Directive)
virtual void emitDwarfFileDirective(
llvm::StringRef Directive)
Declared at: llvm/include/llvm/MC/MCStreamer.h:110
Parameters
- llvm::StringRef Directive
¶virtual void emitLabel(llvm::MCSymbol* Symbol)
virtual void emitLabel(llvm::MCSymbol* Symbol)
Declared at: llvm/include/llvm/MC/MCStreamer.h:102
Parameters
- llvm::MCSymbol* Symbol
¶virtual void emitRawBytes(llvm::StringRef Data)
virtual void emitRawBytes(llvm::StringRef Data)
Description
Emit the bytes in \p Data into the output. This is used to emit bytes in \p Data as sequence of .byte directives.
Declared at: llvm/include/llvm/MC/MCStreamer.h:124
Parameters
- llvm::StringRef Data
¶virtual void emitValue(const llvm::MCExpr* Value)
virtual void emitValue(const llvm::MCExpr* Value)
Declared at: llvm/include/llvm/MC/MCStreamer.h:119
Parameters
- const llvm::MCExpr* Value
¶virtual void finish()
virtual void finish()
Declared at: llvm/include/llvm/MC/MCStreamer.h:126
¶llvm::MCStreamer& getStreamer()
llvm::MCStreamer& getStreamer()
Declared at: llvm/include/llvm/MC/MCStreamer.h:99
¶virtual void prettyPrintAsm(
llvm::MCInstPrinter& InstPrinter,
uint64_t Address,
const llvm::MCInst& Inst,
const llvm::MCSubtargetInfo& STI,
llvm::raw_ostream& OS)
virtual void prettyPrintAsm(
llvm::MCInstPrinter& InstPrinter,
uint64_t Address,
const llvm::MCInst& Inst,
const llvm::MCSubtargetInfo& STI,
llvm::raw_ostream& OS)
Declared at: llvm/include/llvm/MC/MCStreamer.h:106
Parameters
- llvm::MCInstPrinter& InstPrinter
- uint64_t Address
- const llvm::MCInst& Inst
- const llvm::MCSubtargetInfo& STI
- llvm::raw_ostream& OS
¶virtual ~MCTargetStreamer()
virtual ~MCTargetStreamer()
Declared at: llvm/include/llvm/MC/MCStreamer.h:97