LLVM  6.0.0svn
Public Member Functions | Protected Attributes | List of all members
llvm::MCTargetStreamer Class Reference

Target specific streamer interface. More...

#include "llvm/MC/MCStreamer.h"

Inheritance diagram for llvm::MCTargetStreamer:
Inheritance graph
[legend]
Collaboration diagram for llvm::MCTargetStreamer:
Collaboration graph
[legend]

Public Member Functions

 MCTargetStreamer (MCStreamer &S)
 
virtual ~MCTargetStreamer ()
 
MCStreamergetStreamer ()
 
virtual void emitLabel (MCSymbol *Symbol)
 
virtual void emitAssignment (MCSymbol *Symbol, const MCExpr *Value)
 
virtual void prettyPrintAsm (MCInstPrinter &InstPrinter, raw_ostream &OS, const MCInst &Inst, const MCSubtargetInfo &STI)
 
virtual void finish ()
 

Protected Attributes

MCStreamerStreamer
 

Detailed 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 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.

Definition at line 79 of file MCStreamer.h.

Constructor & Destructor Documentation

◆ MCTargetStreamer()

MCTargetStreamer::MCTargetStreamer ( MCStreamer S)

Definition at line 41 of file MCStreamer.cpp.

References llvm::MCStreamer::setTargetStreamer(), and ~MCTargetStreamer().

◆ ~MCTargetStreamer()

MCTargetStreamer::~MCTargetStreamer ( )
virtualdefault

Referenced by MCTargetStreamer().

Member Function Documentation

◆ emitAssignment()

void MCTargetStreamer::emitAssignment ( MCSymbol Symbol,
const MCExpr Value 
)
virtual

◆ emitLabel()

void MCTargetStreamer::emitLabel ( MCSymbol Symbol)
virtual

◆ finish()

void MCTargetStreamer::finish ( )
virtual

◆ getStreamer()

MCStreamer& llvm::MCTargetStreamer::getStreamer ( )
inline

◆ prettyPrintAsm()

void MCTargetStreamer::prettyPrintAsm ( MCInstPrinter InstPrinter,
raw_ostream OS,
const MCInst Inst,
const MCSubtargetInfo STI 
)
virtual

Definition at line 829 of file MCStreamer.cpp.

References llvm::MCInstPrinter::printInst().

Referenced by getStreamer().

Member Data Documentation

◆ Streamer

MCStreamer& llvm::MCTargetStreamer::Streamer
protected

The documentation for this class was generated from the following files: