LLVM
8.0.1
|
Target specific streamer interface. More...
#include "llvm/MC/MCStreamer.h"
Public Member Functions | |
MCTargetStreamer (MCStreamer &S) | |
virtual | ~MCTargetStreamer () |
MCStreamer & | getStreamer () |
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 | emitDwarfFileDirective (StringRef Directive) |
virtual void | changeSection (const MCSection *CurSection, MCSection *Section, const MCExpr *SubSection, raw_ostream &OS) |
Update streamer for a new active section. More... | |
virtual void | emitValue (const MCExpr *Value) |
virtual void | emitRawBytes (StringRef Data) |
Emit the bytes in Data into the output. More... | |
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 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 84 of file MCStreamer.h.
MCTargetStreamer::MCTargetStreamer | ( | MCStreamer & | S | ) |
Definition at line 42 of file MCStreamer.cpp.
References llvm::MCStreamer::setTargetStreamer(), and ~MCTargetStreamer().
|
virtualdefault |
Referenced by MCTargetStreamer().
|
virtual |
Update streamer for a new active section.
This is called by PopSection and SwitchSection, if the current section changes.
Reimplemented in llvm::NVPTXTargetStreamer.
Definition at line 53 of file MCStreamer.cpp.
References llvm::MCContext::getAsmInfo(), llvm::MCStreamer::getContext(), llvm::MCContext::getObjectFileInfo(), llvm::MCObjectFileInfo::getTargetTriple(), llvm::MCSection::PrintSwitchToSection(), and Streamer.
Referenced by getStreamer().
Reimplemented in llvm::MipsTargetELFStreamer.
Definition at line 87 of file MCStreamer.cpp.
Referenced by createPPCMCAsmInfo(), llvm::MCStreamer::EmitAssignment(), getStreamer(), and llvm::MipsTargetELFStreamer::setPic().
|
virtual |
Reimplemented in llvm::NVPTXTargetStreamer.
Definition at line 63 of file MCStreamer.cpp.
References llvm::MCStreamer::EmitRawText(), and Streamer.
Referenced by getStreamer().
|
virtual |
Reimplemented in llvm::MipsTargetELFStreamer.
Definition at line 49 of file MCStreamer.cpp.
Referenced by llvm::MCStreamer::EmitLabel(), getStreamer(), and llvm::MipsTargetELFStreamer::setPic().
|
virtual |
Emit the bytes in Data
into the output.
This is used to emit bytes in Data
as sequence of .byte directives.
Reimplemented in llvm::NVPTXTargetStreamer.
Definition at line 75 of file MCStreamer.cpp.
References llvm::StringRef::bytes(), C, llvm::MCStreamer::EmitRawText(), llvm::MCContext::getAsmInfo(), llvm::MCStreamer::getContext(), llvm::MCAsmInfo::getData8bitsDirective(), llvm::raw_svector_ostream::str(), and Streamer.
Referenced by getStreamer().
Definition at line 67 of file MCStreamer.cpp.
References llvm::MCStreamer::EmitRawText(), llvm::MCContext::getAsmInfo(), llvm::MCStreamer::getContext(), llvm::MCExpr::print(), llvm::raw_svector_ostream::str(), and Streamer.
Referenced by getStreamer().
|
virtual |
Reimplemented in llvm::MipsTargetELFStreamer, llvm::ARMTargetStreamer, llvm::AArch64TargetStreamer, and llvm::AVRTargetStreamer.
Definition at line 51 of file MCStreamer.cpp.
Referenced by createPPCMCAsmInfo(), llvm::MCStreamer::Finish(), getStreamer(), and llvm::MipsTargetELFStreamer::setPic().
|
inline |
Definition at line 92 of file MCStreamer.h.
References changeSection(), llvm::Data, emitAssignment(), emitDwarfFileDirective(), emitLabel(), emitRawBytes(), emitValue(), finish(), prettyPrintAsm(), llvm::ARMBuildAttrs::Section, Streamer, and llvm::ARMBuildAttrs::Symbol.
Referenced by llvm::NVPTXTargetStreamer::changeSection(), checkScale(), countMCSymbolRefExpr(), createPPCMCAsmInfo(), llvm::AMDGPUAsmPrinter::EmitFunctionBodyEnd(), llvm::MipsTargetStreamer::emitII(), llvm::AArch64TargetStreamer::emitInst(), llvm::ARMTargetStreamer::emitInst(), llvm::MipsTargetStreamer::emitR(), llvm::MipsTargetStreamer::emitRRIII(), llvm::MipsTargetStreamer::emitRRX(), llvm::MipsTargetStreamer::emitRX(), llvm::AVRTargetStreamer::finish(), llvm::MipsTargetELFStreamer::isMicroMipsEnabled(), nextReg(), and llvm::NVPTXTargetStreamer::outputDwarfFileDirectives().
|
virtual |
Definition at line 921 of file MCStreamer.cpp.
References llvm::MCInstPrinter::printInst().
Referenced by getStreamer().
|
protected |
Definition at line 86 of file MCStreamer.h.
Referenced by llvm::AArch64TargetStreamer::addConstantPoolEntry(), llvm::ARMTargetStreamer::addConstantPoolEntry(), changeSection(), createPPCMCAsmInfo(), llvm::AArch64TargetStreamer::emitCurrentConstantPool(), llvm::ARMTargetStreamer::emitCurrentConstantPool(), llvm::MipsTargetELFStreamer::emitDirectiveInsn(), emitDwarfFileDirective(), llvm::WebAssemblyTargetWasmStreamer::emitLocal(), llvm::NVPTXTargetStreamer::emitRawBytes(), emitRawBytes(), emitValue(), llvm::WebAssemblyTargetStreamer::emitValueType(), llvm::AArch64TargetStreamer::finish(), llvm::ARMTargetStreamer::finish(), llvm::MipsTargetELFStreamer::finish(), llvm::AMDGPUTargetStreamer::getContext(), llvm::RISCVTargetELFStreamer::getStreamer(), llvm::AVRELFStreamer::getStreamer(), llvm::MSP430TargetELFStreamer::getStreamer(), llvm::SparcTargetELFStreamer::getStreamer(), getStreamer(), llvm::MipsTargetELFStreamer::getStreamer(), and llvm::MSP430TargetELFStreamer::MSP430TargetELFStreamer().