|
LLVM 24.0.0git
|
Implments NVPTX-specific streamer. More...
#include "Target/NVPTX/MCTargetDesc/NVPTXTargetStreamer.h"
Public Member Functions | |
| NVPTXTargetStreamer (MCStreamer &S) | |
| ~NVPTXTargetStreamer () override | |
| virtual void | emitBanner () |
| Emit the banner which specifies details of PTX generator. | |
| virtual void | emitVersionDirective (unsigned PTXVersion) |
| Emit the PTX ISA version number. | |
| virtual void | emitTargetDirective (StringRef Target, bool TexModeIndependent, bool HasDebug) |
| Emit architecture and platform target. | |
| virtual void | emitAddressSizeDirective (unsigned AddrSize) |
| Emit address size used for this PTX module. | |
| virtual void | emitBranchTargetsDirective (ArrayRef< const MCSymbol * > Targets) |
| Emit the list of branch targets a brx.idx may jump to. | |
| virtual void | emitRegDirective (unsigned SizeInBits, StringRef Name, std::optional< unsigned > Count=std::nullopt) |
Declare a register SizeInBits wide. | |
| virtual void | emitLocalDirective (Align Alignment, const MCSymbol *Name, uint64_t Size) |
Declare Size bytes of local (stack) memory named Name. | |
| virtual void | emitAliasDirective (const MCSymbol *Name, const MCSymbol *Aliasee) |
Emit an alias from Name to Aliasee. | |
| virtual void | emitPragmaDirective (StringRef Pragma) |
| Emit a pragma governing the code that follows it. | |
| virtual void | emitEmptySectionDirective (StringRef Name) |
| Emit a section with an empty body. | |
| 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 () |
| MCContext & | getContext () |
| 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 | emitConstantPools () |
| virtual void | finish () |
Additional Inherited Members | |
| Protected Attributes inherited from llvm::MCTargetStreamer | |
| MCStreamer & | Streamer |
Implments NVPTX-specific streamer.
Definition at line 22 of file NVPTXTargetStreamer.h.
| NVPTXTargetStreamer::NVPTXTargetStreamer | ( | MCStreamer & | S | ) |
Definition at line 29 of file NVPTXTargetStreamer.cpp.
References llvm::MCTargetStreamer::MCTargetStreamer().
Referenced by llvm::NVPTXAsmTargetStreamer::NVPTXAsmTargetStreamer().
|
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 87 of file NVPTXTargetStreamer.cpp.
References assert(), llvm::MCStreamer::getContext(), llvm::MCContext::getObjectFileInfo(), llvm::MCTargetStreamer::getStreamer(), isDwarfSection(), and outputDwarfFileDirectives().
| void NVPTXTargetStreamer::closeLastSection | ( | ) |
Close last section.
Definition at line 38 of file NVPTXTargetStreamer.cpp.
References llvm::MCStreamer::emitRawText(), and llvm::MCTargetStreamer::getStreamer().
|
inlinevirtual |
Emit address size used for this PTX module.
Reimplemented in llvm::NVPTXAsmTargetStreamer.
Definition at line 42 of file NVPTXTargetStreamer.h.
|
inlinevirtual |
Emit an alias from Name to Aliasee.
Reimplemented in llvm::NVPTXAsmTargetStreamer.
Definition at line 58 of file NVPTXTargetStreamer.h.
|
inlinevirtual |
Emit the banner which specifies details of PTX generator.
Reimplemented in llvm::NVPTXAsmTargetStreamer.
Definition at line 32 of file NVPTXTargetStreamer.h.
|
inlinevirtual |
Emit the list of branch targets a brx.idx may jump to.
Reimplemented in llvm::NVPTXAsmTargetStreamer.
Definition at line 45 of file NVPTXTargetStreamer.h.
|
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 43 of file NVPTXTargetStreamer.cpp.
|
inlinevirtual |
Emit a section with an empty body.
Reimplemented in llvm::NVPTXAsmTargetStreamer.
Definition at line 65 of file NVPTXTargetStreamer.h.
|
inlinevirtual |
Declare Size bytes of local (stack) memory named Name.
Reimplemented in llvm::NVPTXAsmTargetStreamer.
Definition at line 54 of file NVPTXTargetStreamer.h.
References Size.
|
inlinevirtual |
Emit a pragma governing the code that follows it.
Reimplemented in llvm::NVPTXAsmTargetStreamer.
Definition at line 62 of file NVPTXTargetStreamer.h.
|
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 105 of file NVPTXTargetStreamer.cpp.
References llvm::Data, llvm::MCTargetStreamer::emitRawBytes(), llvm::MCAsmInfo::getData8bitsDirective(), I, llvm::raw_svector_ostream::str(), and llvm::MCTargetStreamer::Streamer.
|
inlinevirtual |
Declare a register SizeInBits wide.
Count declares a numbered bank of that many registers sharing Name as their prefix, rather than a single register named Name.
Reimplemented in llvm::NVPTXAsmTargetStreamer.
Definition at line 50 of file NVPTXTargetStreamer.h.
References llvm::Count.
|
inlinevirtual |
Emit architecture and platform target.
Reimplemented in llvm::NVPTXAsmTargetStreamer.
Definition at line 38 of file NVPTXTargetStreamer.h.
Makes sure that labels are mangled the same way as the actual symbols.
Reimplemented from llvm::MCTargetStreamer.
Definition at line 137 of file NVPTXTargetStreamer.cpp.
References llvm::cast(), llvm::MCTargetStreamer::emitValue(), llvm::MCSymbol::getName(), llvm::MCSymbolRefExpr::getSymbol(), llvm::NVPTX::getValidPTXIdentifier(), llvm::StringRef::starts_with(), llvm::MCTargetStreamer::Streamer, and llvm::MCExpr::SymbolRef.
|
inlinevirtual |
Emit the PTX ISA version number.
Reimplemented in llvm::NVPTXAsmTargetStreamer.
Definition at line 35 of file NVPTXTargetStreamer.h.
| void NVPTXTargetStreamer::outputDwarfFileDirectives | ( | ) |
Outputs the list of the DWARF '.file' directives to the streamer.
Definition at line 32 of file NVPTXTargetStreamer.cpp.
References llvm::MCStreamer::emitRawText(), and llvm::MCTargetStreamer::getStreamer().
Referenced by changeSection().