LLVM 20.0.0git
|
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, uint64_t Address, const MCInst &Inst, const MCSubtargetInfo &STI, raw_ostream &OS) |
virtual void | emitDwarfFileDirective (StringRef Directive) |
virtual void | changeSection (const MCSection *CurSection, MCSection *Section, uint32_t SubSection, raw_ostream &OS) |
Update streamer for a new active section. | |
virtual void | emitValue (const MCExpr *Value) |
virtual void | emitRawBytes (StringRef Data) |
Emit the bytes in Data into the output. | |
virtual void | emitConstantPools () |
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 94 of file MCStreamer.h.
MCTargetStreamer::MCTargetStreamer | ( | MCStreamer & | S | ) |
Definition at line 46 of file MCStreamer.cpp.
References llvm::MCStreamer::setTargetStreamer().
|
virtualdefault |
|
virtual |
Update streamer for a new active section.
This is called by popSection and switchSection, if the current section changes.
Reimplemented in llvm::NVPTXTargetStreamer, and llvm::SPIRVTargetStreamer.
Definition at line 59 of file MCStreamer.cpp.
References llvm::MCContext::getAsmInfo(), llvm::MCStreamer::getContext(), llvm::MCContext::getTargetTriple(), OS, and Streamer.
Reimplemented in llvm::MipsTargetELFStreamer.
Definition at line 91 of file MCStreamer.cpp.
Referenced by llvm::MCStreamer::emitAssignment().
|
virtual |
Reimplemented in llvm::ARMTargetStreamer, llvm::AArch64TargetStreamer, and llvm::SystemZTargetStreamer.
Definition at line 57 of file MCStreamer.cpp.
|
virtual |
Reimplemented in llvm::NVPTXTargetStreamer.
Definition at line 67 of file MCStreamer.cpp.
References llvm::MCStreamer::emitRawText(), and Streamer.
|
virtual |
Reimplemented in llvm::MipsTargetELFStreamer.
Definition at line 53 of file MCStreamer.cpp.
Referenced by llvm::MCStreamer::emitLabel().
|
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 79 of file MCStreamer.cpp.
References llvm::CallingConv::C, llvm::Data, llvm::MCStreamer::emitRawText(), llvm::MCContext::getAsmInfo(), llvm::MCStreamer::getContext(), llvm::MCAsmInfo::getData8bitsDirective(), OS, and Streamer.
Referenced by llvm::NVPTXTargetStreamer::emitRawBytes().
Reimplemented in llvm::NVPTXTargetStreamer.
Definition at line 71 of file MCStreamer.cpp.
References llvm::MCStreamer::emitRawText(), llvm::MCContext::getAsmInfo(), llvm::MCStreamer::getContext(), OS, llvm::Value::print(), and Streamer.
Referenced by llvm::NVPTXTargetStreamer::emitValue().
|
virtual |
Reimplemented in llvm::AArch64TargetStreamer, llvm::AMDGPUTargetAsmStreamer, llvm::AMDGPUTargetELFStreamer, llvm::CSKYTargetStreamer, llvm::HexagonTargetStreamer, llvm::LoongArchTargetELFStreamer, llvm::MipsTargetELFStreamer, llvm::RISCVTargetELFStreamer, and llvm::RISCVTargetStreamer.
Definition at line 55 of file MCStreamer.cpp.
Referenced by llvm::LoongArchTargetELFStreamer::finish(), and llvm::MCStreamer::finish().
|
inline |
Definition at line 102 of file MCStreamer.h.
References Streamer.
Referenced by llvm::CSKYTargetStreamer::addConstantPoolEntry(), llvm::NVPTXTargetStreamer::changeSection(), llvm::NVPTXTargetStreamer::closeLastSection(), llvm::AArch64TargetWinCOFFStreamer::emitARM64WinCFIEpilogEnd(), llvm::AArch64TargetWinCOFFStreamer::emitARM64WinCFIEpilogStart(), llvm::AArch64TargetWinCOFFStreamer::emitARM64WinCFIPrologEnd(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), llvm::MipsTargetStreamer::emitII(), llvm::AArch64TargetStreamer::emitInst(), llvm::ARMTargetStreamer::emitInst(), llvm::AArch64TargetStreamer::emitNoteSection(), llvm::MipsTargetStreamer::emitR(), llvm::MipsTargetStreamer::emitRRIII(), llvm::MipsTargetStreamer::emitRRRX(), llvm::MipsTargetStreamer::emitRRX(), llvm::MipsTargetStreamer::emitRX(), and llvm::NVPTXTargetStreamer::outputDwarfFileDirectives().
|
virtual |
Definition at line 1105 of file MCStreamer.cpp.
References llvm::Address, OS, and llvm::MCInstPrinter::printInst().
|
protected |
Definition at line 96 of file MCStreamer.h.
Referenced by llvm::ARMTargetStreamer::addConstantPoolEntry(), llvm::AArch64TargetStreamer::addConstantPoolEntry(), changeSection(), llvm::AArch64TargetStreamer::emitAuthValue(), llvm::ARMTargetStreamer::emitConstantPools(), llvm::AArch64TargetStreamer::emitConstantPools(), llvm::SystemZTargetStreamer::emitConstantPools(), llvm::ARMTargetStreamer::emitCurrentConstantPool(), llvm::AArch64TargetStreamer::emitCurrentConstantPool(), llvm::CSKYTargetStreamer::emitCurrentConstantPool(), llvm::MipsTargetELFStreamer::emitDirectiveInsn(), emitDwarfFileDirective(), llvm::WebAssemblyTargetWasmStreamer::emitLocal(), emitRawBytes(), llvm::NVPTXTargetStreamer::emitRawBytes(), emitValue(), llvm::NVPTXTargetStreamer::emitValue(), llvm::WebAssemblyTargetStreamer::emitValueType(), llvm::CSKYTargetStreamer::finish(), llvm::MipsTargetELFStreamer::finish(), llvm::AMDGPUTargetStreamer::getContext(), getStreamer(), llvm::AVRELFStreamer::getStreamer(), llvm::CSKYTargetELFStreamer::getStreamer(), llvm::LoongArchTargetELFStreamer::getStreamer(), llvm::MipsTargetELFStreamer::getStreamer(), llvm::MSP430TargetELFStreamer::getStreamer(), llvm::RISCVTargetELFStreamer::getStreamer(), llvm::SparcTargetELFStreamer::getStreamer(), llvm::VETargetELFStreamer::getStreamer(), llvm::XtensaTargetELFStreamer::getStreamer(), and llvm::MSP430TargetELFStreamer::MSP430TargetELFStreamer().