LLVM API Documentation
#include <MCStreamer.h>
Public Member Functions | |
MCTargetStreamer (MCStreamer &S) | |
virtual | ~MCTargetStreamer () |
const MCStreamer & | getStreamer () |
virtual void | emitLabel (MCSymbol *Symbol) |
virtual void | emitAssignment (MCSymbol *Symbol, const MCExpr *Value) |
virtual void | finish () |
Protected Attributes | |
MCStreamer & | Streamer |
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.
Definition at line 30 of file MCStreamer.cpp.
References llvm::MCStreamer::setTargetStreamer().
MCTargetStreamer::~MCTargetStreamer | ( | ) | [virtual] |
Definition at line 28 of file MCStreamer.cpp.
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, llvm::ARMTargetStreamer, and llvm::AArch64TargetStreamer.
Definition at line 36 of file MCStreamer.cpp.
Referenced by llvm::MCStreamer::Finish().
const MCStreamer& llvm::MCTargetStreamer::getStreamer | ( | ) | [inline] |
Reimplemented in llvm::MipsTargetELFStreamer, and llvm::SparcTargetELFStreamer.
Definition at line 79 of file MCStreamer.h.
References Streamer.
MCStreamer& llvm::MCTargetStreamer::Streamer [protected] |
Definition at line 73 of file MCStreamer.h.
Referenced by llvm::AArch64TargetStreamer::addConstantPoolEntry(), llvm::ARMTargetStreamer::addConstantPoolEntry(), llvm::AArch64TargetStreamer::emitCurrentConstantPool(), llvm::ARMTargetStreamer::emitCurrentConstantPool(), llvm::AArch64TargetStreamer::finish(), llvm::ARMTargetStreamer::finish(), llvm::MipsTargetELFStreamer::finish(), llvm::SparcTargetELFStreamer::getStreamer(), getStreamer(), and llvm::MipsTargetELFStreamer::getStreamer().