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:93

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 emitConstantPools()
  • 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)

Declared at: llvm/include/llvm/MC/MCStreamer.h:98

Parameters

llvm::MCStreamer& S

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:118

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)

Declared at: llvm/include/llvm/MC/MCStreamer.h:106

Parameters

llvm::MCSymbol* Symbol
const llvm::MCExpr* Value

virtual void emitConstantPools()

Declared at: llvm/include/llvm/MC/MCStreamer.h:128

virtual void emitDwarfFileDirective(
    llvm::StringRef Directive)

Declared at: llvm/include/llvm/MC/MCStreamer.h:112

Parameters

llvm::StringRef Directive

virtual void emitLabel(llvm::MCSymbol* Symbol)

Declared at: llvm/include/llvm/MC/MCStreamer.h:104

Parameters

llvm::MCSymbol* Symbol

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:126

Parameters

llvm::StringRef Data

virtual void emitValue(const llvm::MCExpr* Value)

Declared at: llvm/include/llvm/MC/MCStreamer.h:121

Parameters

const llvm::MCExpr* Value

virtual void finish()

Declared at: llvm/include/llvm/MC/MCStreamer.h:130

llvm::MCStreamer& getStreamer()

Declared at: llvm/include/llvm/MC/MCStreamer.h:101

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:108

Parameters

llvm::MCInstPrinter& InstPrinter
uint64_t Address
const llvm::MCInst& Inst
const llvm::MCSubtargetInfo& STI
llvm::raw_ostream& OS

virtual ~MCTargetStreamer()

Declared at: llvm/include/llvm/MC/MCStreamer.h:99