llvm::AsmPrinter

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

Synopsis

Declared in <llvm/CodeGen/AsmPrinter.h>

class AsmPrinter
    : public MachineFunctionPass

Base Classes

NameDescription
MachineFunctionPassFunctionPass adapter for passes that operate on a MachineFunction.

Types

NameDescription
MBBSectionRange Map a basic block section ID to the begin and end symbols of that section which determine the section's range.
Structor One entry in an llvm.global_ctors or llvm.global_dtors array.
XRayFunctionEntry Describes one XRay sled and the function that contains it.

Type Aliases

NameDescription
AliasMapTy Map from offset within a global to aliases that refer to that offset.
GOTEquivUsePair Map global GOT equivalent MCSymbols to GlobalVariables and keep track of its number of uses by other globals.

Enums

NameDescription
CFISection Which CFI section is required for a function or module.
SledKind Kind of XRay instrumentation sled recorded in the XRay table.

Member Functions

NameDescription
~AsmPrinter [destructor] [virtual]Virtual destructor.
operator= [deleted]Passes are not assignable.
EmitToStreamer Emit machine instruction Inst to streamer S.
GetBlockAddressSymbol GetBlockAddressSymbol overloads
GetCPISymbol [virtual]Return the symbol for constant-pool entry CPID.
GetExternalSymbolSymbol Return the MCSymbol for external symbol name Sym.
GetJTISymbol Return the symbol for jump-table entry JTID.
GetJTSetSymbol Return the symbol for the specified jump-table .set directive.
GetSizeOfEncodedValue Return the size in bytes of DWARF encoding Encoding.
PrintAsmMemoryOperand [virtual]Print INLINEASM memory operand OpNo of MI to OS.
PrintAsmOperand [virtual]Print INLINEASM operand OpNo of MI to OS.
PrintSpecial [virtual]Print special inline-asm code Code for instruction MI.
PrintSymbolOperand [virtual]Print machine operand MO as a symbol to OS.
SetupMachineFunction [virtual]Prepare the AsmPrinter for MachineFunction MF.
addAsmPrinterHandler Register an additional AsmPrinter handler.
assignPassManager assignPassManager overloads
computeGlobalGOTEquivs Find GOT-equivalent globals in module M and record them.
createCallsiteEndSymbol Create a symbol marking the end of a callsite in MBB.
createPrinterPass [virtual]createPrinterPass - Get a function printer pass.
createTempSymbol Create a temporary MCSymbol with name Name.
doFinalization [virtual]Shut down the AsmPrinter after finishing a module.
doInitialization [virtual]Set up the AsmPrinter when working on a new module.
doesDwarfUseRelocationsAcrossSections Return true if DWARF emission uses cross-section relocations.
dump Print this pass's state to stderr for debugging.
dumpPassStructure [virtual]Print the pass nesting structure for -debug-passes=PassStructure.
emitAlignment Emit an alignment directive to a power-of-two boundary.
emitBBAddrMapSection Emit the basic-block address map section for function MF.
emitBasicBlockEnd [virtual]Emit content at the end of basic block MBB.
emitBasicBlockStart [virtual]Emit content at the start of basic block MBB.
emitCFIInstruction emitCFIInstruction overloads
emitCOFFFeatureSymbol Emit the COFF feat.00 symbol for features enabled in M.
emitCOFFReplaceableFunctionData Emit COFF symbols/data for loader-replaceable functions in M.
emitCallGraphSection Emit the call-graph section for function MF.
emitCallSiteOffset Emit a call-site offset between Hi and Lo with Encoding.
emitCallSiteValue Emit call-site integer Value with encoding Encoding.
emitConstantPool [virtual]Emit assembly for constants in the current function's constant pool.
emitDanglingPrefetchTargets Emit prefetch targets that were not mapped to any basic block. These targets are emitted at the beginning of the function body.
emitDebugValue [virtual]Emit a debug value expression of Size bytes.
emitDwarfAbbrev Emit one DWARF abbreviation entry to the output stream.
emitDwarfAbbrevs Emit the DWARF abbreviation table in Abbrevs.
emitDwarfDIE Recursively emit the DWARF DIE tree rooted at Die.
emitDwarfLengthOrOffset Emit a 32- or 64-bit DWARF length/offset value.
emitDwarfOffset Emit DWARF offset Label + Offset.
emitDwarfStringOffset Emit the section-relative offset of string-pool entry S.
emitDwarfSymbolReference Emit a DWARF reference to symbol Label.
emitDwarfUnitLength emitDwarfUnitLength overloads
emitEncodingByte Emit a .byte directive for encoding value Val.
emitEndOfAsmFile [virtual]Emit target-specific content at the end of the assembly file.
emitFrameAlloc Emit a frame allocation label for instruction MI.
emitFunctionBody This method emits the body and trailer for a function.
emitFunctionBodyEnd [virtual]Targets can override this to emit stuff after the last basic block in the function.
emitFunctionBodyStart [virtual]Targets can override this to emit stuff before the first basic block in the function.
emitFunctionDescriptor [virtual]Emit the function descriptor for the current function.
emitFunctionEntryLabel [virtual]Emit the entry label for the current function.
emitGlobalConstant Print LLVM constant CV to the assembly output.
emitGlobalGOTEquivs Emit GOT-equivalent proxies that could not be optimized away.
emitGlobalVariable emitGlobalVariable overloads
emitImplicitDef [virtual]Emit an IMPLICIT_DEF instruction in verbose assembly mode.
emitInlineAsmEnd [virtual]Let the target restore state after emitting inline assembly.
emitInlineAsmStart [virtual]Let the target prepare state before emitting inline assembly.
emitInstruction [virtual]Emit machine instruction MI.
emitInt16 Emit a short directive with value Value.
emitInt32 Emit a long directive with value Value.
emitInt64 Emit a long-long directive with value Value.
emitInt8 Emit a byte directive with value Value.
emitJumpTableInfo [virtual]Print assembly representations of the jump tables used by the current function to the current output stream.
emitKCFITrapEntry Emit a KCFI trap entry for Symbol in function MF.
emitKCFITypeId [virtual]Emit the KCFI type identifier for function MF.
emitLabelDifference Emit a sized difference between labels Hi and Lo.
emitLabelDifferenceAsULEB128 Emit a ULEB128 difference between labels Hi and Lo.
emitLabelPlusOffset Emit a sized reference to Label plus Offset.
emitLabelReference Emit a sized reference to Label.
emitLinkage [virtual]Emit linkage information for GVSym based on GV when supported.
emitMachOIFuncStubBody [virtual]Emit the Mach-O IFunc stub body for GI.
emitMachOIFuncStubHelperBody [virtual]Emit the Mach-O IFunc stub helper body for GI.
emitMachineConstantPoolValue [virtual]Emit a target-specific machine constant pool value.
emitNops Emit N NOP instructions.
emitPCSections Emit the PC sections collected from instructions in MF.
emitPCSectionsLabel Emit a label used as a PC-sections reference.
emitPatchableFunctionEntries Emit entries for functions marked as patchable.
emitPrefetchTargetSymbol Emit a prefetch-target symbol for BBID and CallsiteIndex.
emitPseudoProbe Emit the pseudo-probe described by instruction MI.
emitRemarksSection Emit the remarks section using remark streamer RS.
emitSLEB128 Emit signed LEB128 value Value.
emitSpecialLLVMGlobal Emit GV if it is a special LLVM global, otherwise do nothing.
emitStackSizeSection Emit the stack-size section entry for function MF.
emitStackUsage Emit stack usage information for function MF.
emitStartOfAsmFile [virtual]Emit target-specific content at the start of the assembly file.
emitTTypeReference [virtual]Emit a ttype reference to global GV with encoding Encoding.
emitTargetFeaturePop [virtual]Pop target-feature directives previously pushed for STI.
emitTargetFeaturePush [virtual]Push directives enabling instructions allowed by STI.
emitULEB128 Emit unsigned LEB128 value Value.
emitVisibility Emit visibility information for symbol Sym when supported.
emitXRayTable Emit a table with all XRay instrumentation points.
emitXXStructor [virtual]Emit a global constant that participates in a ctor/dtor list.
emitXXStructorList [virtual]Emit an llvm.global_ctors or llvm.global_dtors list.
getAddrLabelSymbol Return the address-taken symbol for basic block BB.
getAddrLabelSymbolToEmit Return all address-taken symbols that must be emitted for BB.
getAnalysis getAnalysis overloads
getAnalysisID getAnalysisID overloads
getAnalysisIfAvailable Get an optional analysis result that may already be available.
getAnalysisUsage [virtual]Record analysis usage.
getAsImmutablePass [virtual]Return this pass as an ImmutablePass, or null if it is not one.
getAsPMDataManager [virtual]Return this pass as a PMDataManager when it is a nested pass manager.
getCodeViewJumpTableInfo [virtual]Get CodeView jump-table debug info for jump table JTI.
getConstantSectionSuffix Return a section suffix (hot or unlikely) for C when profiles exist.
getCurrentSection Return the current section we are emitting to.
getDataLayout Return information about data layout.
getDwarfDebug Return the DwarfDebug handler, or null if DWARF debug info is disabled.
getDwarfFormParams Returns information about the byte size of DW_FORM values.
getDwarfOffsetByteSize Returns 4 for DWARF32 and 8 for DWARF64.
getDwarfVersion Return the DWARF version used for debug info emission.
getFunctionBegin Return the symbol marking the beginning of the current function.
getFunctionCFISectionType getFunctionCFISectionType overloads
getFunctionEnd Return the symbol marking the end of the current function.
getFunctionFrameSymbol [virtual]Return symbol for the function pseudo stack if the stack frame is not a register based.
getFunctionNumber Return a unique ID for the current function.
getIFuncMCSubtargetInfo [virtual]Return subtarget info for Mach-O IFunc lowering.
getISAEncoding [virtual]Get the value for DW_AT_APPLE_isa. Zero if no isa encoding specified.
getMBBExceptionSym Return the exception symbol for the MBB section containing MBB.
getModuleCFISectionType Get the CFISection type for the module.
getNameWithPrefix Fill Name with the mangled name of GV, including any target prefix.
getObjFileLowering Return information about object file lowering.
getPassArgument Return a nice clean name for a pass corresponding to that used to enable the pass in opt.
getPassID getPassID - Return the PassID number that corresponds to this pass.
getPassKind Return the kind of pass (module, function, loop, etc.).
getPassName [virtual]Return a human-readable name for this pass.
getPointerSize Return the pointer size from the TargetMachine
getPotentialPassManagerType [virtual]Return what kind of Pass Manager can manage this pass.
getResolver Return the analysis resolver installed for this pass.
getSubtargetInfo Return information about subtarget.
getSymbol Return the MCSymbol for global value GV.
getSymbolPreferLocal Return a symbol preferred for references to GV.
getSymbolWithGlobalValueBase Return a private MCSymbol based on GV with suffix Suffix.
getUnitLengthFieldByteSize Returns 4 for DWARF32 and 12 for DWARF64.
handleCallsiteForCallgraph Record call-graph section info for call instruction MI.
hasDebugInfo Returns true if valid debug info is present.
isBlockOnlyReachableByFallthrough [virtual]Return true if MBB is reachable only by fall-through from one pred.
isDwarf64 Return true if DWARF64 format is in use.
isPositionIndependent Return true if the output is being generated for a position-independent image.
isVerbose Return true if assembly output should contain comments.
lowerBlockAddressConstant [virtual]Lower block-address constant BA to an MCExpr.
lowerConstant [virtual]Lower LLVM constant CV to an MCExpr.
lowerConstantPtrAuth [virtual]Lower pointer-authentication constant CPA to an MCExpr.
mustPreserveAnalysisID Report whether the analysis identified by AID must be preserved.
needsSEHMoves Return true if Windows SEH move information must be emitted for the current function.
preparePassManager [virtual]Check whether available pass managers are suitable for this pass.
preprocessXXStructorList Gather structors from List and sort them by priority.
print [virtual]Print the internal state of this pass for analysis dumping.
printIRUnit [virtual]Serialize the IR unit this pass operates on for --print-changed.
printOffset Print Offset to stream OS.
recordSled Record XRay sled Sled associated with instruction MI.
releaseMemory [virtual]Release memory held by this pass when it is no longer needed.
runOnFunction [virtual]runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
runOnMachineFunction [virtual]Emit function MF to the OutStreamer.
setDwarfUsesRelocationsAcrossSections Set whether DWARF emission uses cross-section relocations.
setDwarfVersion Set the DWARF version used for debug info emission.
setResolver Install the analysis resolver used to satisfy this pass's dependencies.
takeDeletedSymbolsForFunction Collect symbols for deleted address-taken blocks in F.
usesCFIWithoutEH Return true if CFI is used even when exception handling is disabled.
verifyAnalysis [virtual]verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.

Static Member Functions

NameDescription
createPass Construct a new instance of the pass identified by ID.
getGVAlignment Return the alignment to use for global object GV.
lookupPassInfo lookupPassInfo overloads

Data Members

NameDescription
AssertDebugEHFinalized Callback that asserts debug and EH handlers have been finalized.
BeginGCAssembly Callback invoked before emitting GC assembly for a module.
CurrentFnCallsiteEndSymbols End-of-callsite symbols for the current function, keyed by basic block.
CurrentFnDescSym The symbol for the current function descriptor on AIX. This is created at the beginning of each call to SetupMachineFunction().
CurrentFnSym The symbol for the current function. This is recalculated at the beginning of each call to runOnMachineFunction().
CurrentFnSymForSize Start symbol used when calculating the current function's size.
CurrentPatchableFunctionEntrySym The symbol for the entry in __patchable_function_entires.
EmitStackMaps Callback invoked after function emission to write stack map records.
FinishGCAssembly Callback invoked after emitting GC assembly for a module.
GetMDT Callback to obtain the MachineDominatorTree for a MachineFunction.
GetMLI Callback that returns MachineLoopInfo for a MachineFunction.
GetMMI Callback that returns the current MachineModuleInfo.
GetORE Callback that returns the optimization remark emitter for a function.
GlobalGOTEquivs Maps GOT-equivalent MCSymbols to the GlobalVariable and how often other globals reference that equivalent.
MAI Target Asm Printer information.
MBBSectionRanges Begin and end symbols for each basic-block section ID.
MDT This is a pointer to the current MachineDominatorTree.
MF The current machine function.
MLI This is a pointer to the current MachineLoopInfo.
MMI This is a pointer to the current MachineModuleInfo.
ORE Optimization remark emitter.
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.
OutStreamer MCStreamer for the assembly or object file being generated.
PSI The profile summary information.
SDPI Provides the profile information for constants.
Sleds XRay sleds collected for the current module.
TM Target machine description.

Protected Member Functions

NameDescription
AsmPrinter [constructor]Construct an AsmPrinter for TM that writes through Streamer.
createDwarfDebug [virtual]Create the DwarfDebug handler. Targets can override this to provide custom debug information handling.
emitGlobalAlias [virtual]Emit global alias GA from module M.
emitJumpTableEntry [virtual]Emit one jump-table entry for destination MBB.
getAnalysisUsage [virtual]getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
getClearedProperties [virtual]Return the MachineFunctionProperties this pass clears when it runs.
getRequiredGlobalAlignmentGranule [virtual]Return an optional minimum alignment granule for global GV.
getRequiredProperties [virtual]Return the MachineFunctionProperties this pass requires before running.
getSetProperties [virtual]Return the MachineFunctionProperties this pass sets after running.
runOnMachineFunction [virtual]runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
shouldEmitWeakSwiftAsyncExtendedFramePointerFlags [virtual]Return true if weak Swift async extended frame-pointer flags are needed.
skipFunction Check whether this optional pass should be skipped for F.

Protected Data Members

NameDescription
CurrentFnBegin Symbol marking the beginning of the current function.
CurrentFnBeginLocal For dso_local functions, the current $local alias for the function.
EHHandlers A handle to the EH info emitter (if present).
Handlers Debug-info and related AsmPrinter handlers owned by this printer.
NumUserHandlers Number of user-registered handlers at the front of Handlers.
SM Stack map records collected while emitting the current module.

Non-Member Functions

NameDescription
emitAppleAccelTableEmit an Apple Accelerator Table consisting of entries in the specified AccelTable. The DataT template parameter should be derived from AppleAccelTableData.
emitAppleAccelTableImplEmit an Apple accelerator table for Contents using atom list Atoms.
emitDWARF5AccelTableEmit a DWARF v5 accelerator table for the given CU list.
emitDWARF5AccelTableEmit a DWARF v5 accelerator table using compile units from DD.
getBestSimplifyQueryBuild a SimplifyQuery from analyses currently valid in a pass.
getPassTimerRequest the timer for this legacy-pass-manager's pass instance.
isBitcodeWriterPassCheck whether a pass is a BitcodeWriterPass.
isIRPrintingPassReturn true if a pass is for IR printing.