LLVM: llvm::NVPTXAsmPrinter Class Reference (original) (raw)
Public Member Functions
getPassName () const override
getPassName - Return a nice clean name for a pass.
NVPTXAsmPrinter (TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
runOnMachineFunction (MachineFunction &F) override
Emit the specified function out to the OutStreamer.
void
getAnalysisUsage (AnalysisUsage &AU) const override
Record analysis usage.
std::string
getVirtualRegisterName (unsigned) const
getFunctionFrameSymbol () const override
Return symbol for the function pseudo stack if the stack frame is not a register based.
void
emitGlobalVariable (const GlobalVariable *GV) override
Emit the specified global variable to the .s file.
Public Member Functions inherited from llvm::AsmPrinter
~AsmPrinter () override
void
setDwarfVersion (uint16_t Version)
unsigned int
getDwarfOffsetByteSize () const
Returns 4 for DWARF32 and 8 for DWARF64.
unsigned int
getUnitLengthFieldByteSize () const
Returns 4 for DWARF32 and 12 for DWARF64.
Returns information about the byte size of DW_FORM values.
isPositionIndependent () const
Return true if assembly output should contain comments.
Return a unique ID for the current function.
MCSymbol *
MCSymbol *
MCSymbol *
getMBBExceptionSym (const MachineBasicBlock &MBB)
MCSymbol *
getAddrLabelSymbol (const BasicBlock *BB)
Return the symbol to be used for the specified basic block when its address is taken.
getAddrLabelSymbolToEmit (const BasicBlock *BB)
Return the symbol to be used for the specified basic block when its address is taken.
MCSymbol *
createCallsiteEndSymbol (const MachineBasicBlock &MBB)
Creates a new symbol to be used for the end of a callsite at the specified basic block.
void
takeDeletedSymbolsForFunction (const Function *F, std::vector< MCSymbol * > &Result)
If the specified function has had any references to address-taken blocks generated, but the block got deleted, return the symbol now so we can emit it.
const TargetLoweringObjectFile &
Return information about object file lowering.
Return information about data layout.
Return the pointer size from the TargetMachine.
Return information about subtarget.
void
EmitToStreamer (MCStreamer &S, const MCInst &Inst)
void
emitInitialRawDwarfLocDirective (const MachineFunction &MF)
Emits inital debug location directive.
Return the current section we are emitting to.
void
getNameWithPrefix (SmallVectorImpl< char > &Name, const GlobalValue *GV) const
MCSymbol *
getSymbol (const GlobalValue *GV) const
MCSymbol *
getSymbolPreferLocal (const GlobalValue &GV) const
Similar to getSymbol() but preferred for references.
doesDwarfUseRelocationsAcrossSections () const
void
setDwarfUsesRelocationsAcrossSections (bool Enable)
getConstantSectionSuffix (const Constant *C) const
Returns a section suffix (hot or unlikely) for the constant if profiles are available.
void
handleCallsiteForCallgraph (FunctionCallGraphInfo &FuncCGInfo, const MachineFunction::CallSiteInfoMap &CallSitesInfoMap, const MachineInstr &MI)
If MI is an indirect call, add expected type IDs to indirect type ids list.
void
recordSled (MCSymbol *Sled, const MachineInstr &MI, SledKind Kind, uint8_t Version=0)
void
Emit a table with all XRay instrumentation points.
void
emitPatchableFunctionEntries ()
virtual void
SetupMachineFunction (MachineFunction &MF)
This should be called when a new MachineFunction is being processed from runOnMachineFunction.
void
This method emits the body and trailer for a function.
void
emitCFIInstruction (const MachineInstr &MI)
void
emitFrameAlloc (const MachineInstr &MI)
void
emitStackSizeSection (const MachineFunction &MF)
void
emitStackUsage (const MachineFunction &MF)
void
emitBBAddrMapSection (const MachineFunction &MF)
void
emitKCFITrapEntry (const MachineFunction &MF, const MCSymbol *Symbol)
virtual void
emitKCFITypeId (const MachineFunction &MF)
void
emitCallGraphSection (const MachineFunction &MF, FunctionCallGraphInfo &FuncCGInfo)
Emits .llvm.callgraph section.
void
emitPseudoProbe (const MachineInstr &MI)
void
emitRemarksSection (remarks::RemarkStreamer &RS)
void
emitPCSectionsLabel (const MachineFunction &MF, const MDNode &MD)
Emits a label as reference for PC sections.
void
emitPCSections (const MachineFunction &MF)
Emits the PC sections collected from instructions.
getFunctionCFISectionType (const Function &F) const
Get the CFISection type for a function.
getFunctionCFISectionType (const MachineFunction &MF) const
Get the CFISection type for a function.
getModuleCFISectionType () const
Get the CFISection type for the module.
Returns true if valid debug info is present.
Since emitting CFI unwind information is entangled with supporting the exceptions, this returns true for platforms which use CFI unwind information for other purposes (debugging, sanitizers, ...) when MCAsmInfo::ExceptionsType == ExceptionHandling::None.
virtual void
Print to the current output stream assembly representations of the constants in the constant pool MCP.
virtual void
Print assembly representations of the jump tables used by the current function to the current output stream.
emitSpecialLLVMGlobal (const GlobalVariable *GV)
Check to see if the specified global is a special global used by LLVM.
void
preprocessXXStructorList (const DataLayout &DL, const Constant *List, SmallVector< Structor, 8 > &Structors)
This method gathers an array of Structors and then sorts them out by Priority.
virtual void
emitXXStructorList (const DataLayout &DL, const Constant *List, bool IsCtor)
This method emits llvm.global_ctors or llvm.global_dtors list.
void
emitAlignment (Align Alignment, const GlobalObject *GV=nullptr, unsigned MaxBytesToEmit=0) const
Emit an alignment directive to the specified power of two boundary.
lowerConstant (const Constant *CV, const Constant *BaseCV=nullptr, uint64_t Offset=0)
Lower the specified LLVM Constant to an MCExpr.
void
emitGlobalConstant (const DataLayout &DL, const Constant *CV, AliasMapTy *AliasList=nullptr)
EmitGlobalConstant - Print a general LLVM constant to the .s file.
void
computeGlobalGOTEquivs (Module &M)
Unnamed constant global variables solely contaning a pointer to another globals variable act like a global variable "proxy", or GOT equivalents, i.e., it's only used to hold the address of the latter.
void
Constant expressions using GOT equivalent globals may not be eligible for PC relative GOT entry conversion, in such cases we need to emit the proxies we previously omitted in EmitGlobalVariable.
void
Emit the stack maps.
void
addAsmPrinterHandler (std::unique_ptr< AsmPrinterHandler > Handler)
virtual void
This virtual method can be overridden by targets that want to emit something at the end of their file.
virtual void
emitBasicBlockEnd (const MachineBasicBlock &MBB)
Targets can override this to emit stuff at the end of a basic block.
virtual MCSymbol *
GetCPISymbol (unsigned CPID) const
Return the symbol for the specified constant pool entry.
virtual void
virtual void
emitMachineConstantPoolValue (MachineConstantPoolValue *MCPV)
virtual void
emitXXStructor (const DataLayout &DL, const Constant *CV)
Targets can override this to change how global constants that are part of a C++ static/global constructor list are emitted.
lowerConstantPtrAuth (const ConstantPtrAuth &CPA)
lowerBlockAddressConstant (const BlockAddress &BA)
Lower the specified BlockAddress to an MCExpr.
virtual bool
isBlockOnlyReachableByFallthrough (const MachineBasicBlock *MBB) const
Return true if the basic block has exactly one predecessor and the control transfer mechanism between the predecessor and this block is a fall-through.
virtual const MCSubtargetInfo *
getIFuncMCSubtargetInfo () const
getSubtargetInfo() cannot be used where this is needed because we don't have a MachineFunction when we're lowering a GlobalIFunc, and getSubtargetInfo requires one.
virtual void
emitMachOIFuncStubBody (Module &M, const GlobalIFunc &GI, MCSymbol *LazyPointer)
virtual void
emitMachOIFuncStubHelperBody (Module &M, const GlobalIFunc &GI, MCSymbol *LazyPointer)
void
Emit N NOP instructions.
MCSymbol *
createTempSymbol (const Twine &Name) const
MCSymbol *
getSymbolWithGlobalValueBase (const GlobalValue *GV, StringRef Suffix) const
Return the MCSymbol for a private symbol with global value name as its base, with the specified suffix.
MCSymbol *
GetExternalSymbolSymbol (const Twine &Sym) const
Return the MCSymbol for the specified ExternalSymbol.
MCSymbol *
GetJTISymbol (unsigned JTID, bool isLinkerPrivate=false) const
Return the symbol for the specified jump table entry.
MCSymbol *
GetJTSetSymbol (unsigned UID, unsigned MBBID) const
Return the symbol for the specified jump table .set FIXME: privatize to AsmPrinter.
MCSymbol *
GetBlockAddressSymbol (const BlockAddress *BA) const
Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block.
MCSymbol *
GetBlockAddressSymbol (const BasicBlock *BB) const
void
printOffset (int64_t Offset, raw_ostream &OS) const
This is just convenient handler for printing offsets.
void
Emit a byte directive and value.
void
Emit a short directive and value.
void
Emit a long directive and value.
void
emitInt64 (uint64_t Value) const
Emit a long long directive and value.
void
emitSLEB128 (int64_t Value, const char *Desc=nullptr) const
Emit the specified signed leb128 value.
void
emitULEB128 (uint64_t Value, const char *Desc=nullptr, unsigned PadTo=0) const
Emit the specified unsigned leb128 value.
void
emitLabelDifference (const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) const
Emit something like ".long Hi-Lo" where the size in bytes of the directive is specified by Size and Hi/Lo specify the labels.
void
emitLabelDifferenceAsULEB128 (const MCSymbol *Hi, const MCSymbol *Lo) const
Emit something like ".uleb128 Hi-Lo".
void
emitLabelPlusOffset (const MCSymbol *Label, uint64_t Offset, unsigned Size, bool IsSectionRelative=false) const
Emit something like ".long Label+Offset" where the size in bytes of the directive is specified by Size and Label specifies the label.
void
emitLabelReference (const MCSymbol *Label, unsigned Size, bool IsSectionRelative=false) const
Emit something like ".long Label" where the size in bytes of the directive is specified by Size and Label specifies the label.
void
emitEncodingByte (unsigned Val, const char *Desc=nullptr) const
Emit a .byte 42 directive that corresponds to an encoding.
GetSizeOfEncodedValue (unsigned Encoding) const
Return the size of the encoding in bytes.
virtual void
emitTTypeReference (const GlobalValue *GV, unsigned Encoding)
Emit reference to a ttype global with a specified encoding.
void
emitDwarfSymbolReference (const MCSymbol *Label, bool ForceOffset=false) const
Emit a reference to a symbol for use in dwarf.
void
emitDwarfStringOffset (DwarfStringPoolEntry S) const
Emit the 4- or 8-byte offset of a string from the start of its section.
void
emitDwarfStringOffset (DwarfStringPoolEntryRef S) const
Emit the 4-or 8-byte offset of a string from the start of its section.
void
emitDwarfOffset (const MCSymbol *Label, uint64_t Offset) const
Emit something like ".long Label + Offset" or ".quad Label + Offset" depending on the DWARF format.
void
emitDwarfLengthOrOffset (uint64_t Value) const
Emit 32- or 64-bit value depending on the DWARF format.
void
emitDwarfUnitLength (uint64_t Length, const Twine &Comment) const
Emit a unit length field.
MCSymbol *
emitDwarfUnitLength (const Twine &Prefix, const Twine &Comment) const
Emit a unit length field.
void
emitCallSiteOffset (const MCSymbol *Hi, const MCSymbol *Lo, unsigned Encoding) const
Emit reference to a call site with a specified encoding.
void
emitCallSiteValue (uint64_t Value, unsigned Encoding) const
Emit an integer value corresponding to the call site encoding.
virtual unsigned
Get the value for DW_AT_APPLE_isa. Zero if no isa encoding specified.
virtual void
emitDebugValue (const MCExpr *Value, unsigned Size) const
Emit the directive and value for debug thread local expression.
void
emitCFIInstruction (const MCCFIInstruction &Inst) const
Emit frame instruction to describe the layout of the frame.
template<typename T>
void
emitDwarfAbbrevs (const T &Abbrevs) const
Emit Dwarf abbreviation table.
void
emitDwarfAbbrev (const DIEAbbrev &Abbrev) const
void
emitDwarfDIE (const DIE &Die) const
Recursively emit Dwarf DIE tree.
virtual std::tuple< const MCSymbol *, uint64_t, const MCSymbol *, codeview::JumpTableEntrySize >
getCodeViewJumpTableInfo (int JTI, const MachineInstr *BranchInstr, const MCSymbol *BranchLabel) const
Gets information required to create a CodeView debug symbol for a jump table.
void
emitCOFFReplaceableFunctionData (Module &M)
Emits symbols and data to allow functions marked with the loader-replaceable attribute to be replaceable.
void
emitCOFFFeatureSymbol (Module &M)
Emits the @feat.00 symbol indicating the features enabled in this module.
virtual void
PrintSpecial (const MachineInstr *MI, raw_ostream &OS, StringRef Code) const
Print information related to the specified machine instr that is independent of the operand, and may be independent of the instr itself.
virtual void
PrintSymbolOperand (const MachineOperand &MO, raw_ostream &OS)
Print the MachineOperand as a symbol.
virtual void
Let the target do anything it needs to do before emitting inlineasm.
virtual void
emitInlineAsmEnd (const MCSubtargetInfo &StartInfo, const MCSubtargetInfo *EndInfo) const
Let the target do anything it needs to do after emitting inlineasm.
void
emitVisibility (MCSymbol *Sym, unsigned Visibility, bool IsDefinition=true) const
This emits visibility information about symbol, if this is supported by the target.
virtual void
emitLinkage (const GlobalValue *GV, MCSymbol *GVSym) const
This emits linkage information about GVSym based on GV, if this is supported by the target.
Public Member Functions inherited from llvm::FunctionPass
FunctionPass (char &pid)
void
assignPassManager (PMStack &PMS, PassManagerType T) override
Find appropriate Function Pass Manager or Call Graph Pass Manager in the PM Stack and add self into that manager.
getPotentialPassManagerType () const override
Return what kind of Pass Manager can manage this pass.
Public Member Functions inherited from llvm::Pass
Pass &
operator= (const Pass &)=delete
virtual
~Pass ()
getPassKind () const
Return a nice clean name for a pass corresponding to that used to enable the pass in opt.
getPassID - Return the PassID number that corresponds to this pass.
virtual void
print (raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
void
virtual void
preparePassManager (PMStack &)
Check if available pass managers are suitable for this pass or not.
void
setResolver (AnalysisResolver *AR)
getResolver () const
virtual void
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed.
virtual ImmutablePass *
virtual PMDataManager *
virtual void
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.
virtual void
dumpPassStructure (unsigned Offset=0)
template
AnalysisType *
getAnalysisIfAvailable () const
getAnalysisIfAvailable() - Subclasses use this function to get analysis information that might be around, for example to update it.
mustPreserveAnalysisID (char &AID) const
mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID.
template
AnalysisType &
getAnalysis () const
getAnalysis() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.
template
AnalysisType &
getAnalysis (Function &F, bool *Changed=nullptr)
getAnalysis() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.
template
AnalysisType &
getAnalysisID (AnalysisID PI) const
template
AnalysisType &
getAnalysisID (AnalysisID PI, Function &F, bool *Changed=nullptr)
Additional Inherited Members
Public Types inherited from llvm::AsmPrinter
enum class
CFISection : unsigned { None = 0 , EH = 1 , Debug = 2 }
enum class
SledKind : uint8_t {
FUNCTION_ENTER = 0 , FUNCTION_EXIT = 1 , TAIL_CALL = 2 , LOG_ARGS_ENTER = 3 ,
CUSTOM_EVENT = 4 , TYPED_EVENT = 5
}
using
GOTEquivUsePair = std::pair<const GlobalVariable *, unsigned>
Map global GOT equivalent MCSymbols to GlobalVariables and keep track of its number of uses by other globals.
using
AliasMapTy = DenseMap<uint64_t, SmallVector<const GlobalAlias *, 1>>
Print a general LLVM constant to the .s file.
Static Public Member Functions inherited from llvm::AsmPrinter
static Align
getGVAlignment (const GlobalObject *GV, const DataLayout &DL, Align InAlign=Align(1))
Return the alignment for the specified GV.
Static Public Member Functions inherited from llvm::Pass
lookupPassInfo (const void *TI)
lookupPassInfo (StringRef Arg)
static Pass *
Public Attributes inherited from llvm::AsmPrinter
Target machine description.
MAI = nullptr
Target Asm Printer information.
This is the context for the output file that we are streaming.
std::unique_ptr< MCStreamer >
This is the MCStreamer object for the file we are generating.
IntrusiveRefCntPtr< vfs::FileSystem >
The VFS to resolve asm include directives.
MF = nullptr
The current machine function.
MMI = nullptr
This is a pointer to the current MachineModuleInfo.
MDT = nullptr
This is a pointer to the current MachineDominatorTree.
MLI = nullptr
This is a pointer to the current MachineLoopInfo.
MachineOptimizationRemarkEmitter *
ORE = nullptr
Optimization remark emitter.
MCSymbol *
CurrentPatchableFunctionEntrySym = nullptr
The symbol for the entry in __patchable_function_entires.
MCSymbol *
CurrentFnSym = nullptr
The symbol for the current function.
MCSymbol *
CurrentFnDescSym = nullptr
The symbol for the current function descriptor on AIX.
MCSymbol *
CurrentFnSymForSize = nullptr
The symbol used to represent the start of the current function for the purpose of calculating its size (e.g.
DenseMap< const MachineBasicBlock *, SmallVector< MCSymbol *, 1 > >
Vector of symbols marking the end of the callsites in the current function, keyed by their containing basic block.
SDPI = nullptr
Provides the profile information for constants.
PSI = nullptr
The profile summary information.
MapVector< MBBSectionID, MBBSectionRange >
MapVector< const MCSymbol *, GOTEquivUsePair >
SmallVector< XRayFunctionEntry, 4 >
Protected Attributes inherited from llvm::AsmPrinter
MCSymbol *
CurrentFnBegin = nullptr
MCSymbol *
CurrentFnBeginLocal = nullptr
For dso_local functions, the current $local alias for the function.
SmallVector< std::unique_ptr< AsmPrinterHandler >, 1 >
A handle to the EH info emitter (if present).
SmallVector< std::unique_ptr< AsmPrinterHandler >, 2 >
size_t
NumUserHandlers = 0
Definition at line 62 of file NVPTXAsmPrinter.h.