LLVM 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
llvm::AsmPrinter Class Reference

This class is intended to be used as a driving class for all asm writers. More...

#include "llvm/CodeGen/AsmPrinter.h"

Inheritance diagram for llvm::AsmPrinter:
Inheritance graph
[legend]

Classes

struct  MBBSectionRange
 Map a basic block section ID to the begin and end symbols of that section which determine the section's range. More...
 
struct  Structor
 llvm.global_ctors and llvm.global_dtors are arrays of Structor structs. More...
 
struct  XRayFunctionEntry
 

Public Types

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.
 

Public Member Functions

 ~AsmPrinter () override
 
DwarfDebuggetDwarfDebug ()
 
DwarfDebuggetDwarfDebug () const
 
uint16_t getDwarfVersion () const
 
void setDwarfVersion (uint16_t Version)
 
bool isDwarf64 () const
 
unsigned int getDwarfOffsetByteSize () const
 Returns 4 for DWARF32 and 8 for DWARF64.
 
unsigned int getUnitLengthFieldByteSize () const
 Returns 4 for DWARF32 and 12 for DWARF64.
 
dwarf::FormParams getDwarfFormParams () const
 Returns information about the byte size of DW_FORM values.
 
bool isPositionIndependent () const
 
bool isVerbose () const
 Return true if assembly output should contain comments.
 
unsigned getFunctionNumber () const
 Return a unique ID for the current function.
 
virtual const MCSymbolgetFunctionFrameSymbol () const
 Return symbol for the function pseudo stack if the stack frame is not a register based.
 
MCSymbolgetFunctionBegin () const
 
MCSymbolgetFunctionEnd () const
 
MCSymbolgetMBBExceptionSym (const MachineBasicBlock &MBB)
 
MCSymbolgetAddrLabelSymbol (const BasicBlock *BB)
 Return the symbol to be used for the specified basic block when its address is taken.
 
ArrayRef< MCSymbol * > getAddrLabelSymbolToEmit (const BasicBlock *BB)
 Return the symbol to be used for the specified basic block when its address is taken.
 
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 TargetLoweringObjectFilegetObjFileLowering () const
 Return information about object file lowering.
 
const DataLayoutgetDataLayout () const
 Return information about data layout.
 
unsigned getPointerSize () const
 Return the pointer size from the TargetMachine.
 
const MCSubtargetInfogetSubtargetInfo () const
 Return information about subtarget.
 
void EmitToStreamer (MCStreamer &S, const MCInst &Inst)
 
void emitInitialRawDwarfLocDirective (const MachineFunction &MF)
 Emits inital debug location directive.
 
const MCSectiongetCurrentSection () const
 Return the current section we are emitting to.
 
void getNameWithPrefix (SmallVectorImpl< char > &Name, const GlobalValue *GV) const
 
MCSymbolgetSymbol (const GlobalValue *GV) const
 
MCSymbolgetSymbolPreferLocal (const GlobalValue &GV) const
 Similar to getSymbol() but preferred for references.
 
bool doesDwarfUseRelocationsAcrossSections () const
 
void setDwarfUsesRelocationsAcrossSections (bool Enable)
 
void recordSled (MCSymbol *Sled, const MachineInstr &MI, SledKind Kind, uint8_t Version=0)
 
void emitXRayTable ()
 Emit a table with all XRay instrumentation points.
 
void emitPatchableFunctionEntries ()
 
void getAnalysisUsage (AnalysisUsage &AU) const override
 Record analysis usage.
 
bool doInitialization (Module &M) override
 Set up the AsmPrinter when we are working on a new module.
 
bool doFinalization (Module &M) override
 Shut down the asmprinter.
 
bool runOnMachineFunction (MachineFunction &MF) override
 Emit the specified function out to the OutStreamer.
 
virtual void SetupMachineFunction (MachineFunction &MF)
 This should be called when a new MachineFunction is being processed from runOnMachineFunction.
 
void emitFunctionBody ()
 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 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.
 
CFISection getFunctionCFISectionType (const Function &F) const
 Get the CFISection type for a function.
 
CFISection getFunctionCFISectionType (const MachineFunction &MF) const
 Get the CFISection type for a function.
 
CFISection getModuleCFISectionType () const
 Get the CFISection type for the module.
 
bool hasDebugInfo () const
 Returns true if valid debug info is present.
 
bool needsSEHMoves ()
 
bool usesCFIWithoutEH () const
 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 emitConstantPool ()
 Print to the current output stream assembly representations of the constants in the constant pool MCP.
 
virtual void emitJumpTableInfo ()
 Print assembly representations of the jump tables used by the current function to the current output stream.
 
virtual void emitGlobalVariable (const GlobalVariable *GV)
 Emit the specified global variable to the .s file.
 
bool 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.
 
virtual const MCExprlowerConstant (const Constant *CV)
 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 emitGlobalGOTEquivs ()
 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 emitStackMaps ()
 Emit the stack maps.
 
void addAsmPrinterHandler (std::unique_ptr< AsmPrinterHandler > Handler)
 
void addDebugHandler (std::unique_ptr< DebugHandlerBase > Handler)
 
virtual void emitStartOfAsmFile (Module &)
 This virtual method can be overridden by targets that want to emit something at the start of their file.
 
virtual void emitEndOfAsmFile (Module &)
 This virtual method can be overridden by targets that want to emit something at the end of their file.
 
virtual void emitFunctionBodyStart ()
 Targets can override this to emit stuff before the first basic block in the function.
 
virtual void emitFunctionBodyEnd ()
 Targets can override this to emit stuff after the last basic block in the function.
 
virtual void emitBasicBlockStart (const MachineBasicBlock &MBB)
 Targets can override this to emit stuff at the start of a basic block.
 
virtual void emitBasicBlockEnd (const MachineBasicBlock &MBB)
 Targets can override this to emit stuff at the end of a basic block.
 
virtual void emitInstruction (const MachineInstr *)
 Targets should implement this to emit instructions.
 
virtual MCSymbolGetCPISymbol (unsigned CPID) const
 Return the symbol for the specified constant pool entry.
 
virtual void emitFunctionEntryLabel ()
 EmitFunctionEntryLabel - Emit the label that is the entrypoint for the function.
 
virtual void emitFunctionDescriptor ()
 
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.
 
virtual const MCExprlowerConstantPtrAuth (const ConstantPtrAuth &CPA)
 
virtual const MCExprlowerBlockAddressConstant (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 void emitImplicitDef (const MachineInstr *MI) const
 Targets can override this to customize the output of IMPLICIT_DEF instructions in verbose mode.
 
virtual const MCSubtargetInfogetIFuncMCSubtargetInfo () 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 emitNops (unsigned N)
 Emit N NOP instructions.
 
MCSymbolcreateTempSymbol (const Twine &Name) const
 
MCSymbolgetSymbolWithGlobalValueBase (const GlobalValue *GV, StringRef Suffix) const
 Return the MCSymbol for a private symbol with global value name as its base, with the specified suffix.
 
MCSymbolGetExternalSymbolSymbol (Twine Sym) const
 Return the MCSymbol for the specified ExternalSymbol.
 
MCSymbolGetJTISymbol (unsigned JTID, bool isLinkerPrivate=false) const
 Return the symbol for the specified jump table entry.
 
MCSymbolGetJTSetSymbol (unsigned UID, unsigned MBBID) const
 Return the symbol for the specified jump table .set FIXME: privatize to AsmPrinter.
 
MCSymbolGetBlockAddressSymbol (const BlockAddress *BA) const
 Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block.
 
MCSymbolGetBlockAddressSymbol (const BasicBlock *BB) const
 
void printOffset (int64_t Offset, raw_ostream &OS) const
 This is just convenient handler for printing offsets.
 
void emitInt8 (int Value) const
 Emit a byte directive and value.
 
void emitInt16 (int Value) const
 Emit a short directive and value.
 
void emitInt32 (int Value) const
 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.
 
unsigned 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.
 
MCSymbolemitDwarfUnitLength (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 getISAEncoding ()
 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::JumpTableEntrySizegetCodeViewJumpTableInfo (int JTI, const MachineInstr *BranchInstr, const MCSymbol *BranchLabel) const
 Gets information required to create a CodeView debug symbol for a jump table.
 
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 bool PrintAsmOperand (const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
 Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
 
virtual bool PrintAsmMemoryOperand (const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
 Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as an address.
 
virtual void emitInlineAsmStart () const
 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::MachineFunctionPass
bool doInitialization (Module &) override
 doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run.
 
- Public Member Functions inherited from llvm::FunctionPass
 FunctionPass (char &pid)
 
PasscreatePrinterPass (raw_ostream &OS, const std::string &Banner) const override
 createPrinterPass - Get a function printer pass.
 
virtual bool runOnFunction (Function &F)=0
 runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
 
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.
 
PassManagerType getPotentialPassManagerType () const override
 Return what kind of Pass Manager can manage this pass.
 
- Public Member Functions inherited from llvm::Pass
 Pass (PassKind K, char &pid)
 
 Pass (const Pass &)=delete
 
Passoperator= (const Pass &)=delete
 
virtual ~Pass ()
 
PassKind getPassKind () const
 
virtual StringRef getPassName () const
 getPassName - Return a nice clean name for a pass.
 
AnalysisID getPassID () const
 getPassID - Return the PassID number that corresponds to this pass.
 
virtual bool doInitialization (Module &)
 doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run.
 
virtual bool doFinalization (Module &)
 doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run.
 
virtual void print (raw_ostream &OS, const Module *M) const
 print - Print out the internal state of the pass.
 
void dump () const
 
virtual PasscreatePrinterPass (raw_ostream &OS, const std::string &Banner) const =0
 createPrinterPass - Get a Pass appropriate to print the IR this pass operates on (Module, Function or MachineFunction).
 
virtual void assignPassManager (PMStack &, PassManagerType)
 Each pass is responsible for assigning a pass manager to itself.
 
virtual void preparePassManager (PMStack &)
 Check if available pass managers are suitable for this pass or not.
 
virtual PassManagerType getPotentialPassManagerType () const
 Return what kind of Pass Manager can manage this pass.
 
void setResolver (AnalysisResolver *AR)
 
AnalysisResolvergetResolver () const
 
virtual void getAnalysisUsage (AnalysisUsage &) const
 getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job.
 
virtual void releaseMemory ()
 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 void * getAdjustedAnalysisPointer (AnalysisID ID)
 getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through multiple inheritance.
 
virtual ImmutablePassgetAsImmutablePass ()
 
virtual PMDataManagergetAsPMDataManager ()
 
virtual void verifyAnalysis () const
 verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.
 
virtual void dumpPassStructure (unsigned Offset=0)
 
template<typename AnalysisType >
AnalysisType * getAnalysisIfAvailable () const
 getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information that might be around, for example to update it.
 
bool mustPreserveAnalysisID (char &AID) const
 mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID.
 
template<typename AnalysisType >
AnalysisType & getAnalysis () const
 getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.
 
template<typename AnalysisType >
AnalysisType & getAnalysis (Function &F, bool *Changed=nullptr)
 getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI) const
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI, Function &F, bool *Changed=nullptr)
 

Static Public Member Functions

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
static const PassInfolookupPassInfo (const void *TI)
 
static const PassInfolookupPassInfo (StringRef Arg)
 
static PasscreatePass (AnalysisID ID)
 

Public Attributes

TargetMachineTM
 Target machine description.
 
const MCAsmInfoMAI = nullptr
 Target Asm Printer information.
 
MCContextOutContext
 This is the context for the output file that we are streaming.
 
std::unique_ptr< MCStreamerOutStreamer
 This is the MCStreamer object for the file we are generating.
 
MachineFunctionMF = nullptr
 The current machine function.
 
MachineModuleInfoMMI = nullptr
 This is a pointer to the current MachineModuleInfo.
 
MachineDominatorTreeMDT = nullptr
 This is a pointer to the current MachineDominatorTree.
 
MachineLoopInfoMLI = nullptr
 This is a pointer to the current MachineLoopInfo.
 
MachineOptimizationRemarkEmitterORE = nullptr
 Optimization remark emitter.
 
MCSymbolCurrentPatchableFunctionEntrySym = nullptr
 The symbol for the entry in __patchable_function_entires.
 
MCSymbolCurrentFnSym = nullptr
 The symbol for the current function.
 
MCSymbolCurrentFnDescSym = nullptr
 The symbol for the current function descriptor on AIX.
 
MCSymbolCurrentFnSymForSize = nullptr
 The symbol used to represent the start of the current function for the purpose of calculating its size (e.g.
 
MapVector< MBBSectionID, MBBSectionRangeMBBSectionRanges
 
MapVector< const MCSymbol *, GOTEquivUsePairGlobalGOTEquivs
 
SmallVector< XRayFunctionEntry, 4 > Sleds
 

Protected Member Functions

 AsmPrinter (TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
 
virtual void emitGlobalAlias (const Module &M, const GlobalAlias &GA)
 
virtual bool shouldEmitWeakSwiftAsyncExtendedFramePointerFlags () const
 
- Protected Member Functions inherited from llvm::MachineFunctionPass
 MachineFunctionPass (char &ID)
 
virtual bool runOnMachineFunction (MachineFunction &MF)=0
 runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
 
void getAnalysisUsage (AnalysisUsage &AU) const override
 getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
 
virtual MachineFunctionProperties getRequiredProperties () const
 
virtual MachineFunctionProperties getSetProperties () const
 
virtual MachineFunctionProperties getClearedProperties () const
 
- Protected Member Functions inherited from llvm::FunctionPass
bool skipFunction (const Function &F) const
 Optional passes call this function to check whether the pass should be skipped.
 

Protected Attributes

MCSymbolCurrentFnBegin = nullptr
 
MCSymbolCurrentFnBeginLocal = nullptr
 For dso_local functions, the current $local alias for the function.
 
SmallVector< std::unique_ptr< AsmPrinterHandler >, 2 > Handlers
 A vector of all debug/EH info emitters we should use.
 
size_t NumUserHandlers = 0
 
SmallVector< std::unique_ptr< DebugHandlerBase >, 1 > DebugHandlers
 Debuginfo handler. Protected so that targets can add their own.
 
size_t NumUserDebugHandlers = 0
 
StackMaps SM
 

Detailed Description

This class is intended to be used as a driving class for all asm writers.

Definition at line 86 of file AsmPrinter.h.

Member Typedef Documentation

◆ AliasMapTy

Print a general LLVM constant to the .s file.

On AIX, when an alias refers to a sub-element of a global variable, the label of that alias needs to be emitted before the corresponding element.

Definition at line 502 of file AsmPrinter.h.

◆ GOTEquivUsePair

Map global GOT equivalent MCSymbols to GlobalVariables and keep track of its number of uses by other globals.

Definition at line 144 of file AsmPrinter.h.

Member Enumeration Documentation

◆ CFISection

Enumerator
None 

Do not emit either .eh_frame or .debug_frame.

EH 

Emit .eh_frame.

Debug 

Emit .debug_frame.

Definition at line 148 of file AsmPrinter.h.

◆ SledKind

enum class llvm::AsmPrinter::SledKind : uint8_t
strong
Enumerator
FUNCTION_ENTER 
FUNCTION_EXIT 
TAIL_CALL 
LOG_ARGS_ENTER 
CUSTOM_EVENT 
TYPED_EVENT 

Definition at line 335 of file AsmPrinter.h.

Constructor & Destructor Documentation

◆ AsmPrinter()

AsmPrinter::AsmPrinter ( TargetMachine TM,
std::unique_ptr< MCStreamer Streamer 
)
explicitprotected

◆ ~AsmPrinter()

AsmPrinter::~AsmPrinter ( )
override

Definition at line 369 of file AsmPrinter.cpp.

References assert(), Handlers, and NumUserHandlers.

Member Function Documentation

◆ addAsmPrinterHandler()

void AsmPrinter::addAsmPrinterHandler ( std::unique_ptr< AsmPrinterHandler Handler)

Definition at line 4171 of file AsmPrinter.cpp.

References Handlers, and NumUserHandlers.

◆ addDebugHandler()

void AsmPrinter::addDebugHandler ( std::unique_ptr< DebugHandlerBase Handler)

Definition at line 4177 of file AsmPrinter.cpp.

References DebugHandlers, and NumUserDebugHandlers.

◆ computeGlobalGOTEquivs()

void AsmPrinter::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.

Unnamed constant global variables solely contaning a pointer to another globals variable is equivalent to a GOT table entry; it contains the the address of another symbol.

One optimization is to replace accesses to these proxies by using the GOT entry for the final global instead. Hence, we select GOT equivalent candidates among all the module global variables, avoid emitting them unnecessarily and finally replace references to them by pc relative accesses to GOT entries.

Optimize it and replace accesses to these "GOT equivalents" by using the GOT entry for the final global instead. Compute GOT equivalent candidates among all global variables to avoid emitting them if possible later on, after it use is replaced by a GOT entry access.

Definition at line 2061 of file AsmPrinter.cpp.

References G, getObjFileLowering(), getSymbol(), GlobalGOTEquivs, and isGOTEquivalentCandidate().

Referenced by doFinalization().

◆ createTempSymbol()

MCSymbol * AsmPrinter::createTempSymbol ( const Twine Name) const

◆ doesDwarfUseRelocationsAcrossSections()

bool llvm::AsmPrinter::doesDwarfUseRelocationsAcrossSections ( ) const
inline

◆ doFinalization()

bool AsmPrinter::doFinalization ( Module M)
overridevirtual

Shut down the asmprinter.

If you override this in your pass, you must make sure to call it explicitly.

Reimplemented from llvm::Pass.

Reimplemented in llvm::AMDGPUAsmPrinter, llvm::AVRAsmPrinter, and llvm::NVPTXAsmPrinter.

Definition at line 2281 of file AsmPrinter.cpp.

References assert(), llvm::SmallVectorImpl< T >::clear(), computeGlobalGOTEquivs(), llvm::MCSymbolRefExpr::create(), DebugHandlers, llvm::GlobalValue::DefaultVisibility, DL, llvm::TargetOptions::EmitAddrsig, emitAlignment(), emitEndOfAsmFile(), emitGlobalAlias(), emitGlobalGOTEquivs(), emitGlobalVariable(), emitLinkage(), llvm::TargetLoweringObjectFile::emitModuleMetadata(), emitRemarksSection(), emitStackMaps(), emitVisibility(), llvm::GlobalValue::ExternalWeakLinkage, F, G, llvm::MCAsmInfo::getCodePointerSize(), llvm::MCContext::getCOFFSection(), llvm::MCObjectFileInfo::getDataSection(), llvm::MCContext::getELFSection(), llvm::TargetLoweringObjectFile::getFunctionEntryPointSymbol(), llvm::MachineModuleInfoELF::GetGVStubList(), llvm::MachineModuleInfoCOFF::GetGVStubList(), llvm::MCSymbol::getName(), llvm::MCAsmInfo::getNonexecutableStackSection(), llvm::MachineModuleInfo::getObjFileInfo(), getObjFileLowering(), getSymbol(), llvm::TargetMachine::getTargetTriple(), llvm::PointerType::getUnqual(), llvm::MCAsmInfo::getWeakRefDirective(), llvm::Global, Handlers, I, llvm::COFF::IMAGE_COMDAT_SELECT_ANY, llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA, llvm::COFF::IMAGE_SCN_LNK_COMDAT, llvm::COFF::IMAGE_SCN_MEM_READ, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::Triple::isOSBinFormatCOFF(), llvm::Triple::isOSBinFormatELF(), llvm::Triple::isOSBinFormatXCOFF(), MAI, llvm::MCSA_Global, llvm::MCSA_WeakReference, MF, MI, MMI, Name, NumUserDebugHandlers, NumUserHandlers, llvm::TargetMachine::Options, OutContext, OutStreamer, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::reverse(), shouldEmitWeakSwiftAsyncExtendedFramePointerFlags(), llvm::ELF::SHT_LLVM_SYMPART, llvm::ELF::SHT_PROGBITS, TM, and llvm::Value::use_empty().

Referenced by llvm::AMDGPUAsmPrinter::doFinalization(), llvm::AVRAsmPrinter::doFinalization(), and llvm::NVPTXAsmPrinter::doFinalization().

◆ doInitialization()

bool AsmPrinter::doInitialization ( Module M)
overridevirtual

Set up the AsmPrinter when we are working on a new module.

If your pass overrides this, it must make sure to explicitly call this implementation.

Reimplemented from llvm::Pass.

Reimplemented in llvm::AMDGPUAsmPrinter, llvm::NVPTXAsmPrinter, llvm::SystemZAsmPrinter, and llvm::X86AsmPrinter.

Definition at line 434 of file AsmPrinter.cpp.

References llvm::AIX, llvm::ARM, assert(), DebugHandlers, llvm::MCAsmInfo::doesSupportDebugInformation(), llvm::DwarfCFI, EH, emitStartOfAsmFile(), F, llvm::sys::path::filename(), llvm::MCAsmInfo::getAssemblerDialect(), llvm::MCAsmInfo::getExceptionHandlingType(), getFunctionCFISectionType(), llvm::TargetMachine::getMCAsmInfo(), llvm::TargetMachine::getMCSubtargetInfo(), getObjFileLowering(), llvm::MCSymbolXCOFF::getSymbolTableName(), llvm::TargetMachine::getTargetTriple(), llvm::MCAsmInfo::getWinEHEncodingType(), Handlers, llvm::MCAsmInfo::hasBasenameOnlyForFileDirective(), hasDebugInfo(), llvm::MCAsmInfo::hasFourStringsDotFile(), llvm::MCSymbolXCOFF::hasRename(), llvm::MCAsmInfo::hasSingleParameterDotFile(), I, llvm::WinEH::Invalid, llvm::Triple::isOSBinFormatXCOFF(), llvm::Triple::isOSWindows(), llvm::WinEH::Itanium, llvm_unreachable, MAI, llvm::TargetOptions::MCOptions, MI, MMI, None, llvm::None, llvm::TargetMachine::Options, OutContext, OutStreamer, llvm::PseudoProbeDescMetadataName, llvm::SjLj, TM, usesCFIWithoutEH(), llvm::Wasm, llvm::WinEH, llvm::WinEH::X86, and llvm::ZOS.

Referenced by llvm::AMDGPUAsmPrinter::doInitialization(), and llvm::NVPTXAsmPrinter::doInitialization().

◆ emitAlignment()

void AsmPrinter::emitAlignment ( Align  Alignment,
const GlobalObject GV = nullptr,
unsigned  MaxBytesToEmit = 0 
) const

◆ emitBasicBlockEnd()

void AsmPrinter::emitBasicBlockEnd ( const MachineBasicBlock MBB)
virtual

Targets can override this to emit stuff at the end of a basic block.

Reimplemented in llvm::MipsAsmPrinter, and llvm::X86AsmPrinter.

Definition at line 4036 of file AsmPrinter.cpp.

References DebugHandlers, Handlers, llvm::MachineBasicBlock::isEndSection(), and MBB.

Referenced by llvm::MipsAsmPrinter::emitBasicBlockEnd(), llvm::X86AsmPrinter::emitBasicBlockEnd(), and emitFunctionBody().

◆ emitBasicBlockStart()

void AsmPrinter::emitBasicBlockStart ( const MachineBasicBlock MBB)
virtual

Targets can override this to emit stuff at the start of a basic block.

emitBasicBlockStart - This method prints the label for the specified MachineBasicBlock, an alignment (if present) and a comment describing it if appropriate.

By default, this method prints the label for the specified MachineBasicBlock, an alignment (if present) and a comment describing it if appropriate.

Reimplemented in llvm::AMDGPUAsmPrinter.

Definition at line 3950 of file AsmPrinter.cpp.

References assert(), DebugHandlers, emitAlignment(), emitBasicBlockLoopComments(), llvm::MachineBasicBlock::getAddressTakenIRBlock(), getAddrLabelSymbolToEmit(), llvm::MachineBasicBlock::getAlignment(), llvm::MachineBasicBlock::getBasicBlock(), llvm::MachineBasicBlock::getEHCatchretSymbol(), llvm::MCAsmInfo::getExceptionHandlingType(), llvm::MachineFunction::getFunction(), llvm::MachineBasicBlock::getMaxBytesForAlignment(), llvm::MachineBasicBlock::getNumber(), getObjFileLowering(), llvm::MachineBasicBlock::getSymbol(), Handlers, llvm::BasicBlock::hasAddressTaken(), llvm::MachineBasicBlock::hasLabelMustBeEmitted(), llvm::MachineBasicBlock::isBeginSection(), llvm::MachineBasicBlock::isEHCatchretTarget(), llvm::MachineBasicBlock::isEHFuncletEntry(), llvm::MachineBasicBlock::isEntryBlock(), llvm::MachineBasicBlock::isIRBlockAddressTaken(), llvm::MachineBasicBlock::isMachineBlockAddressTaken(), isVerbose(), MAI, MBB, MF, MLI, OutStreamer, Sym, TM, and llvm::WinEH.

Referenced by llvm::AMDGPUAsmPrinter::emitBasicBlockStart(), and emitFunctionBody().

◆ emitBBAddrMapSection()

void AsmPrinter::emitBBAddrMapSection ( const MachineFunction MF)

◆ emitCallSiteOffset()

void AsmPrinter::emitCallSiteOffset ( const MCSymbol Hi,
const MCSymbol Lo,
unsigned  Encoding 
) const

Emit reference to a call site with a specified encoding.

Definition at line 185 of file AsmPrinterDwarf.cpp.

References llvm::dwarf::DW_EH_PE_uleb128, emitLabelDifference(), emitLabelDifferenceAsULEB128(), GetSizeOfEncodedValue(), llvm::Hi, and llvm::Lo.

Referenced by llvm::EHStreamer::emitExceptionTable().

◆ emitCallSiteValue()

void AsmPrinter::emitCallSiteValue ( uint64_t  Value,
unsigned  Encoding 
) const

Emit an integer value corresponding to the call site encoding.

Definition at line 194 of file AsmPrinterDwarf.cpp.

References llvm::dwarf::DW_EH_PE_uleb128, emitULEB128(), GetSizeOfEncodedValue(), and OutStreamer.

Referenced by llvm::EHStreamer::emitExceptionTable().

◆ emitCFIInstruction() [1/2]

void AsmPrinter::emitCFIInstruction ( const MachineInstr MI)

◆ emitCFIInstruction() [2/2]

void AsmPrinter::emitCFIInstruction ( const MCCFIInstruction Inst) const

◆ emitConstantPool()

void AsmPrinter::emitConstantPool ( )
virtual

◆ emitDebugValue()

void AsmPrinter::emitDebugValue ( const MCExpr Value,
unsigned  Size 
) const
virtual

Emit the directive and value for debug thread local expression.

Value - The value to emit. Size - The size of the integer (in bytes) to emit.

Value - The value to emit. Size - The size of the integer (in bytes) to emit.

Reimplemented in llvm::MipsAsmPrinter.

Definition at line 895 of file AsmPrinter.cpp.

References OutStreamer, and Size.

Referenced by llvm::MipsAsmPrinter::emitDebugValue(), and llvm::DIEExpr::emitValue().

◆ emitDwarfAbbrev()

void AsmPrinter::emitDwarfAbbrev ( const DIEAbbrev Abbrev) const

◆ emitDwarfAbbrevs()

template<typename T >
void llvm::AsmPrinter::emitDwarfAbbrevs ( const T Abbrevs) const
inline

Emit Dwarf abbreviation table.

Definition at line 772 of file AsmPrinter.h.

References emitDwarfAbbrev(), and emitULEB128().

Referenced by llvm::DIEAbbrevSet::Emit().

◆ emitDwarfDIE()

void AsmPrinter::emitDwarfDIE ( const DIE Die) const

◆ emitDwarfLengthOrOffset()

void AsmPrinter::emitDwarfLengthOrOffset ( uint64_t  Value) const

Emit 32- or 64-bit value depending on the DWARF format.

Definition at line 170 of file AsmPrinterDwarf.cpp.

References assert(), getDwarfOffsetByteSize(), isDwarf64(), and OutStreamer.

Referenced by llvm::DwarfUnit::emitCommonHeader(), and llvm::DwarfTypeUnit::emitHeader().

◆ emitDwarfOffset()

void AsmPrinter::emitDwarfOffset ( const MCSymbol Label,
uint64_t  Offset 
) const

Emit something like ".long Label + Offset" or ".quad Label + Offset" depending on the DWARF format.

Definition at line 166 of file AsmPrinterDwarf.cpp.

References emitLabelPlusOffset(), getDwarfOffsetByteSize(), and llvm::Offset.

◆ emitDwarfStringOffset() [1/2]

void AsmPrinter::emitDwarfStringOffset ( DwarfStringPoolEntry  S) const

Emit the 4- or 8-byte offset of a string from the start of its section.

When possible, emit a DwarfStringPool section offset without any relocations, and without using the symbol. Otherwise, defers to emitDwarfSymbolReference().

The length of the emitted value depends on the DWARF format.

Definition at line 155 of file AsmPrinterDwarf.cpp.

References assert(), doesDwarfUseRelocationsAcrossSections(), emitDwarfSymbolReference(), getDwarfOffsetByteSize(), llvm::DwarfStringPoolEntry::Offset, OutStreamer, and llvm::DwarfStringPoolEntry::Symbol.

Referenced by emitDwarfStringOffset().

◆ emitDwarfStringOffset() [2/2]

void llvm::AsmPrinter::emitDwarfStringOffset ( DwarfStringPoolEntryRef  S) const
inline

Emit the 4-or 8-byte offset of a string from the start of its section.

Definition at line 728 of file AsmPrinter.h.

References emitDwarfStringOffset(), and llvm::DwarfStringPoolEntryRef::getEntry().

◆ emitDwarfSymbolReference()

void AsmPrinter::emitDwarfSymbolReference ( const MCSymbol Label,
bool  ForceOffset = false 
) const

Emit a reference to a symbol for use in dwarf.

Different object formats represent this in different ways. Some use a relocation others encode the label offset in its section.

Definition at line 132 of file AsmPrinterDwarf.cpp.

References assert(), doesDwarfUseRelocationsAcrossSections(), emitLabelDifference(), getDwarfOffsetByteSize(), isDwarf64(), MAI, llvm::MCAsmInfo::needsDwarfSectionOffsetDirective(), and OutStreamer.

Referenced by llvm::DwarfUnit::emitCommonHeader(), emitDwarfStringOffset(), and llvm::DIELocList::emitValue().

◆ emitDwarfUnitLength() [1/2]

MCSymbol * AsmPrinter::emitDwarfUnitLength ( const Twine Prefix,
const Twine Comment 
) const

Emit a unit length field.

The actual format, DWARF32 or DWARF64, is chosen according to the settings. Return the end symbol generated inside, the caller needs to emit it.

Definition at line 180 of file AsmPrinterDwarf.cpp.

References OutStreamer.

◆ emitDwarfUnitLength() [2/2]

void AsmPrinter::emitDwarfUnitLength ( uint64_t  Length,
const Twine Comment 
) const

Emit a unit length field.

The actual format, DWARF32 or DWARF64, is chosen according to the settings.

Definition at line 175 of file AsmPrinterDwarf.cpp.

References llvm::Length, and OutStreamer.

Referenced by llvm::DwarfUnit::emitCommonHeader().

◆ emitEncodingByte()

void AsmPrinter::emitEncodingByte ( unsigned  Val,
const char Desc = nullptr 
) const

Emit a .byte 42 directive that corresponds to an encoding.

EmitEncodingByte - Emit a .byte 42 directive that corresponds to an encoding.

If verbose assembly output is enabled, we output comments describing the encoding. Desc is a string saying what the encoding is specifying (e.g. "LSDA").

If verbose assembly output is enabled, we output comments describing the encoding. Desc is an optional string saying what the encoding is specifying (e.g. "LSDA").

Definition at line 90 of file AsmPrinterDwarf.cpp.

References DecodeDWARFEncoding(), isVerbose(), and OutStreamer.

Referenced by llvm::EHStreamer::emitExceptionTable().

◆ emitEndOfAsmFile()

virtual void llvm::AsmPrinter::emitEndOfAsmFile ( Module )
inlinevirtual

This virtual method can be overridden by targets that want to emit something at the end of their file.

Reimplemented in llvm::AMDGPUAsmPrinter, llvm::ARMAsmPrinter, llvm::CSKYAsmPrinter, llvm::HexagonAsmPrinter, llvm::M68kAsmPrinter, llvm::MipsAsmPrinter, llvm::SystemZAsmPrinter, llvm::WebAssemblyAsmPrinter, and llvm::X86AsmPrinter.

Definition at line 541 of file AsmPrinter.h.

Referenced by doFinalization().

◆ emitFrameAlloc()

void AsmPrinter::emitFrameAlloc ( const MachineInstr MI)

Definition at line 1324 of file AsmPrinter.cpp.

References llvm::MCConstantExpr::create(), MI, OutContext, and OutStreamer.

Referenced by emitFunctionBody().

◆ emitFunctionBody()

void AsmPrinter::emitFunctionBody ( )

This method emits the body and trailer for a function.

EmitFunctionBody - This method emits the body and trailer for a function.

Definition at line 1686 of file AsmPrinter.cpp.

References A, llvm::MachineOptimizationRemarkEmitter::allowExtraAnalysis(), assert(), B, llvm::MachineFunction::back(), llvm::TargetOptions::BBAddrMap, llvm::MachineBasicBlock::begin(), llvm::MCSymbolRefExpr::create(), llvm::MCBinaryExpr::createSub(), createTempSymbol(), CurrentFnBegin, CurrentFnBeginLocal, CurrentFnSym, CurrentFnSymForSize, DEBUG_TYPE, DebugHandlers, llvm::MachineOptimizationRemarkEmitter::emit(), emitBasicBlockEnd(), emitBasicBlockStart(), emitBBAddrMapSection(), emitCFIInstruction(), emitComments(), emitDebugLabelComment(), emitDebugValueComment(), emitFrameAlloc(), emitFunctionBodyEnd(), emitFunctionBodyStart(), emitImplicitDef(), emitInstruction(), emitJumpTableInfo(), emitKill(), emitNops(), emitPatchableFunctionEntries(), emitPCSections(), emitPCSectionsLabel(), emitPseudoProbe(), emitStackSizeSection(), emitStackUsage(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::MachineBasicBlock::empty(), llvm::MachineBasicBlock::end(), F, llvm::MachineFunction::front(), llvm::MachineDominatorTree::getBase(), GetBlockAddressSymbol(), llvm::MachineFunction::getContext(), llvm::MachineBasicBlock::getEndSymbol(), llvm::MachineFunction::getFunction(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineModuleInfo::getModule(), llvm::Module::getModuleFlag(), llvm::MachineBasicBlock::getName(), llvm::MachineFunction::getName(), llvm::TargetInstrInfo::getNop(), llvm::MCInst::getOpcode(), llvm::MachineFunction::getSection(), llvm::MachineBasicBlock::getSectionID(), llvm::Function::getSubprogram(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), llvm::TargetMachine::getTargetTriple(), Handlers, llvm::MachineFunction::hasBBLabels(), llvm::MCAsmInfo::hasDotTypeDotSizeDirective(), llvm::MCAsmInfo::hasSubsectionsViaSymbols(), I, if(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::MachineBasicBlock::isEndSection(), isVerbose(), MAI, MBB, MBBSectionRanges, MDT, MF, MI, MLI, MMI, Name, needFuncLabels(), llvm::TargetMachine::Options, ORE, OutContext, OutStreamer, PgoAnalysisMapFeatures, llvm::MCContext::reportWarning(), llvm::MachineBasicBlock::sameSection(), llvm::MCInst::setOpcode(), llvm::sort(), Sym, and TM.

Referenced by llvm::ARMAsmPrinter::runOnMachineFunction(), runOnMachineFunction(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), llvm::R600AsmPrinter::runOnMachineFunction(), and llvm::X86AsmPrinter::runOnMachineFunction().

◆ emitFunctionBodyEnd()

virtual void llvm::AsmPrinter::emitFunctionBodyEnd ( )
inlinevirtual

Targets can override this to emit stuff after the last basic block in the function.

Reimplemented in llvm::AMDGPUAsmPrinter, llvm::ARMAsmPrinter, llvm::CSKYAsmPrinter, llvm::M68kAsmPrinter, llvm::MipsAsmPrinter, llvm::SystemZAsmPrinter, and llvm::X86AsmPrinter.

Definition at line 549 of file AsmPrinter.h.

Referenced by emitFunctionBody().

◆ emitFunctionBodyStart()

virtual void llvm::AsmPrinter::emitFunctionBodyStart ( )
inlinevirtual

Targets can override this to emit stuff before the first basic block in the function.

Reimplemented in llvm::AMDGPUAsmPrinter, llvm::M68kAsmPrinter, llvm::MipsAsmPrinter, llvm::WebAssemblyAsmPrinter, and llvm::X86AsmPrinter.

Definition at line 545 of file AsmPrinter.h.

Referenced by emitFunctionBody(), and llvm::WebAssemblyAsmPrinter::emitFunctionBodyStart().

◆ emitFunctionDescriptor()

virtual void llvm::AsmPrinter::emitFunctionDescriptor ( )
inlinevirtual

Definition at line 570 of file AsmPrinter.h.

References llvm_unreachable.

◆ emitFunctionEntryLabel()

void AsmPrinter::emitFunctionEntryLabel ( )
virtual

◆ emitGlobalAlias()

void AsmPrinter::emitGlobalAlias ( const Module M,
const GlobalAlias GA 
)
protectedvirtual

◆ emitGlobalConstant()

void AsmPrinter::emitGlobalConstant ( const DataLayout DL,
const Constant CV,
AliasMapTy AliasList = nullptr 
)

◆ emitGlobalGOTEquivs()

void AsmPrinter::emitGlobalGOTEquivs ( )

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.

Constant expressions using GOT equivalent globals may not be eligible for PC relative GOT entry conversion, in such cases we need to emit such globals we previously omitted in EmitGlobalVariable.

Definition at line 2078 of file AsmPrinter.cpp.

References emitGlobalVariable(), getObjFileLowering(), GlobalGOTEquivs, I, and llvm::SmallVectorTemplateBase< T, bool >::push_back().

Referenced by doFinalization().

◆ emitGlobalVariable()

void AsmPrinter::emitGlobalVariable ( const GlobalVariable GV)
virtual

Emit the specified global variable to the .s file.

EmitGlobalVariable - Emit the specified global variable to the .s file.

Reimplemented in llvm::AMDGPUAsmPrinter, llvm::ARMAsmPrinter, llvm::NVPTXAsmPrinter, and llvm::WebAssemblyAsmPrinter.

Definition at line 698 of file AsmPrinter.cpp.

References llvm::Triple::aarch64, assert(), llvm::MCConstantExpr::create(), DebugHandlers, DL, emitAlignment(), emitGlobalConstant(), emitLinkage(), emitSpecialLLVMGlobal(), emitVisibility(), llvm::GlobalValue::getDataLayout(), GetExternalSymbolSymbol(), getGVAlignment(), llvm::GlobalVariable::getInitializer(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::MCAsmInfo::getLCOMMDirectiveAlignmentType(), llvm::MCAsmInfo::getMemtagAttr(), llvm::MCSymbol::getName(), getObjFileLowering(), llvm::MCContext::getOrCreateSymbol(), llvm::GlobalValue::getParent(), getSymbol(), getSymbolPreferLocal(), llvm::TargetMachine::getTargetTriple(), llvm::MCObjectFileInfo::getTLSBSSSection(), llvm::MCObjectFileInfo::getTLSExtraDataSection(), llvm::GlobalValue::getType(), llvm::GlobalValue::getValueType(), llvm::GlobalValue::getVisibility(), GlobalGOTEquivs, llvm::GlobalValue::hasCommonLinkage(), llvm::MCAsmInfo::hasDotTypeDotSizeDirective(), llvm::GlobalVariable::hasInitializer(), llvm::SectionKind::isBSS(), llvm::SectionKind::isBSSLocal(), llvm::SectionKind::isCommon(), llvm::GlobalValue::isDeclaration(), llvm::MCSymbol::isDefined(), llvm::MCAsmInfo::isMachO(), llvm::GlobalValue::isTagged(), llvm::SectionKind::isThreadBSS(), llvm::SectionKind::isThreadData(), llvm::GlobalValue::isThreadLocal(), llvm::SectionKind::isThreadLocal(), llvm::MCSymbol::isVariable(), isVerbose(), llvm::MCSection::isVirtualSection(), MAI, llvm::MCSA_ELF_TypeObject, llvm::MCSA_Local, llvm::LCOMM::NoAlignment, OutContext, OutStreamer, llvm::Value::printAsOperand(), llvm::MCSymbol::redefineIfPossible(), llvm::MCContext::reportError(), llvm::TargetLoweringObjectFile::SectionForGlobal(), Size, TM, and llvm::TargetMachine::useEmulatedTLS().

Referenced by doFinalization(), emitGlobalGOTEquivs(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::ARMAsmPrinter::emitGlobalVariable(), and llvm::WebAssemblyAsmPrinter::emitGlobalVariable().

◆ emitImplicitDef()

void AsmPrinter::emitImplicitDef ( const MachineInstr MI) const
virtual

Targets can override this to customize the output of IMPLICIT_DEF instructions in verbose mode.

emitImplicitDef - This method emits the specified machine instruction that is an implicit def.

Reimplemented in llvm::AMDGPUAsmPrinter.

Definition at line 1109 of file AsmPrinter.cpp.

References llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), MF, MI, OS, OutStreamer, and llvm::printReg().

Referenced by emitFunctionBody().

◆ emitInitialRawDwarfLocDirective()

void AsmPrinter::emitInitialRawDwarfLocDirective ( const MachineFunction MF)

◆ emitInlineAsmEnd()

void AsmPrinter::emitInlineAsmEnd ( const MCSubtargetInfo StartInfo,
const MCSubtargetInfo EndInfo 
) const
virtual

Let the target do anything it needs to do after emitting inlineasm.

This callback can be used restore the original mode in case the inlineasm contains directives to switch modes. StartInfo - the original subtarget info before inline asm EndInfo - the final subtarget info after parsing the inline asm, or NULL if the value is unknown.

Reimplemented in llvm::ARMAsmPrinter.

Definition at line 519 of file AsmPrinterInlineAsm.cpp.

◆ emitInlineAsmStart()

void AsmPrinter::emitInlineAsmStart ( ) const
virtual

Let the target do anything it needs to do before emitting inlineasm.

StartInfo - the subtarget info before parsing inline asm

Definition at line 517 of file AsmPrinterInlineAsm.cpp.

◆ emitInstruction()

virtual void llvm::AsmPrinter::emitInstruction ( const MachineInstr )
inlinevirtual

◆ emitInt16()

void AsmPrinter::emitInt16 ( int  Value) const

Emit a short directive and value.

Definition at line 3037 of file AsmPrinter.cpp.

References OutStreamer.

Referenced by llvm::DwarfUnit::emitCommonHeader(), and llvm::DwarfDebug::emitDebugLocEntryLocation().

◆ emitInt32()

void AsmPrinter::emitInt32 ( int  Value) const

Emit a long directive and value.

Definition at line 3040 of file AsmPrinter.cpp.

References OutStreamer.

◆ emitInt64()

void AsmPrinter::emitInt64 ( uint64_t  Value) const

Emit a long long directive and value.

Definition at line 3059 of file AsmPrinter.cpp.

References OutStreamer.

Referenced by llvm::DwarfCompileUnit::emitHeader().

◆ emitInt8()

void AsmPrinter::emitInt8 ( int  Value) const

Emit a byte directive and value.

Definition at line 3034 of file AsmPrinter.cpp.

References OutStreamer.

Referenced by llvm::DwarfUnit::emitCommonHeader(), emitDwarfDIE(), llvm::APByteStreamer::emitInt8(), and llvm::DIEInlineString::emitValue().

◆ emitJumpTableInfo()

void AsmPrinter::emitJumpTableInfo ( )
virtual

◆ emitKCFITrapEntry()

void AsmPrinter::emitKCFITrapEntry ( const MachineFunction MF,
const MCSymbol Symbol 
)

◆ emitKCFITypeId()

void AsmPrinter::emitKCFITypeId ( const MachineFunction MF)
virtual

Reimplemented in llvm::X86AsmPrinter.

Definition at line 1491 of file AsmPrinter.cpp.

References emitGlobalConstant(), F, llvm::MachineFunction::getFunction(), and MF.

◆ emitLabelDifference()

void AsmPrinter::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.

This implicitly uses .set if it is available.

This implicitly uses .set if it avoids relocations.

Definition at line 3066 of file AsmPrinter.cpp.

References llvm::Hi, llvm::Lo, OutStreamer, and Size.

Referenced by emitCallSiteOffset(), emitDwarfSymbolReference(), emitPCSections(), and llvm::DIEDelta::emitValue().

◆ emitLabelDifferenceAsULEB128()

void AsmPrinter::emitLabelDifferenceAsULEB128 ( const MCSymbol Hi,
const MCSymbol Lo 
) const

Emit something like ".uleb128 Hi-Lo".

Definition at line 3072 of file AsmPrinter.cpp.

References llvm::Hi, llvm::Lo, and OutStreamer.

Referenced by emitBBAddrMapSection(), emitCallSiteOffset(), llvm::EHStreamer::emitExceptionTable(), and emitPCSections().

◆ emitLabelPlusOffset()

void AsmPrinter::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.

EmitLabelPlusOffset - Emit something like ".long Label+Offset" where the size in bytes of the directive is specified by Size and Label specifies the label.

This implicitly uses .set if it is available.

Definition at line 3080 of file AsmPrinter.cpp.

References llvm::MCSymbolRefExpr::create(), llvm::MCConstantExpr::create(), llvm::MCBinaryExpr::createAdd(), MAI, llvm::MCAsmInfo::needsDwarfSectionOffsetDirective(), llvm::Offset, OutContext, OutStreamer, and Size.

Referenced by emitDwarfOffset(), emitLabelReference(), and llvm::DIEEntry::emitValue().

◆ emitLabelReference()

void llvm::AsmPrinter::emitLabelReference ( const MCSymbol Label,
unsigned  Size,
bool  IsSectionRelative = false 
) const
inline

Emit something like ".long Label" where the size in bytes of the directive is specified by Size and Label specifies the label.

Definition at line 692 of file AsmPrinter.h.

References emitLabelPlusOffset(), and Size.

Referenced by llvm::BTFKindDataSec::emitType(), and llvm::DIELabel::emitValue().

◆ emitLinkage()

void AsmPrinter::emitLinkage ( const GlobalValue GV,
MCSymbol GVSym 
) const
virtual

◆ emitMachineConstantPoolValue()

void AsmPrinter::emitMachineConstantPoolValue ( MachineConstantPoolValue MCPV)
virtual

◆ emitMachOIFuncStubBody()

virtual void llvm::AsmPrinter::emitMachOIFuncStubBody ( Module M,
const GlobalIFunc GI,
MCSymbol LazyPointer 
)
inlinevirtual

Definition at line 607 of file AsmPrinter.h.

References llvm_unreachable.

◆ emitMachOIFuncStubHelperBody()

virtual void llvm::AsmPrinter::emitMachOIFuncStubHelperBody ( Module M,
const GlobalIFunc GI,
MCSymbol LazyPointer 
)
inlinevirtual

Definition at line 613 of file AsmPrinter.h.

References llvm_unreachable.

◆ emitNops()

void AsmPrinter::emitNops ( unsigned  N)

◆ emitPatchableFunctionEntries()

void AsmPrinter::emitPatchableFunctionEntries ( )

◆ emitPCSections()

void AsmPrinter::emitPCSections ( const MachineFunction MF)

◆ emitPCSectionsLabel()

void AsmPrinter::emitPCSectionsLabel ( const MachineFunction MF,
const MDNode MD 
)

Emits a label as reference for PC sections.

Definition at line 1568 of file AsmPrinter.cpp.

References llvm::MCContext::createTempSymbol(), llvm::MachineFunction::getContext(), MF, and OutStreamer.

Referenced by emitFunctionBody().

◆ emitPseudoProbe()

void AsmPrinter::emitPseudoProbe ( const MachineInstr MI)

Definition at line 1498 of file AsmPrinter.cpp.

References MI.

Referenced by emitFunctionBody().

◆ emitRemarksSection()

void AsmPrinter::emitRemarksSection ( remarks::RemarkStreamer RS)

◆ emitSLEB128()

void AsmPrinter::emitSLEB128 ( int64_t  Value,
const char Desc = nullptr 
) const

Emit the specified signed leb128 value.

EmitSLEB128 - emit the specified signed leb128 value.

Definition at line 3043 of file AsmPrinter.cpp.

References isVerbose(), and OutStreamer.

Referenced by llvm::DIEAbbrev::Emit(), llvm::EHStreamer::emitExceptionTable(), and llvm::APByteStreamer::emitSLEB128().

◆ emitSpecialLLVMGlobal()

bool AsmPrinter::emitSpecialLLVMGlobal ( const GlobalVariable GV)

◆ emitStackMaps()

void AsmPrinter::emitStackMaps ( )

Emit the stack maps.

Definition at line 4150 of file AsmPrinter.cpp.

References assert(), I, MI, llvm::StackMaps::serializeToStackMapSection(), and SM.

Referenced by doFinalization().

◆ emitStackSizeSection()

void AsmPrinter::emitStackSizeSection ( const MachineFunction MF)

◆ emitStackUsage()

void AsmPrinter::emitStackUsage ( const MachineFunction MF)

◆ emitStartOfAsmFile()

virtual void llvm::AsmPrinter::emitStartOfAsmFile ( Module )
inlinevirtual

This virtual method can be overridden by targets that want to emit something at the start of their file.

Reimplemented in llvm::AMDGPUAsmPrinter, llvm::ARMAsmPrinter, llvm::AVRAsmPrinter, llvm::CSKYAsmPrinter, llvm::HexagonAsmPrinter, llvm::M68kAsmPrinter, llvm::MipsAsmPrinter, llvm::SystemZAsmPrinter, and llvm::X86AsmPrinter.

Definition at line 537 of file AsmPrinter.h.

Referenced by doInitialization(), and llvm::SystemZAsmPrinter::emitStartOfAsmFile().

◆ EmitToStreamer()

void AsmPrinter::EmitToStreamer ( MCStreamer S,
const MCInst Inst 
)

◆ emitTTypeReference()

void AsmPrinter::emitTTypeReference ( const GlobalValue GV,
unsigned  Encoding 
)
virtual

Emit reference to a ttype global with a specified encoding.

Definition at line 121 of file AsmPrinterDwarf.cpp.

References getObjFileLowering(), GetSizeOfEncodedValue(), llvm::TargetLoweringObjectFile::getTTypeGlobalReference(), MMI, OutStreamer, and TM.

Referenced by llvm::EHStreamer::emitTypeInfos().

◆ emitULEB128()

void AsmPrinter::emitULEB128 ( uint64_t  Value,
const char Desc = nullptr,
unsigned  PadTo = 0 
) const

◆ emitVisibility()

void AsmPrinter::emitVisibility ( MCSymbol Sym,
unsigned  Visibility,
bool  IsDefinition = true 
) const

◆ emitXRayTable()

void AsmPrinter::emitXRayTable ( )

◆ emitXXStructor()

virtual void llvm::AsmPrinter::emitXXStructor ( const DataLayout DL,
const Constant CV 
)
inlinevirtual

Targets can override this to change how global constants that are part of a C++ static/global constructor list are emitted.

Reimplemented in llvm::ARMAsmPrinter, and llvm::AVRAsmPrinter.

Definition at line 578 of file AsmPrinter.h.

References DL, and emitGlobalConstant().

Referenced by llvm::AVRAsmPrinter::emitXXStructor(), and emitXXStructorList().

◆ emitXXStructorList()

void AsmPrinter::emitXXStructorList ( const DataLayout DL,
const Constant List,
bool  IsCtor 
)
virtual

◆ getAddrLabelSymbol()

MCSymbol * llvm::AsmPrinter::getAddrLabelSymbol ( const BasicBlock BB)
inline

Return the symbol to be used for the specified basic block when its address is taken.

This cannot be its normal LBB label because the block may be accessed outside its containing function.

Definition at line 276 of file AsmPrinter.h.

References getAddrLabelSymbolToEmit().

Referenced by GetBlockAddressSymbol().

◆ getAddrLabelSymbolToEmit()

ArrayRef< MCSymbol * > AsmPrinter::getAddrLabelSymbolToEmit ( const BasicBlock BB)

Return the symbol to be used for the specified basic block when its address is taken.

If other blocks were RAUW'd to this one, we may have to emit them as well, return the whole set.

Definition at line 261 of file AsmPrinter.cpp.

References OutContext.

Referenced by emitBasicBlockStart(), and getAddrLabelSymbol().

◆ getAnalysisUsage()

void AsmPrinter::getAnalysisUsage ( AnalysisUsage AU) const
overridevirtual

◆ GetBlockAddressSymbol() [1/2]

MCSymbol * AsmPrinter::GetBlockAddressSymbol ( const BasicBlock BB) const

Definition at line 3822 of file AsmPrinter.cpp.

References getAddrLabelSymbol().

◆ GetBlockAddressSymbol() [2/2]

MCSymbol * AsmPrinter::GetBlockAddressSymbol ( const BlockAddress BA) const

◆ getCodeViewJumpTableInfo()

std::tuple< const MCSymbol *, uint64_t, const MCSymbol *, codeview::JumpTableEntrySize > AsmPrinter::getCodeViewJumpTableInfo ( int  JTI,
const MachineInstr BranchInstr,
const MCSymbol BranchLabel 
) const
virtual

Gets information required to create a CodeView debug symbol for a jump table.

Return value is <Base Address, Base Offset, Branch Address, Entry Size>

Reimplemented in llvm::ARMAsmPrinter.

Definition at line 4371 of file AsmPrinter.cpp.

References llvm::sampleprof::Base, llvm::MachineModuleInfo::getContext(), llvm::TargetLowering::getPICJumpTableRelocBaseExpr(), llvm::MachineFunction::getSubtarget(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::codeview::Int32, MF, and MMI.

◆ GetCPISymbol()

MCSymbol * AsmPrinter::GetCPISymbol ( unsigned  CPID) const
virtual

Return the symbol for the specified constant pool entry.

GetCPISymbol - Return the symbol for the specified constant pool entry.

Reimplemented in llvm::ARMAsmPrinter.

Definition at line 3831 of file AsmPrinter.cpp.

References llvm::MachineConstantPoolEntry::Alignment, llvm::CallingConv::C, llvm::MachineConstantPoolEntry::ConstVal, DL, llvm::MachineFunction::getConstantPool(), llvm::MachineConstantPool::getConstants(), getDataLayout(), llvm::MachineFunction::getDataLayout(), getFunctionNumber(), getObjFileLowering(), llvm::MCContext::getOrCreateSymbol(), llvm::MachineConstantPoolEntry::getSectionKind(), getSubtargetInfo(), llvm::MachineConstantPoolEntry::isMachineConstantPoolEntry(), llvm::MCSA_Global, MF, OutContext, OutStreamer, Sym, and llvm::MachineConstantPoolEntry::Val.

Referenced by emitConstantPool(), llvm::MipsAsmPrinter::emitInstruction(), llvm::XtensaAsmPrinter::emitMachineConstantPoolEntry(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), llvm::XtensaAsmPrinter::emitMachineConstantPoolValue(), llvm::XtensaAsmPrinter::GetConstantPoolIndexSymbol(), llvm::SystemZMCInstLower::getExpr(), getMCSymbolForTOCPseudoMO(), llvm::HexagonLowerToMC(), llvm::BPFMCInstLower::Lower(), llvm::AVRMCInstLower::lowerInstruction(), llvm::lowerLoongArchMachineOperandToMCOperand(), llvm::M68kMCInstLower::LowerOperand(), LowerOperand(), llvm::AArch64MCInstLower::lowerOperand(), llvm::CSKYMCInstLower::lowerOperand(), llvm::LowerPPCMachineOperandToMCOperand(), LowerSymbolOperand(), llvm::HexagonAsmPrinter::printOperand(), and smallData().

◆ getCurrentSection()

const MCSection * AsmPrinter::getCurrentSection ( ) const

Return the current section we are emitting to.

getCurrentSection() - Return the current section we are emitting to.

Definition at line 421 of file AsmPrinter.cpp.

References OutStreamer.

Referenced by emitAlignment(), and emitStackSizeSection().

◆ getDataLayout()

const DataLayout & AsmPrinter::getDataLayout ( ) const

◆ getDwarfDebug() [1/2]

DwarfDebug * llvm::AsmPrinter::getDwarfDebug ( )
inline

◆ getDwarfDebug() [2/2]

DwarfDebug * llvm::AsmPrinter::getDwarfDebug ( ) const
inline

Definition at line 238 of file AsmPrinter.h.

◆ getDwarfFormParams()

dwarf::FormParams AsmPrinter::getDwarfFormParams ( ) const

◆ getDwarfOffsetByteSize()

unsigned int AsmPrinter::getDwarfOffsetByteSize ( ) const

◆ getDwarfVersion()

uint16_t AsmPrinter::getDwarfVersion ( ) const

◆ GetExternalSymbolSymbol()

MCSymbol * AsmPrinter::GetExternalSymbolSymbol ( Twine  Sym) const

◆ getFunctionBegin()

MCSymbol * llvm::AsmPrinter::getFunctionBegin ( ) const
inline

◆ getFunctionCFISectionType() [1/2]

AsmPrinter::CFISection AsmPrinter::getFunctionCFISectionType ( const Function F) const

◆ getFunctionCFISectionType() [2/2]

AsmPrinter::CFISection AsmPrinter::getFunctionCFISectionType ( const MachineFunction MF) const

Get the CFISection type for a function.

Definition at line 1286 of file AsmPrinter.cpp.

References llvm::MachineFunction::getFunction(), getFunctionCFISectionType(), and MF.

◆ getFunctionEnd()

MCSymbol * llvm::AsmPrinter::getFunctionEnd ( ) const
inline

Definition at line 267 of file AsmPrinter.h.

Referenced by emitPCSections(), and llvm::CodeViewDebug::endFunctionImpl().

◆ getFunctionFrameSymbol()

virtual const MCSymbol * llvm::AsmPrinter::getFunctionFrameSymbol ( ) const
inlinevirtual

Return symbol for the function pseudo stack if the stack frame is not a register based.

Reimplemented in llvm::NVPTXAsmPrinter.

Definition at line 264 of file AsmPrinter.h.

◆ getFunctionNumber()

unsigned AsmPrinter::getFunctionNumber ( ) const

◆ getGVAlignment()

Align AsmPrinter::getGVAlignment ( const GlobalObject GV,
const DataLayout DL,
Align  InAlign = Align(1) 
)
static

Return the alignment for the specified GV.

getGVAlignment - Return the alignment to use for the specified global value.

This rounds up to the preferred alignment if possible and legal.

Definition at line 336 of file AsmPrinter.cpp.

References assert(), DL, llvm::GlobalObject::getAlign(), and llvm::GlobalObject::hasSection().

Referenced by emitAlignment(), and emitGlobalVariable().

◆ getIFuncMCSubtargetInfo()

virtual const MCSubtargetInfo * llvm::AsmPrinter::getIFuncMCSubtargetInfo ( ) const
inlinevirtual

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.

Override the implementation in targets that support the Mach-O IFunc lowering.

Definition at line 603 of file AsmPrinter.h.

◆ getISAEncoding()

virtual unsigned llvm::AsmPrinter::getISAEncoding ( )
inlinevirtual

Get the value for DW_AT_APPLE_isa. Zero if no isa encoding specified.

Reimplemented in llvm::ARMAsmPrinter.

Definition at line 756 of file AsmPrinter.h.

Referenced by llvm::DwarfUnit::applySubprogramAttributes().

◆ GetJTISymbol()

MCSymbol * AsmPrinter::GetJTISymbol ( unsigned  JTID,
bool  isLinkerPrivate = false 
) const

◆ GetJTSetSymbol()

MCSymbol * AsmPrinter::GetJTSetSymbol ( unsigned  UID,
unsigned  MBBID 
) const

Return the symbol for the specified jump table .set FIXME: privatize to AsmPrinter.

GetJTSetSymbol - Return the symbol for the specified jump table .set FIXME: privatize to AsmPrinter.

Definition at line 3865 of file AsmPrinter.cpp.

References DL, getDataLayout(), getFunctionNumber(), llvm::MCContext::getOrCreateSymbol(), and OutContext.

Referenced by emitJumpTableInfo().

◆ getMBBExceptionSym()

MCSymbol * AsmPrinter::getMBBExceptionSym ( const MachineBasicBlock MBB)

◆ getModuleCFISectionType()

CFISection llvm::AsmPrinter::getModuleCFISectionType ( ) const
inline

Get the CFISection type for the module.

Definition at line 434 of file AsmPrinter.h.

Referenced by llvm::DwarfCFIException::beginBasicBlockSection(), and llvm::ARMException::beginFunction().

◆ getNameWithPrefix()

void AsmPrinter::getNameWithPrefix ( SmallVectorImpl< char > &  Name,
const GlobalValue GV 
) const

◆ getObjFileLowering()

const TargetLoweringObjectFile & AsmPrinter::getObjFileLowering ( ) const

Return information about object file lowering.

Definition at line 383 of file AsmPrinter.cpp.

References llvm::TargetMachine::getObjFileLowering(), and TM.

Referenced by llvm::DwarfCompileUnit::addAddrTableBase(), llvm::DwarfDebug::addDwarfTypeUnitType(), llvm::DwarfCompileUnit::addLocationAttribute(), llvm::DwarfUnit::addRnglistsBase(), llvm::DwarfCompileUnit::addScopeRangeList(), llvm::DwarfUnit::addStringOffsetsStart(), llvm::DwarfCompileUnit::applyStmtList(), llvm::DwarfCFIException::beginBasicBlockSection(), llvm::WinException::beginFunclet(), llvm::DwarfCFIException::beginFunction(), llvm::WinException::beginFunction(), llvm::CodeViewDebug::beginModule(), computeGlobalGOTEquivs(), doFinalization(), llvm::AMDGPUAsmPrinter::doFinalization(), llvm::AVRAsmPrinter::doFinalization(), doInitialization(), emitBasicBlockStart(), emitBBAddrMapSection(), llvm::DwarfUnit::emitCommonHeader(), emitConstantPool(), llvm::XtensaAsmPrinter::emitConstantPool(), llvm::ARMAsmPrinter::emitEndOfAsmFile(), llvm::X86AsmPrinter::emitEndOfAsmFile(), llvm::EHStreamer::emitExceptionTable(), llvm::SystemZAsmPrinter::emitFunctionBodyEnd(), emitGlobalAlias(), emitGlobalConstantImpl(), emitGlobalGOTEquivs(), emitGlobalVariable(), emitJumpTableInfo(), emitKCFITrapEntry(), emitPCSections(), emitStackSizeSection(), llvm::MipsAsmPrinter::emitStartOfAsmFile(), llvm::X86AsmPrinter::emitStartOfAsmFile(), emitTTypeReference(), emitXXStructorList(), llvm::DwarfCFIException::endModule(), GetCPISymbol(), llvm::AArch64MCInstLower::GetGlobalValueSymbol(), getNameWithPrefix(), getSymbolWithGlobalValueBase(), handleIndirectSymViaGOTPCRel(), llvm::DwarfCompileUnit::initStmtList(), lowerConstant(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), llvm::R600AsmPrinter::runOnMachineFunction(), and SetupMachineFunction().

◆ getPointerSize()

unsigned AsmPrinter::getPointerSize ( ) const

Return the pointer size from the TargetMachine.

Definition at line 394 of file AsmPrinter.cpp.

References llvm::TargetMachine::getPointerSize(), and TM.

Referenced by emitBBAddrMapSection(), emitPatchableFunctionEntries(), and emitPCSections().

◆ GetSizeOfEncodedValue()

unsigned AsmPrinter::GetSizeOfEncodedValue ( unsigned  Encoding) const

◆ getSubtargetInfo()

const MCSubtargetInfo & AsmPrinter::getSubtargetInfo ( ) const

◆ getSymbol()

MCSymbol * AsmPrinter::getSymbol ( const GlobalValue GV) const

Definition at line 676 of file AsmPrinter.cpp.

References llvm::TargetMachine::getSymbol(), and TM.

Referenced by llvm::DwarfCompileUnit::addLocationAttribute(), computeGlobalGOTEquivs(), doFinalization(), llvm::WebAssemblyAsmPrinter::emitDecls(), llvm::WebAssemblyAsmPrinter::emitEndOfAsmFile(), llvm::WebAssemblyAsmPrinter::EmitFunctionAttributes(), emitGlobalAlias(), emitGlobalAliasInline(), emitGlobalConstant(), emitGlobalVariable(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::WebAssemblyAsmPrinter::emitGlobalVariable(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), llvm::SystemZAsmPrinter::emitMachineConstantPoolValue(), emitSpecialLLVMGlobal(), emitXXStructorList(), llvm::ARMException::endFunction(), llvm::DwarfCFIException::endModule(), llvm::WinCFGuard::endModule(), llvm::WinException::endModule(), llvm::SystemZMCInstLower::getExpr(), llvm::BPFMCInstLower::GetGlobalAddressSymbol(), llvm::LanaiMCInstLower::GetGlobalAddressSymbol(), llvm::MSP430MCInstLower::GetGlobalAddressSymbol(), llvm::AArch64MCInstLower::GetGlobalValueSymbol(), llvm::WebAssemblyAsmPrinter::getMCSymbolForFunction(), getMCSymbolForTOCPseudoMO(), GetSymbolFromOperand(), handleIndirectSymViaGOTPCRel(), llvm::HexagonLowerToMC(), lowerConstant(), llvm::AVRAsmPrinter::lowerConstant(), llvm::AVRMCInstLower::lowerInstruction(), LowerOperand(), llvm::CSKYMCInstLower::lowerOperand(), LowerSymbolOperand(), llvm::XtensaAsmPrinter::LowerSymbolOperand(), llvm::AVRAsmPrinter::printOperand(), SetupMachineFunction(), and smallData().

◆ getSymbolPreferLocal()

MCSymbol * AsmPrinter::getSymbolPreferLocal ( const GlobalValue GV) const

◆ getSymbolWithGlobalValueBase()

MCSymbol * AsmPrinter::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.

Definition at line 3872 of file AsmPrinter.cpp.

References getObjFileLowering(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), and TM.

Referenced by getSymbolPreferLocal().

◆ getUnitLengthFieldByteSize()

unsigned int AsmPrinter::getUnitLengthFieldByteSize ( ) const

Returns 4 for DWARF32 and 12 for DWARF64.

Definition at line 4364 of file AsmPrinter.cpp.

References llvm::dwarf::getUnitLengthFieldByteSize(), and OutStreamer.

Referenced by llvm::DwarfFile::computeSizeAndOffsetsForUnit(), and llvm::DwarfCompileUnit::getLength().

◆ hasDebugInfo()

bool llvm::AsmPrinter::hasDebugInfo ( ) const
inline

◆ isBlockOnlyReachableByFallthrough()

bool AsmPrinter::isBlockOnlyReachableByFallthrough ( const MachineBasicBlock MBB) const
virtual

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.

isBlockOnlyReachableByFallthough - 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.

Reimplemented in llvm::HexagonAsmPrinter.

Definition at line 4088 of file AsmPrinter.cpp.

References llvm::MachineBasicBlock::empty(), llvm::MachineBasicBlock::isEHPad(), llvm::MachineBasicBlock::isLayoutSuccessor(), MBB, MI, OP, llvm::MachineBasicBlock::pred_begin(), llvm::MachineBasicBlock::pred_empty(), llvm::MachineBasicBlock::pred_size(), and llvm::MachineBasicBlock::terminators().

Referenced by llvm::AMDGPUAsmPrinter::emitBasicBlockStart(), and llvm::HexagonAsmPrinter::isBlockOnlyReachableByFallthrough().

◆ isDwarf64()

bool AsmPrinter::isDwarf64 ( ) const

◆ isPositionIndependent()

bool AsmPrinter::isPositionIndependent ( ) const

◆ isVerbose()

bool llvm::AsmPrinter::isVerbose ( ) const
inline

◆ lowerBlockAddressConstant()

const MCExpr * AsmPrinter::lowerBlockAddressConstant ( const BlockAddress BA)
virtual

Lower the specified BlockAddress to an MCExpr.

Definition at line 3826 of file AsmPrinter.cpp.

References llvm::MCSymbolRefExpr::create(), GetBlockAddressSymbol(), and OutContext.

Referenced by lowerConstant().

◆ lowerConstant()

const MCExpr * AsmPrinter::lowerConstant ( const Constant CV)
virtual

◆ lowerConstantPtrAuth()

virtual const MCExpr * llvm::AsmPrinter::lowerConstantPtrAuth ( const ConstantPtrAuth CPA)
inlinevirtual

Definition at line 582 of file AsmPrinter.h.

References llvm::report_fatal_error().

Referenced by lowerConstant().

◆ needsSEHMoves()

bool AsmPrinter::needsSEHMoves ( )

◆ preprocessXXStructorList()

void AsmPrinter::preprocessXXStructorList ( const DataLayout DL,
const Constant List,
SmallVector< Structor, 8 > &  Structors 
)

◆ PrintAsmMemoryOperand()

bool AsmPrinter::PrintAsmMemoryOperand ( const MachineInstr MI,
unsigned  OpNo,
const char ExtraCode,
raw_ostream OS 
)
virtual

Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as an address.

Targets should override this to format as appropriate. This method can return true if the operand is erroneous.

Reimplemented in llvm::X86AsmPrinter, llvm::CSKYAsmPrinter, llvm::HexagonAsmPrinter, llvm::LoongArchAsmPrinter, llvm::M68kAsmPrinter, llvm::SystemZAsmPrinter, llvm::WebAssemblyAsmPrinter, llvm::ARMAsmPrinter, llvm::AVRAsmPrinter, and llvm::MipsAsmPrinter.

Definition at line 511 of file AsmPrinterInlineAsm.cpp.

Referenced by EmitInlineAsmStr(), llvm::CSKYAsmPrinter::PrintAsmMemoryOperand(), llvm::M68kAsmPrinter::PrintAsmMemoryOperand(), llvm::WebAssemblyAsmPrinter::PrintAsmMemoryOperand(), and PrintAsmOperand().

◆ PrintAsmOperand()

bool AsmPrinter::PrintAsmOperand ( const MachineInstr MI,
unsigned  OpNo,
const char ExtraCode,
raw_ostream O 
)
virtual

Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.

PrintAsmOperand - Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.

Targets should override this to format as appropriate. This method can return true if the operand is erroneous.

Targets should override this to format as appropriate for machine specific ExtraCodes or when the arch-independent handling would be too complex otherwise.

Reimplemented in llvm::AMDGPUAsmPrinter, llvm::MipsAsmPrinter, llvm::X86AsmPrinter, llvm::CSKYAsmPrinter, llvm::HexagonAsmPrinter, llvm::LoongArchAsmPrinter, llvm::M68kAsmPrinter, llvm::SystemZAsmPrinter, llvm::WebAssemblyAsmPrinter, llvm::ARMAsmPrinter, and llvm::AVRAsmPrinter.

Definition at line 469 of file AsmPrinterInlineAsm.cpp.

References llvm::MachineOperand::getImm(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isReg(), MI, PrintAsmMemoryOperand(), and PrintSymbolOperand().

Referenced by EmitInlineAsmStr(), llvm::AMDGPUAsmPrinter::PrintAsmOperand(), llvm::MipsAsmPrinter::PrintAsmOperand(), llvm::X86AsmPrinter::PrintAsmOperand(), llvm::CSKYAsmPrinter::PrintAsmOperand(), llvm::HexagonAsmPrinter::PrintAsmOperand(), llvm::LoongArchAsmPrinter::PrintAsmOperand(), llvm::M68kAsmPrinter::PrintAsmOperand(), llvm::SystemZAsmPrinter::PrintAsmOperand(), llvm::WebAssemblyAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::PrintAsmOperand(), and llvm::AVRAsmPrinter::PrintAsmOperand().

◆ printOffset()

void AsmPrinter::printOffset ( int64_t  Offset,
raw_ostream OS 
) const

This is just convenient handler for printing offsets.

Definition at line 3796 of file AsmPrinter.cpp.

References llvm::Offset, and OS.

Referenced by llvm::WebAssemblyAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::PrintSymbolOperand(), and PrintSymbolOperand().

◆ PrintSpecial()

void AsmPrinter::PrintSpecial ( const MachineInstr MI,
raw_ostream OS,
StringRef  Code 
) const
virtual

Print information related to the specified machine instr that is independent of the operand, and may be independent of the instr itself.

PrintSpecial - Print information related to the specified machine instr that is independent of the operand, and may be independent of the instr itself.

This can be useful for portably encoding the comment character or other bits of target-specific knowledge into the asmstrings. The syntax used is ${:comment}. Targets can override this to add support for their own strange codes.

Definition at line 432 of file AsmPrinterInlineAsm.cpp.

References DL, llvm::MCAsmInfo::getCommentString(), llvm::MachineFunction::getDataLayout(), getFunctionNumber(), MAI, MF, MI, OS, llvm::report_fatal_error(), and llvm::raw_string_ostream::str().

Referenced by EmitInlineAsmStr().

◆ PrintSymbolOperand()

void AsmPrinter::PrintSymbolOperand ( const MachineOperand MO,
raw_ostream OS 
)
virtual

◆ recordSled()

void AsmPrinter::recordSled ( MCSymbol Sled,
const MachineInstr MI,
SledKind  Kind,
uint8_t  Version = 0 
)

◆ runOnMachineFunction()

bool llvm::AsmPrinter::runOnMachineFunction ( MachineFunction MF)
inlineoverridevirtual

◆ setDwarfUsesRelocationsAcrossSections()

void llvm::AsmPrinter::setDwarfUsesRelocationsAcrossSections ( bool  Enable)
inline

Definition at line 326 of file AsmPrinter.h.

References llvm::Enable.

◆ setDwarfVersion()

void AsmPrinter::setDwarfVersion ( uint16_t  Version)

Definition at line 4345 of file AsmPrinter.cpp.

References OutStreamer, and llvm::Version.

◆ SetupMachineFunction()

void AsmPrinter::SetupMachineFunction ( MachineFunction MF)
virtual

◆ shouldEmitWeakSwiftAsyncExtendedFramePointerFlags()

virtual bool llvm::AsmPrinter::shouldEmitWeakSwiftAsyncExtendedFramePointerFlags ( ) const
inlineprotectedvirtual

Reimplemented in llvm::X86AsmPrinter.

Definition at line 912 of file AsmPrinter.h.

Referenced by doFinalization().

◆ takeDeletedSymbolsForFunction()

void AsmPrinter::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.

This prevents emitting a reference to a symbol that has no definition.

Definition at line 269 of file AsmPrinter.cpp.

References F.

◆ usesCFIWithoutEH()

bool AsmPrinter::usesCFIWithoutEH ( ) const

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.

Definition at line 1294 of file AsmPrinter.cpp.

References MAI, None, and llvm::MCAsmInfo::usesCFIWithoutEH().

Referenced by llvm::DwarfCFIException::beginFunction(), doInitialization(), and emitCFIInstruction().

Member Data Documentation

◆ CurrentFnBegin

MCSymbol* llvm::AsmPrinter::CurrentFnBegin = nullptr
protected

◆ CurrentFnBeginLocal

MCSymbol* llvm::AsmPrinter::CurrentFnBeginLocal = nullptr
protected

For dso_local functions, the current $local alias for the function.

Definition at line 188 of file AsmPrinter.h.

Referenced by emitFunctionBody(), emitFunctionEntryLabel(), and SetupMachineFunction().

◆ CurrentFnDescSym

MCSymbol* llvm::AsmPrinter::CurrentFnDescSym = nullptr

The symbol for the current function descriptor on AIX.

This is created at the beginning of each call to SetupMachineFunction().

Definition at line 127 of file AsmPrinter.h.

Referenced by SetupMachineFunction().

◆ CurrentFnSym

MCSymbol* llvm::AsmPrinter::CurrentFnSym = nullptr

◆ CurrentFnSymForSize

MCSymbol* llvm::AsmPrinter::CurrentFnSymForSize = nullptr

The symbol used to represent the start of the current function for the purpose of calculating its size (e.g.

using the .size directive). By default, this is equal to CurrentFnSym.

Definition at line 132 of file AsmPrinter.h.

Referenced by emitFunctionBody(), llvm::FaultMaps::recordFaultingOp(), and SetupMachineFunction().

◆ CurrentPatchableFunctionEntrySym

MCSymbol* llvm::AsmPrinter::CurrentPatchableFunctionEntrySym = nullptr

The symbol for the entry in __patchable_function_entires.

Definition at line 119 of file AsmPrinter.h.

Referenced by llvm::X86AsmPrinter::emitInstruction(), and emitPatchableFunctionEntries().

◆ DebugHandlers

SmallVector<std::unique_ptr<DebugHandlerBase>, 1> llvm::AsmPrinter::DebugHandlers
protected

Debuginfo handler. Protected so that targets can add their own.

Definition at line 196 of file AsmPrinter.h.

Referenced by addDebugHandler(), doFinalization(), doInitialization(), emitBasicBlockEnd(), emitBasicBlockStart(), emitFunctionBody(), and emitGlobalVariable().

◆ GlobalGOTEquivs

MapVector<const MCSymbol *, GOTEquivUsePair> llvm::AsmPrinter::GlobalGOTEquivs

◆ Handlers

SmallVector<std::unique_ptr<AsmPrinterHandler>, 2> llvm::AsmPrinter::Handlers
protected

A vector of all debug/EH info emitters we should use.

This vector maintains ownership of the emitters.

Definition at line 192 of file AsmPrinter.h.

Referenced by addAsmPrinterHandler(), doFinalization(), doInitialization(), emitBasicBlockEnd(), emitBasicBlockStart(), emitFunctionBody(), and ~AsmPrinter().

◆ MAI

const MCAsmInfo* llvm::AsmPrinter::MAI = nullptr

Target Asm Printer information.

Definition at line 92 of file AsmPrinter.h.

Referenced by llvm::DwarfCompileUnit::addLocationAttribute(), AsmPrinter(), llvm::ARMException::beginFunction(), llvm::WinException::beginFunction(), llvm::EHStreamer::computeCallSiteTable(), doFinalization(), doInitialization(), emitBasicBlockStart(), emitCFIInstruction(), llvm::DwarfUnit::emitCommonHeader(), llvm::DwarfDebug::emitDebugLocEntry(), emitDwarfSymbolReference(), llvm::X86AsmPrinter::emitEndOfAsmFile(), llvm::EHStreamer::emitExceptionTable(), emitFunctionBody(), emitFunctionEntryLabel(), emitGlobalAlias(), emitGlobalConstant(), emitGlobalVariable(), EmitInlineAsmStr(), emitJumpTableInfo(), llvm::X86AsmPrinter::emitKCFITypeId(), emitLabelPlusOffset(), emitLinkage(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), emitPatchableFunctionEntries(), emitSpecialLLVMGlobal(), emitVisibility(), emitXRayTable(), llvm::ARMException::endFunction(), llvm::DwarfCFIException::endModule(), llvm::LanaiMCInstLower::GetConstantPoolIndexSymbol(), getDwarfFormParams(), getFunctionCFISectionType(), llvm::LanaiMCInstLower::GetJumpTableSymbol(), GetSizeOfEncodedValue(), needsSEHMoves(), llvm::M68kAsmPrinter::PrintAsmMemoryOperand(), llvm::SystemZAsmPrinter::PrintAsmMemoryOperand(), llvm::CSKYAsmPrinter::PrintAsmOperand(), llvm::SystemZAsmPrinter::PrintAsmOperand(), llvm::WebAssemblyAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::printOperand(), llvm::MipsAsmPrinter::printOperand(), llvm::HexagonAsmPrinter::printOperand(), PrintSpecial(), llvm::ARMAsmPrinter::PrintSymbolOperand(), PrintSymbolOperand(), SetupMachineFunction(), and usesCFIWithoutEH().

◆ MBBSectionRanges

MapVector<MBBSectionID, MBBSectionRange> llvm::AsmPrinter::MBBSectionRanges

◆ MDT

MachineDominatorTree* llvm::AsmPrinter::MDT = nullptr

This is a pointer to the current MachineDominatorTree.

Definition at line 110 of file AsmPrinter.h.

Referenced by emitFunctionBody().

◆ MF

MachineFunction* llvm::AsmPrinter::MF = nullptr

The current machine function.

Definition at line 104 of file AsmPrinter.h.

Referenced by llvm::DwarfCompileUnit::addAddress(), llvm::DwarfCompileUnit::addComplexAddress(), llvm::WinException::beginFunclet(), llvm::DebugHandlerBase::beginFunction(), llvm::CodeViewDebug::beginInstruction(), llvm::EHStreamer::computeActionsTable(), llvm::EHStreamer::computeCallSiteTable(), llvm::WasmException::computeCallSiteTable(), doFinalization(), emitAlignment(), emitBasicBlockStart(), emitBBAddrMapSection(), emitCFIInstruction(), emitConstantPool(), llvm::WebAssemblyAsmPrinter::emitConstantPool(), llvm::XtensaAsmPrinter::emitConstantPool(), llvm::DwarfDebug::emitDebugLocValue(), emitDebugValueComment(), llvm::EHStreamer::emitExceptionTable(), llvm::MipsAsmPrinter::emitFrameDirective(), emitFunctionBody(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), llvm::AMDGPUAsmPrinter::emitFunctionBodyStart(), llvm::MipsAsmPrinter::emitFunctionBodyStart(), llvm::WebAssemblyAsmPrinter::emitFunctionBodyStart(), llvm::X86AsmPrinter::emitFunctionBodyStart(), emitFunctionEntryLabel(), llvm::AMDGPUAsmPrinter::emitFunctionEntryLabel(), llvm::ARMAsmPrinter::emitFunctionEntryLabel(), llvm::MipsAsmPrinter::emitFunctionEntryLabel(), llvm::SystemZAsmPrinter::emitFunctionEntryLabel(), emitImplicitDef(), llvm::AMDGPUAsmPrinter::emitImplicitDef(), emitInitialRawDwarfLocDirective(), llvm::AMDGPUAsmPrinter::emitInstruction(), llvm::R600AsmPrinter::emitInstruction(), llvm::ARMAsmPrinter::emitInstruction(), llvm::HexagonAsmPrinter::emitInstruction(), llvm::MipsAsmPrinter::emitInstruction(), llvm::SystemZAsmPrinter::emitInstruction(), llvm::X86AsmPrinter::emitInstruction(), llvm::ARMAsmPrinter::emitJumpTableAddrs(), emitJumpTableInfo(), llvm::ARMAsmPrinter::emitJumpTableInsts(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), emitKCFITrapEntry(), emitKCFITypeId(), llvm::X86AsmPrinter::emitKCFITypeId(), emitKill(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), emitNops(), emitPatchableFunctionEntries(), emitPCSections(), emitPCSectionsLabel(), emitStackSizeSection(), emitStackUsage(), llvm::EHStreamer::emitTypeInfos(), emitXRayTable(), llvm::ARMException::endFunction(), getCodeViewJumpTableInfo(), GetCPISymbol(), getFunctionCFISectionType(), getFunctionNumber(), GetJTISymbol(), getSubtargetInfo(), llvm::HexagonAsmPrinter::HexagonProcessInstruction(), lowerConstant(), llvm::AMDGPUAsmPrinter::lowerOperand(), llvm::LoongArchAsmPrinter::LowerPATCHABLE_FUNCTION_ENTER(), needsSEHMoves(), llvm::AMDGPUAsmPrinter::PrintAsmOperand(), llvm::HexagonAsmPrinter::PrintAsmOperand(), llvm::SystemZAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::PrintAsmOperand(), llvm::AVRAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::printOperand(), llvm::MipsAsmPrinter::printSavedRegsBitmask(), PrintSpecial(), llvm::ARMAsmPrinter::runOnMachineFunction(), runOnMachineFunction(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), llvm::R600AsmPrinter::runOnMachineFunction(), llvm::CSKYAsmPrinter::runOnMachineFunction(), llvm::LoongArchAsmPrinter::runOnMachineFunction(), llvm::M68kAsmPrinter::runOnMachineFunction(), llvm::MipsAsmPrinter::runOnMachineFunction(), llvm::X86AsmPrinter::runOnMachineFunction(), SetupMachineFunction(), and llvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ MLI

MachineLoopInfo* llvm::AsmPrinter::MLI = nullptr

This is a pointer to the current MachineLoopInfo.

Definition at line 113 of file AsmPrinter.h.

Referenced by emitBasicBlockStart(), and emitFunctionBody().

◆ MMI

MachineModuleInfo* llvm::AsmPrinter::MMI = nullptr

◆ NumUserDebugHandlers

size_t llvm::AsmPrinter::NumUserDebugHandlers = 0
protected

Definition at line 197 of file AsmPrinter.h.

Referenced by addDebugHandler(), and doFinalization().

◆ NumUserHandlers

size_t llvm::AsmPrinter::NumUserHandlers = 0
protected

Definition at line 193 of file AsmPrinter.h.

Referenced by addAsmPrinterHandler(), doFinalization(), and ~AsmPrinter().

◆ ORE

MachineOptimizationRemarkEmitter* llvm::AsmPrinter::ORE = nullptr

Optimization remark emitter.

Definition at line 116 of file AsmPrinter.h.

Referenced by emitFunctionBody(), and SetupMachineFunction().

◆ OutContext

MCContext& llvm::AsmPrinter::OutContext

This is the context for the output file that we are streaming.

This owns all of the global MC-related objects for the generated translation unit.

Definition at line 96 of file AsmPrinter.h.

Referenced by createTempSymbol(), doFinalization(), llvm::AVRAsmPrinter::doFinalization(), doInitialization(), EmitCamlGlobal(), llvm::DwarfDebug::emitDebugLocEntry(), llvm::WebAssemblyAsmPrinter::emitDecls(), llvm::MipsAsmPrinter::emitEndOfAsmFile(), llvm::SystemZAsmPrinter::emitEndOfAsmFile(), llvm::WebAssemblyAsmPrinter::emitEndOfAsmFile(), llvm::X86AsmPrinter::emitEndOfAsmFile(), llvm::EHStreamer::emitExceptionTable(), emitFrameAlloc(), llvm::WebAssemblyAsmPrinter::EmitFunctionAttributes(), emitFunctionBody(), llvm::AMDGPUAsmPrinter::emitFunctionBodyStart(), llvm::WebAssemblyAsmPrinter::emitFunctionBodyStart(), llvm::ARMAsmPrinter::emitFunctionEntryLabel(), llvm::SystemZAsmPrinter::emitFunctionEntryLabel(), emitGlobalAlias(), emitGlobalVariable(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::AMDGPUAsmPrinter::emitInstruction(), llvm::R600AsmPrinter::emitInstruction(), llvm::ARMAsmPrinter::emitInstruction(), llvm::AVRAsmPrinter::emitInstruction(), llvm::MipsAsmPrinter::emitInstruction(), llvm::SystemZAsmPrinter::emitInstruction(), llvm::WebAssemblyAsmPrinter::emitInstruction(), llvm::X86AsmPrinter::emitInstruction(), llvm::ARMAsmPrinter::emitJumpTableAddrs(), emitJumpTableInfo(), llvm::ARMAsmPrinter::emitJumpTableInsts(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), emitKCFITrapEntry(), llvm::X86AsmPrinter::emitKCFITypeId(), emitLabelPlusOffset(), llvm::XtensaAsmPrinter::emitMachineConstantPoolEntry(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), llvm::SystemZAsmPrinter::emitMachineConstantPoolValue(), llvm::XtensaAsmPrinter::emitMachineConstantPoolValue(), emitPatchableFunctionEntries(), llvm::WebAssemblyAsmPrinter::EmitProducerInfo(), emitRemarksSection(), llvm::HexagonAsmPrinter::EmitSled(), llvm::LoongArchAsmPrinter::emitSled(), emitSpecialLLVMGlobal(), llvm::MipsAsmPrinter::emitStartOfAsmFile(), llvm::WebAssemblyAsmPrinter::EmitTargetFeatures(), emitXRayTable(), llvm::ARMAsmPrinter::emitXXStructor(), llvm::AVRAsmPrinter::emitXXStructor(), llvm::WasmException::endModule(), llvm::WinCFGuard::endModule(), llvm::WinException::endModule(), getAddrLabelSymbolToEmit(), GetCPISymbol(), llvm::ARMAsmPrinter::GetCPISymbol(), GetExternalSymbolSymbol(), llvm::NVPTXAsmPrinter::getFunctionFrameSymbol(), GetJTISymbol(), GetJTSetSymbol(), llvm::WebAssemblyAsmPrinter::getOrCreateWasmSymbol(), GetSymbolFromOperand(), llvm::HexagonLowerToMC(), llvm::HexagonAsmPrinter::HexagonProcessInstruction(), lowerBlockAddressConstant(), lowerConstant(), llvm::AMDGPUAsmPrinter::lowerConstant(), llvm::R600AsmPrinter::lowerConstant(), llvm::AVRAsmPrinter::lowerConstant(), llvm::ARMAsmPrinter::lowerOperand(), llvm::AMDGPUAsmPrinter::lowerOperand(), llvm::LowerPPCMachineOperandToMCOperand(), LowerSymbolOperand(), llvm::XtensaAsmPrinter::LowerSymbolOperand(), llvm::CSKYMCInstLower::lowerSymbolOperand(), lowerSymbolOperand(), and smallData().

◆ OutStreamer

std::unique_ptr<MCStreamer> llvm::AsmPrinter::OutStreamer

This is the MCStreamer object for the file we are generating.

This contains the transient state for the current translation unit that we are generating (such as the current section etc).

Definition at line 101 of file AsmPrinter.h.

Referenced by llvm::AMDGPUAsmPrinter::AMDGPUAsmPrinter(), AsmPrinter(), llvm::DwarfCFIException::beginBasicBlockSection(), llvm::DwarfDebug::beginCodeAlignment(), llvm::WinException::beginFunclet(), llvm::ARMException::beginFunction(), llvm::DwarfDebug::beginFunctionImpl(), llvm::DebugHandlerBase::beginInstruction(), llvm::DwarfDebug::beginInstruction(), doFinalization(), llvm::AMDGPUAsmPrinter::doFinalization(), llvm::AVRAsmPrinter::doFinalization(), llvm::NVPTXAsmPrinter::doFinalization(), doInitialization(), llvm::DwarfDebug::DwarfDebug(), llvm::DIEAbbrevSet::Emit(), emitAlignment(), llvm::X86AsmPrinter::emitBasicBlockEnd(), emitBasicBlockLoopComments(), emitBasicBlockStart(), emitBBAddrMapSection(), emitCallSiteValue(), EmitCamlGlobal(), emitCFIInstruction(), llvm::DwarfUnit::emitCommonHeader(), emitConstantPool(), llvm::XtensaAsmPrinter::emitConstantPool(), emitDebugLabelComment(), llvm::DwarfDebug::emitDebugLocEntryLocation(), emitDebugValue(), llvm::MipsAsmPrinter::emitDebugValue(), emitDebugValueComment(), emitDwarfDIE(), emitDwarfLengthOrOffset(), emitDwarfStringOffset(), emitDwarfSymbolReference(), emitDwarfUnitLength(), emitEncodingByte(), llvm::ARMAsmPrinter::emitEndOfAsmFile(), llvm::CSKYAsmPrinter::emitEndOfAsmFile(), llvm::HexagonAsmPrinter::emitEndOfAsmFile(), llvm::MipsAsmPrinter::emitEndOfAsmFile(), llvm::WebAssemblyAsmPrinter::emitEndOfAsmFile(), llvm::X86AsmPrinter::emitEndOfAsmFile(), llvm::EHStreamer::emitExceptionTable(), emitFrameAlloc(), llvm::WebAssemblyAsmPrinter::EmitFunctionAttributes(), emitFunctionBody(), llvm::ARMAsmPrinter::emitFunctionBodyEnd(), llvm::MipsAsmPrinter::emitFunctionBodyEnd(), llvm::SystemZAsmPrinter::emitFunctionBodyEnd(), llvm::X86AsmPrinter::emitFunctionBodyEnd(), llvm::X86AsmPrinter::emitFunctionBodyStart(), emitFunctionEntryLabel(), llvm::ARMAsmPrinter::emitFunctionEntryLabel(), llvm::MipsAsmPrinter::emitFunctionEntryLabel(), llvm::SystemZAsmPrinter::emitFunctionEntryLabel(), emitGlobalAlias(), emitGlobalAliasInline(), emitGlobalConstant(), emitGlobalConstantArray(), emitGlobalConstantDataSequential(), emitGlobalConstantFP(), emitGlobalConstantImpl(), emitGlobalConstantLargeInt(), emitGlobalConstantStruct(), emitGlobalConstantVector(), emitGlobalVariable(), llvm::WebAssemblyAsmPrinter::emitGlobalVariable(), llvm::DwarfCompileUnit::emitHeader(), llvm::DwarfTypeUnit::emitHeader(), emitImplicitDef(), llvm::AMDGPUAsmPrinter::emitImplicitDef(), emitInitialRawDwarfLocDirective(), llvm::ARMAsmPrinter::emitInlineAsmEnd(), llvm::AMDGPUAsmPrinter::emitInstruction(), llvm::R600AsmPrinter::emitInstruction(), llvm::ARMAsmPrinter::emitInstruction(), llvm::AVRAsmPrinter::emitInstruction(), llvm::CSKYAsmPrinter::emitInstruction(), llvm::HexagonAsmPrinter::emitInstruction(), llvm::LoongArchAsmPrinter::emitInstruction(), llvm::M68kAsmPrinter::emitInstruction(), llvm::MipsAsmPrinter::emitInstruction(), llvm::SystemZAsmPrinter::emitInstruction(), llvm::WebAssemblyAsmPrinter::emitInstruction(), llvm::X86AsmPrinter::emitInstruction(), llvm::XtensaAsmPrinter::emitInstruction(), emitInt16(), emitInt32(), emitInt64(), emitInt8(), llvm::APByteStreamer::emitInt8(), llvm::ARMAsmPrinter::emitJumpTableAddrs(), emitJumpTableInfo(), llvm::ARMAsmPrinter::emitJumpTableInsts(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), emitKCFITrapEntry(), llvm::X86AsmPrinter::emitKCFITypeId(), emitKill(), emitLabelDifference(), emitLabelDifferenceAsULEB128(), emitLabelPlusOffset(), emitLinkage(), llvm::XtensaAsmPrinter::emitMachineConstantPoolEntry(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), llvm::CSKYAsmPrinter::emitMachineConstantPoolValue(), llvm::SystemZAsmPrinter::emitMachineConstantPoolValue(), llvm::XtensaAsmPrinter::emitMachineConstantPoolValue(), emitNops(), emitPatchableFunctionEntries(), emitPCSections(), emitPCSectionsLabel(), llvm::WebAssemblyAsmPrinter::EmitProducerInfo(), llvm::PseudoProbeHandler::emitPseudoProbe(), emitRemarksSection(), emitSLEB128(), llvm::APByteStreamer::emitSLEB128(), llvm::HexagonAsmPrinter::EmitSled(), llvm::LoongArchAsmPrinter::emitSled(), emitSpecialLLVMGlobal(), emitStackSizeSection(), llvm::ARMAsmPrinter::emitStartOfAsmFile(), llvm::AVRAsmPrinter::emitStartOfAsmFile(), llvm::M68kAsmPrinter::emitStartOfAsmFile(), llvm::MipsAsmPrinter::emitStartOfAsmFile(), llvm::X86AsmPrinter::emitStartOfAsmFile(), llvm::WebAssemblyAsmPrinter::EmitTargetFeatures(), llvm::CSKYAsmPrinter::EmitToStreamer(), emitTTypeReference(), llvm::EHStreamer::emitTypeInfos(), llvm::APByteStreamer::emitULEB128(), emitULEB128(), llvm::DwarfFile::emitUnit(), llvm::DIEInlineString::emitValue(), llvm::DIEEntry::emitValue(), emitVisibility(), emitXRayTable(), llvm::ARMAsmPrinter::emitXXStructor(), llvm::AVRAsmPrinter::emitXXStructor(), emitXXStructorList(), llvm::DwarfCFIException::endBasicBlockSection(), llvm::WinException::endFunclet(), llvm::WinException::endFunction(), llvm::WasmException::endFunction(), llvm::DwarfDebug::endFunctionImpl(), llvm::DebugHandlerBase::endInstruction(), llvm::DwarfCFIException::endModule(), llvm::WasmException::endModule(), llvm::WinCFGuard::endModule(), llvm::WinException::endModule(), GetCPISymbol(), getCurrentSection(), llvm::DwarfDebug::getDwarfCompileUnitIDForLineTable(), getDwarfFormParams(), getDwarfOffsetByteSize(), getDwarfVersion(), llvm::DwarfDebug::getDwarfVersion(), llvm::AArch64MCInstLower::GetGlobalValueSymbol(), llvm::DwarfCompileUnit::getOrCreateSourceID(), llvm::WebAssemblyAsmPrinter::getTargetStreamer(), llvm::AMDGPUAsmPrinter::getTargetStreamer(), getUnitLengthFieldByteSize(), handleIndirectSymViaGOTPCRel(), llvm::HexagonAsmPrinter::HexagonProcessInstruction(), llvm::DwarfCompileUnit::initStmtList(), isDwarf64(), llvm::ARMException::markFunctionEnd(), llvm::WinException::markFunctionEnd(), llvm::FaultMaps::recordFaultingOp(), llvm::ARMAsmPrinter::runOnMachineFunction(), llvm::NVPTXAsmPrinter::runOnMachineFunction(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), llvm::R600AsmPrinter::runOnMachineFunction(), llvm::CSKYAsmPrinter::runOnMachineFunction(), llvm::X86AsmPrinter::runOnMachineFunction(), llvm::FaultMaps::serializeToFaultMapSection(), llvm::StackMaps::serializeToStackMapSection(), setDwarfVersion(), and llvm::DwarfDebug::terminateLineTable().

◆ Sleds

SmallVector<XRayFunctionEntry, 4> llvm::AsmPrinter::Sleds

Definition at line 360 of file AsmPrinter.h.

Referenced by emitXRayTable(), and recordSled().

◆ SM

StackMaps llvm::AsmPrinter::SM
protected

Definition at line 199 of file AsmPrinter.h.

Referenced by emitStackMaps().

◆ TM

TargetMachine& llvm::AsmPrinter::TM

Target machine description.

Definition at line 89 of file AsmPrinter.h.

Referenced by llvm::DwarfUnit::addAttribute(), llvm::DwarfDebug::addDwarfTypeUnitType(), llvm::DwarfCompileUnit::addLocationAttribute(), llvm::DwarfCFIException::beginBasicBlockSection(), llvm::WinException::beginFunclet(), llvm::CodeViewDebug::beginFunctionImpl(), llvm::DwarfUnit::constructTypeDIE(), doFinalization(), llvm::AVRAsmPrinter::doFinalization(), doInitialization(), llvm::AMDGPUAsmPrinter::doInitialization(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::DwarfDebug::DwarfDebug(), emitAlignment(), emitBasicBlockStart(), llvm::XtensaAsmPrinter::emitConstantPool(), llvm::DwarfDebug::emitDebugLocValue(), llvm::WebAssemblyAsmPrinter::emitDecls(), llvm::AMDGPUAsmPrinter::emitEndOfAsmFile(), llvm::ARMAsmPrinter::emitEndOfAsmFile(), llvm::CSKYAsmPrinter::emitEndOfAsmFile(), llvm::HexagonAsmPrinter::emitEndOfAsmFile(), llvm::X86AsmPrinter::emitEndOfAsmFile(), llvm::EHStreamer::emitExceptionTable(), emitFunctionBody(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), llvm::SystemZAsmPrinter::emitFunctionBodyEnd(), llvm::WebAssemblyAsmPrinter::emitFunctionBodyStart(), emitFunctionEntryLabel(), llvm::AMDGPUAsmPrinter::emitFunctionEntryLabel(), emitGlobalAlias(), emitGlobalVariable(), llvm::AMDGPUAsmPrinter::emitGlobalVariable(), llvm::AMDGPUAsmPrinter::emitInstruction(), llvm::MipsAsmPrinter::emitInstruction(), llvm::X86AsmPrinter::emitInstruction(), emitJumpTableInfo(), emitPatchableFunctionEntries(), emitStackSizeSection(), llvm::ARMAsmPrinter::emitStartOfAsmFile(), llvm::AVRAsmPrinter::emitStartOfAsmFile(), llvm::CSKYAsmPrinter::emitStartOfAsmFile(), llvm::HexagonAsmPrinter::emitStartOfAsmFile(), llvm::MipsAsmPrinter::emitStartOfAsmFile(), llvm::SystemZAsmPrinter::emitStartOfAsmFile(), llvm::X86AsmPrinter::emitStartOfAsmFile(), emitTTypeReference(), emitXRayTable(), emitXXStructorList(), llvm::AIXException::endFunction(), llvm::MipsAsmPrinter::getCurrentABIString(), getFunctionCFISectionType(), llvm::AMDGPUAsmPrinter::getGlobalSTI(), llvm::AArch64MCInstLower::GetGlobalValueSymbol(), getNameWithPrefix(), getObjFileLowering(), getPointerSize(), getSymbol(), getSymbolPreferLocal(), getSymbolWithGlobalValueBase(), isPositionIndependent(), lowerConstant(), llvm::AMDGPUAsmPrinter::lowerConstant(), llvm::R600AsmPrinter::lowerConstant(), llvm::AArch64MCInstLower::LowerSymbolOperand(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), preprocessXXStructorList(), llvm::SystemZAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::runOnMachineFunction(), llvm::CSKYAsmPrinter::runOnMachineFunction(), llvm::X86AsmPrinter::runOnMachineFunction(), SetupMachineFunction(), and llvm::WinException::WinException().


The documentation for this class was generated from the following files: