LLVM API Documentation

Public Member Functions | Protected Attributes
llvm::MCTargetStreamer Class Reference

#include <MCStreamer.h>

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

List of all members.

Public Member Functions

 MCTargetStreamer (MCStreamer &S)
virtual ~MCTargetStreamer ()
const MCStreamergetStreamer ()
virtual void emitLabel (MCSymbol *Symbol)
virtual void emitAssignment (MCSymbol *Symbol, const MCExpr *Value)
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 : public MCTargetStreamer FooTargetAsmSreamer : 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 FooTargetAsmSreamer 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 FooTargetAsmSreamer and FooTargetELFStreamer should *never* be treated differently. Callers should always talk to a FooTargetStreamer.

Definition at line 71 of file MCStreamer.h.


Constructor & Destructor Documentation

Definition at line 30 of file MCStreamer.cpp.

References llvm::MCStreamer::setTargetStreamer().

Definition at line 28 of file MCStreamer.cpp.


Member Function Documentation

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

Reimplemented in llvm::MipsTargetELFStreamer.

Definition at line 38 of file MCStreamer.cpp.

Referenced by llvm::MCStreamer::EmitAssignment().

void MCTargetStreamer::emitLabel ( MCSymbol Symbol) [virtual]

Reimplemented in llvm::MipsTargetELFStreamer.

Definition at line 34 of file MCStreamer.cpp.

Referenced by llvm::MCStreamer::EmitLabel().

void MCTargetStreamer::finish ( ) [virtual]

Reimplemented in llvm::MipsTargetELFStreamer, and llvm::SparcTargetELFStreamer.

Definition at line 79 of file MCStreamer.h.

References Streamer.


Member Data Documentation


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