LLVM 20.0.0git
|
Implments NVPTX-specific streamer. More...
#include "Target/NVPTX/MCTargetDesc/NVPTXTargetStreamer.h"
Public Member Functions | |
NVPTXTargetStreamer (MCStreamer &S) | |
~NVPTXTargetStreamer () override | |
void | outputDwarfFileDirectives () |
Outputs the list of the DWARF '.file' directives to the streamer. | |
void | closeLastSection () |
Close last section. | |
void | emitDwarfFileDirective (StringRef Directive) override |
Record DWARF file directives for later output. | |
void | changeSection (const MCSection *CurSection, MCSection *Section, uint32_t SubSection, raw_ostream &OS) override |
Update streamer for a new active section. | |
void | emitRawBytes (StringRef Data) override |
Emit the bytes in Data into the output. | |
void | emitValue (const MCExpr *Value) override |
Makes sure that labels are mangled the same way as the actual symbols. | |
Public Member Functions inherited from llvm::MCTargetStreamer | |
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 () |
Additional Inherited Members | |
Protected Attributes inherited from llvm::MCTargetStreamer | |
MCStreamer & | Streamer |
Implments NVPTX-specific streamer.
Definition at line 18 of file NVPTXTargetStreamer.h.
NVPTXTargetStreamer::NVPTXTargetStreamer | ( | MCStreamer & | S | ) |
Definition at line 27 of file NVPTXTargetStreamer.cpp.
|
overridedefault |
|
overridevirtual |
Update streamer for a new active section.
This is called by popSection and switchSection, if the current section changes.
Reimplemented from llvm::MCTargetStreamer.
Definition at line 89 of file NVPTXTargetStreamer.cpp.
References assert(), llvm::MCStreamer::getContext(), llvm::MCContext::getObjectFileInfo(), llvm::MCTargetStreamer::getStreamer(), isDwarfSection(), OS, and outputDwarfFileDirectives().
void NVPTXTargetStreamer::closeLastSection | ( | ) |
Close last section.
Definition at line 40 of file NVPTXTargetStreamer.cpp.
References llvm::MCStreamer::emitRawText(), and llvm::MCTargetStreamer::getStreamer().
Referenced by llvm::NVPTXAsmPrinter::doFinalization().
|
overridevirtual |
Record DWARF file directives for later output.
According to PTX ISA, CUDA Toolkit documentation, 11.5.3. Debugging Directives: .file (http://docs.nvidia.com/cuda/parallel-thread-execution/index.html#debugging-directives-file), The .file directive is allowed only in the outermost scope, i.e., at the same level as kernel and device function declarations. Also, the order of the .loc and .file directive does not matter, .file directives may follow the .loc directives where the file is referenced. LLVM emits .file directives immediately the location debug info is emitted, i.e. they may be emitted inside functions. We gather all these directives and emit them outside of the sections and, thus, outside of the functions.
Reimplemented from llvm::MCTargetStreamer.
Definition at line 45 of file NVPTXTargetStreamer.cpp.
References llvm::SmallVectorImpl< T >::emplace_back().
|
overridevirtual |
Emit the bytes in Data
into the output.
This is used to emit bytes in Data
as sequence of .byte directives.
Reimplemented from llvm::MCTargetStreamer.
Definition at line 110 of file NVPTXTargetStreamer.cpp.
References llvm::Data, llvm::MCTargetStreamer::emitRawBytes(), llvm::MCStreamer::emitRawText(), End, llvm::MCContext::getAsmInfo(), llvm::MCStreamer::getContext(), llvm::MCAsmInfo::getData8bitsDirective(), I, OS, and llvm::MCTargetStreamer::Streamer.
Makes sure that labels are mangled the same way as the actual symbols.
Reimplemented from llvm::MCTargetStreamer.
Definition at line 142 of file NVPTXTargetStreamer.cpp.
References llvm::MCStreamer::emitRawText(), llvm::MCTargetStreamer::emitValue(), llvm::MCSymbol::getName(), llvm::MCSymbolRefExpr::getSymbol(), llvm::NVPTX::getValidPTXIdentifier(), llvm::StringRef::starts_with(), llvm::MCTargetStreamer::Streamer, and llvm::MCExpr::SymbolRef.
void NVPTXTargetStreamer::outputDwarfFileDirectives | ( | ) |
Outputs the list of the DWARF '.file' directives to the streamer.
Definition at line 34 of file NVPTXTargetStreamer.cpp.
References llvm::MCStreamer::emitRawText(), and llvm::MCTargetStreamer::getStreamer().
Referenced by changeSection().