LLVM  3.7.0
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | 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 <AsmPrinter.h>

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

Public Types

enum  CFIMoveType { CFI_M_None, CFI_M_EH, CFI_M_Debug }
 
typedef std::pair< const
GlobalVariable *, unsigned
GOTEquivUsePair
 Map global GOT equivalent MCSymbols to GlobalVariables and keep track of its number of uses by other globals. More...
 

Public Member Functions

 ~AsmPrinter () override
 
DwarfDebuggetDwarfDebug ()
 
DwarfDebuggetDwarfDebug () const
 
bool isVerbose () const
 Return true if assembly output should contain comments. More...
 
unsigned getFunctionNumber () const
 Return a unique ID for the current function. More...
 
MCSymbolgetFunctionBegin () const
 
MCSymbolgetFunctionEnd () const
 
MCSymbolgetCurExceptionSym ()
 
const TargetLoweringObjectFilegetObjFileLowering () const
 Return information about object file lowering. More...
 
const DataLayoutgetDataLayout () const
 Return information about data layout. More...
 
const MCSubtargetInfogetSubtargetInfo () const
 Return information about subtarget. More...
 
void EmitToStreamer (MCStreamer &S, const MCInst &Inst)
 
StringRef getTargetTriple () const
 Return the target triple string. More...
 
const MCSectiongetCurrentSection () const
 Return the current section we are emitting to. More...
 
void getNameWithPrefix (SmallVectorImpl< char > &Name, const GlobalValue *GV) const
 
MCSymbolgetSymbol (const GlobalValue *GV) const
 
void getAnalysisUsage (AnalysisUsage &AU) const override
 Record analysis usage. More...
 
bool doInitialization (Module &M) override
 Set up the AsmPrinter when we are working on a new module. More...
 
bool doFinalization (Module &M) override
 Shut down the asmprinter. More...
 
bool runOnMachineFunction (MachineFunction &MF) override
 Emit the specified function out to the OutStreamer. More...
 
void SetupMachineFunction (MachineFunction &MF)
 This should be called when a new MachineFunction is being processed from runOnMachineFunction. More...
 
void EmitFunctionBody ()
 This method emits the body and trailer for a function. More...
 
void emitCFIInstruction (const MachineInstr &MI)
 
void emitFrameAlloc (const MachineInstr &MI)
 
CFIMoveType needsCFIMoves ()
 
bool needsSEHMoves ()
 
virtual void EmitConstantPool ()
 Print to the current output stream assembly representations of the constants in the constant pool MCP. More...
 
void EmitJumpTableInfo ()
 Print assembly representations of the jump tables used by the current function to the current output stream. More...
 
virtual void EmitGlobalVariable (const GlobalVariable *GV)
 Emit the specified global variable to the .s file. More...
 
bool EmitSpecialLLVMGlobal (const GlobalVariable *GV)
 Check to see if the specified global is a special global used by LLVM. More...
 
void EmitAlignment (unsigned NumBits, const GlobalObject *GO=nullptr) const
 Emit an alignment directive to the specified power of two boundary. More...
 
const MCExprlowerConstant (const Constant *CV)
 Lower the specified LLVM Constant to an MCExpr. More...
 
void EmitGlobalConstant (const Constant *CV)
 Print a general LLVM constant to the .s file. More...
 
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. More...
 
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. More...
 
virtual void EmitStartOfAsmFile (Module &)
 This virtual method can be overridden by targets that want to emit something at the start of their file. More...
 
virtual void EmitEndOfAsmFile (Module &)
 This virtual method can be overridden by targets that want to emit something at the end of their file. More...
 
virtual void EmitFunctionBodyStart ()
 Targets can override this to emit stuff before the first basic block in the function. More...
 
virtual void EmitFunctionBodyEnd ()
 Targets can override this to emit stuff after the last basic block in the function. More...
 
virtual void EmitBasicBlockStart (const MachineBasicBlock &MBB) const
 Targets can override this to emit stuff at the start of a basic block. More...
 
virtual void EmitBasicBlockEnd (const MachineBasicBlock &MBB)
 Targets can override this to emit stuff at the end of a basic block. More...
 
virtual void EmitInstruction (const MachineInstr *)
 Targets should implement this to emit instructions. More...
 
virtual MCSymbolGetCPISymbol (unsigned CPID) const
 Return the symbol for the specified constant pool entry. More...
 
virtual void EmitFunctionEntryLabel ()
 EmitFunctionEntryLabel - Emit the label that is the entrypoint for the function. More...
 
virtual void EmitMachineConstantPoolValue (MachineConstantPoolValue *MCPV)
 
virtual void EmitXXStructor (const Constant *CV)
 Targets can override this to change how global constants that are part of a C++ static/global constructor list are emitted. More...
 
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. More...
 
virtual void emitImplicitDef (const MachineInstr *MI) const
 Targets can override this to customize the output of IMPLICIT_DEF instructions in verbose mode. More...
 
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. More...
 
MCSymbolGetExternalSymbolSymbol (StringRef Sym) const
 Return the MCSymbol for the specified ExternalSymbol. More...
 
MCSymbolGetJTISymbol (unsigned JTID, bool isLinkerPrivate=false) const
 Return the symbol for the specified jump table entry. More...
 
MCSymbolGetJTSetSymbol (unsigned UID, unsigned MBBID) const
 Return the symbol for the specified jump table .set FIXME: privatize to AsmPrinter. More...
 
MCSymbolGetBlockAddressSymbol (const BlockAddress *BA) const
 Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block. More...
 
MCSymbolGetBlockAddressSymbol (const BasicBlock *BB) const
 
void printOffset (int64_t Offset, raw_ostream &OS) const
 This is just convenient handler for printing offsets. More...
 
void EmitInt8 (int Value) const
 Emit a byte directive and value. More...
 
void EmitInt16 (int Value) const
 Emit a short directive and value. More...
 
void EmitInt32 (int Value) const
 Emit a long directive and value. More...
 
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. More...
 
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. More...
 
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. More...
 
void EmitSLEB128 (int64_t Value, const char *Desc=nullptr) const
 Emit the specified signed leb128 value. More...
 
void EmitULEB128 (uint64_t Value, const char *Desc=nullptr, unsigned PadTo=0) const
 Emit the specified unsigned leb128 value. More...
 
void EmitCFAByte (unsigned Val) const
 Emit a .byte 42 directive for a DW_CFA_xxx value. More...
 
void EmitEncodingByte (unsigned Val, const char *Desc=nullptr) const
 Emit a .byte 42 directive that corresponds to an encoding. More...
 
unsigned GetSizeOfEncodedValue (unsigned Encoding) const
 Return the size of the encoding in bytes. More...
 
void EmitTTypeReference (const GlobalValue *GV, unsigned Encoding) const
 Emit reference to a ttype global with a specified encoding. More...
 
void emitDwarfSymbolReference (const MCSymbol *Label, bool ForceOffset=false) const
 Emit a reference to a symbol for use in dwarf. More...
 
void emitDwarfStringOffset (DwarfStringPoolEntryRef S) const
 Emit the 4-byte offset of a string from the start of its section. More...
 
virtual unsigned getISAEncoding ()
 Get the value for DW_AT_APPLE_isa. Zero if no isa encoding specified. More...
 
virtual void EmitDwarfRegOp (ByteStreamer &BS, const MachineLocation &MLoc) const
 EmitDwarfRegOp - Emit a dwarf register operation. More...
 
void emitCFIInstruction (const MCCFIInstruction &Inst) const
 Emit frame instruction to describe the layout of the frame. More...
 
void emitDwarfAbbrevs (const std::vector< DIEAbbrev * > &Abbrevs) const
 Emit Dwarf abbreviation table. More...
 
void emitDwarfDIE (const DIE &Die) const
 Recursively emit Dwarf DIE tree. More...
 
virtual void PrintSpecial (const MachineInstr *MI, raw_ostream &OS, const char *Code) const
 Print information related to the specified machine instr that is independent of the operand, and may be independent of the instr itself. More...
 
virtual bool PrintAsmOperand (const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS)
 Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant. More...
 
virtual bool PrintAsmMemoryOperand (const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS)
 Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as an address. More...
 
virtual void emitInlineAsmStart () const
 Let the target do anything it needs to do before emitting inlineasm. More...
 
virtual void emitInlineAsmEnd (const MCSubtargetInfo &StartInfo, const MCSubtargetInfo *EndInfo) const
 Let the target do anything it needs to do after emitting inlineasm. More...
 
- Public Member Functions inherited from llvm::FunctionPass
 FunctionPass (char &pid)
 
PasscreatePrinterPass (raw_ostream &O, const std::string &Banner) const override
 createPrinterPass - Get a function printer pass. More...
 
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. More...
 
PassManagerType getPotentialPassManagerType () const override
 Return what kind of Pass Manager can manage this pass. More...
 
- Public Member Functions inherited from llvm::Pass
 Pass (PassKind K, char &pid)
 
virtual ~Pass ()
 
PassKind getPassKind () const
 
virtual const char * getPassName () const
 getPassName - Return a nice clean name for a pass. More...
 
AnalysisID getPassID () const
 getPassID - Return the PassID number that corresponds to this pass. More...
 
virtual void print (raw_ostream &O, const Module *M) const
 print - Print out the internal state of the pass. More...
 
void dump () const
 
virtual void preparePassManager (PMStack &)
 Check if available pass managers are suitable for this pass or not. More...
 
void setResolver (AnalysisResolver *AR)
 
AnalysisResolvergetResolver () const
 
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. More...
 
virtual void * getAdjustedAnalysisPointer (AnalysisID ID)
 getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through multiple inheritance. More...
 
virtual ImmutablePassgetAsImmutablePass ()
 
virtual PMDataManagergetAsPMDataManager ()
 
virtual void verifyAnalysis () const
 verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information. More...
 
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. More...
 
bool mustPreserveAnalysisID (char &AID) const
 mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID. More...
 
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. More...
 
template<typename AnalysisType >
AnalysisType & getAnalysis (Function &F)
 getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. More...
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI) const
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI, Function &F)
 

Public Attributes

TargetMachineTM
 Target machine description. More...
 
const MCAsmInfoMAI
 Target Asm Printer information. More...
 
MCContextOutContext
 This is the context for the output file that we are streaming. More...
 
std::unique_ptr< MCStreamerOutStreamer
 This is the MCStreamer object for the file we are generating. More...
 
const MachineFunctionMF
 The current machine function. More...
 
MachineModuleInfoMMI
 This is a pointer to the current MachineModuleInfo. More...
 
ManglerMang
 Name-mangler for global names. More...
 
MCSymbolCurrentFnSym
 The symbol for the current function. More...
 
MCSymbolCurrentFnSymForSize
 The symbol used to represent the start of the current function for the purpose of calculating its size (e.g. More...
 
MapVector< const MCSymbol
*, GOTEquivUsePair
GlobalGOTEquivs
 

Protected Member Functions

 AsmPrinter (TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
 
- Protected Member Functions inherited from llvm::MachineFunctionPass
 MachineFunctionPass (char &ID)
 
void getAnalysisUsage (AnalysisUsage &AU) const override
 getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. More...
 
- Protected Member Functions inherited from llvm::FunctionPass
bool skipOptnoneFunction (const Function &F) const
 skipOptnoneFunction - This function has Attribute::OptimizeNone and most transformation passes should skip it. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::Pass
static const PassInfolookupPassInfo (const void *TI)
 
static const PassInfolookupPassInfo (StringRef Arg)
 
static PasscreatePass (AnalysisID ID)
 

Detailed Description

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

Definition at line 66 of file AsmPrinter.h.

Member Typedef Documentation

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

Definition at line 107 of file AsmPrinter.h.

Member Enumeration Documentation

Enumerator
CFI_M_None 
CFI_M_EH 
CFI_M_Debug 

Definition at line 222 of file AsmPrinter.h.

Constructor & Destructor Documentation

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

Definition at line 102 of file AsmPrinter.cpp.

References CurrentFnSym, CurrentFnSymForSize, MF, MMI, and OutStreamer.

AsmPrinter::~AsmPrinter ( )
override

Definition at line 117 of file AsmPrinter.cpp.

References llvm::SmallVectorBase::empty(), and getGCMap().

Member Function Documentation

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 971 of file AsmPrinter.cpp.

References G, getObjFileLowering(), getSymbol(), GlobalGOTEquivs, llvm::Module::globals(), and isGOTEquivalentCandidate().

Referenced by doFinalization().

MCSymbol * AsmPrinter::createTempSymbol ( const Twine Name) const
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::NVPTXAsmPrinter.

Definition at line 1005 of file AsmPrinter.cpp.

References llvm::GCModuleInfo::begin(), computeGlobalGOTEquivs(), llvm::GlobalValue::DefaultVisibility, llvm::DL, EmitEndOfAsmFile(), emitGlobalGOTEquivs(), EmitGlobalVariable(), llvm::TargetLoweringObjectFile::emitModuleFlags(), llvm::SmallVectorBase::empty(), llvm::GCModuleInfo::end(), G, llvm::TargetMachine::getDataLayout(), llvm::MCObjectFileInfo::getDataRelSection(), GetExternalSymbolSymbol(), llvm::MachineModuleInfoELF::GetGVStubList(), llvm::MCAsmInfo::getNonexecutableStackSection(), llvm::MachineModuleInfo::getObjFileInfo(), getObjFileLowering(), llvm::MCContext::getOrCreateSymbol(), llvm::DataLayout::getPointerSize(), llvm::SectionKind::getReadOnly(), llvm::TargetLoweringObjectFile::getSectionForConstant(), getSymbol(), llvm::TargetMachine::getTargetTriple(), llvm::GlobalValue::getVisibility(), llvm::MCAsmInfo::getWeakRefDirective(), llvm::Module::globals(), llvm::GlobalValue::hasExternalWeakLinkage(), llvm::AArch64CC::HI, I, llvm::GlobalValue::isDeclarationForLinker(), llvm::Triple::isOSBinFormatELF(), lowerConstant(), MAI, Mang, llvm::MCSA_Global, llvm::MCSA_WeakReference, MF, llvm::AArch64CC::MI, MMI, OutContext, OutStreamer, T, llvm::TimePassesIsEnabled, TM, llvm::Value::use_empty(), and llvm::MachineModuleInfo::usesMorestackAddr().

Referenced by llvm::NVPTXAsmPrinter::doFinalization().

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::NVPTXAsmPrinter, and llvm::X86AsmPrinter.

Definition at line 172 of file AsmPrinter.cpp.

References llvm::ARM, CodeViewLineTablesGroupName, llvm::Target::createMCSubtargetInfo(), DbgTimerName, llvm::MCAsmInfo::doesSupportDebugInformation(), llvm::DwarfCFI, DWARFGroupName, EHTimerName, EmitStartOfAsmFile(), llvm::ES, F(), llvm::Module::functions(), llvm::MCAsmInfo::getExceptionHandlingType(), llvm::Module::getModuleIdentifier(), llvm::Module::getModuleInlineAsm(), getObjFileLowering(), llvm::Triple::getOSVersion(), llvm::TargetMachine::getTarget(), llvm::TargetMachine::getTargetCPU(), llvm::TargetMachine::getTargetFeatureString(), llvm::TargetMachine::getTargetTriple(), getTargetTriple(), llvm::MCAsmInfo::getWinEHEncodingType(), llvm::MCAsmInfo::hasSingleParameterDotFile(), I, llvm::WinEH::Invalid, llvm::Triple::isKnownWindowsMSVCEnvironment(), llvm::Triple::isMacOSX(), llvm::Triple::isOSDarwin(), llvm::WinEH::Itanium, llvm_unreachable, MAI, Mang, llvm::TargetOptions::MCOptions, llvm::MCVM_IOSVersionMin, llvm::MCVM_OSXVersionMin, llvm::AArch64CC::MI, MMI, llvm::None, llvm::TargetMachine::Options, OutContext, OutStreamer, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::Attribute::SanitizeAddress, llvm::SjLj, llvm::Triple::str(), TM, llvm::WinEH, and llvm::WinEH::X86.

Referenced by llvm::X86AsmPrinter::doInitialization().

void AsmPrinter::EmitAlignment ( unsigned  NumBits,
const GlobalObject GO = nullptr 
) const

Emit an alignment directive to the specified power of two boundary.

For example, if you pass in 3 here, you will get an 8 byte alignment. If a global value is specified, and if that global has an explicit alignment requested, it will override the alignment request if required for correctness.

Definition at line 1622 of file AsmPrinter.cpp.

References getCurrentSection(), llvm::TargetMachine::getDataLayout(), getGVAlignmentLog2(), OutStreamer, and TM.

Referenced by EmitBasicBlockStart(), EmitConstantPool(), llvm::ARMAsmPrinter::EmitEndOfAsmFile(), llvm::EHStreamer::emitExceptionTable(), llvm::MipsAsmPrinter::EmitFunctionEntryLabel(), EmitGlobalVariable(), llvm::ARMAsmPrinter::EmitJumpTableAddrs(), EmitJumpTableInfo(), llvm::ARMAsmPrinter::EmitJumpTableTBInst(), and llvm::ARMAsmPrinter::runOnMachineFunction().

virtual void llvm::AsmPrinter::EmitBasicBlockEnd ( const MachineBasicBlock MBB)
inlinevirtual

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

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

Definition at line 304 of file AsmPrinter.h.

Referenced by EmitFunctionBody().

void AsmPrinter::EmitBasicBlockStart ( const MachineBasicBlock MBB) const
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.

Definition at line 2378 of file AsmPrinter.cpp.

References EmitAlignment(), emitBasicBlockLoopComments(), llvm::MachineModuleInfo::getAddrLabelSymbolToEmit(), llvm::MachineBasicBlock::getAlignment(), llvm::MachineBasicBlock::getBasicBlock(), llvm::MachineBasicBlock::getNumber(), llvm::MachineBasicBlock::getSymbol(), llvm::MachineBasicBlock::hasAddressTaken(), isBlockOnlyReachableByFallthrough(), isVerbose(), MMI, OutStreamer, and llvm::MachineBasicBlock::pred_empty().

Referenced by EmitFunctionBody().

void AsmPrinter::EmitCFAByte ( unsigned  Val) const

Emit a .byte 42 directive for a DW_CFA_xxx value.

EmitCFAByte - Emit a .byte 42 directive for a DW_CFA_xxx value.

Definition at line 60 of file AsmPrinterDwarf.cpp.

References llvm::dwarf::CallFrameString(), llvm::dwarf::DW_CFA_offset, isVerbose(), and OutStreamer.

void AsmPrinter::emitCFIInstruction ( const MachineInstr MI)
void AsmPrinter::emitCFIInstruction ( const MCCFIInstruction Inst) const
void AsmPrinter::EmitConstantPool ( )
virtual
void AsmPrinter::emitDwarfAbbrevs ( const std::vector< DIEAbbrev * > &  Abbrevs) const

Emit Dwarf abbreviation table.

Definition at line 288 of file AsmPrinterDwarf.cpp.

References EmitULEB128().

Referenced by llvm::DwarfFile::emitAbbrevs().

void AsmPrinter::emitDwarfDIE ( const DIE Die) const
void AsmPrinter::EmitDwarfRegOp ( ByteStreamer BS,
const MachineLocation MLoc 
) const
virtual
void AsmPrinter::emitDwarfStringOffset ( DwarfStringPoolEntryRef  S) const

Emit the 4-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().

Definition at line 180 of file AsmPrinterDwarf.cpp.

References llvm::MCAsmInfo::doesDwarfUseRelocationsAcrossSections(), emitDwarfSymbolReference(), EmitInt32(), llvm::DwarfStringPoolEntryRef::getOffset(), llvm::DwarfStringPoolEntryRef::getSymbol(), and MAI.

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 160 of file AsmPrinterDwarf.cpp.

References llvm::MCAsmInfo::doesDwarfUseRelocationsAcrossSections(), EmitLabelDifference(), llvm::MCSection::getBeginSymbol(), llvm::MCSymbol::getSection(), MAI, llvm::MCAsmInfo::needsDwarfSectionOffsetDirective(), and OutStreamer.

Referenced by emitDwarfStringOffset(), llvm::DwarfUnit::emitHeader(), and llvm::DIELocList::EmitValue().

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 116 of file AsmPrinterDwarf.cpp.

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

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

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::MipsAsmPrinter, llvm::X86AsmPrinter, llvm::AMDGPUAsmPrinter, and llvm::ARMAsmPrinter.

Definition at line 287 of file AsmPrinter.h.

Referenced by doFinalization().

void AsmPrinter::emitFrameAlloc ( const MachineInstr MI)
void AsmPrinter::EmitFunctionBody ( )
virtual void llvm::AsmPrinter::EmitFunctionBodyEnd ( )
inlinevirtual

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

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

Definition at line 295 of file AsmPrinter.h.

Referenced by EmitFunctionBody().

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

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

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

Definition at line 291 of file AsmPrinter.h.

Referenced by EmitFunctionBody().

void AsmPrinter::EmitFunctionEntryLabel ( )
virtual

EmitFunctionEntryLabel - Emit the label that is the entrypoint for the function.

This can be overridden by targets as required to do custom stuff.

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

Definition at line 588 of file AsmPrinter.cpp.

References CurrentFnSym, llvm::MCSymbol::getName(), llvm::MCSymbol::isDefined(), llvm::MCSymbol::isVariable(), OutStreamer, llvm::MCSymbol::redefineIfPossible(), and llvm::report_fatal_error().

void AsmPrinter::EmitGlobalConstant ( const Constant CV)
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 988 of file AsmPrinter.cpp.

References EmitGlobalVariable(), getObjFileLowering(), GlobalGOTEquivs, I, and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().

Referenced by doFinalization().

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.

Definition at line 344 of file AsmPrinter.cpp.

References Align(), llvm::MCConstantExpr::create(), llvm::DL, EmitAlignment(), EmitGlobalConstant(), EmitSpecialLLVMGlobal(), llvm::MCObjectFileInfo::getCommDirectiveSupportsAlignment(), llvm::TargetMachine::getDataLayout(), llvm::SequentialType::getElementType(), GetExternalSymbolSymbol(), getGVAlignmentLog2(), llvm::GlobalVariable::getInitializer(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::MCAsmInfo::getLCOMMDirectiveAlignmentType(), llvm::MCSymbol::getName(), getObjFileLowering(), llvm::MCContext::getOrCreateSymbol(), llvm::GlobalValue::getParent(), llvm::DataLayout::getPointerTypeSize(), getSymbol(), llvm::MCObjectFileInfo::getTLSBSSSection(), llvm::MCObjectFileInfo::getTLSExtraDataSection(), llvm::GlobalValue::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::GlobalValue::getVisibility(), GlobalGOTEquivs, llvm::MCAsmInfo::hasDotTypeDotSizeDirective(), llvm::GlobalVariable::hasInitializer(), llvm::MCAsmInfo::hasMachoTBSSDirective(), llvm::MCAsmInfo::hasMachoZeroFillDirective(), llvm::AArch64CC::HI, llvm::SectionKind::isBSSExtern(), llvm::SectionKind::isBSSLocal(), llvm::SectionKind::isCommon(), llvm::GlobalValue::isDeclaration(), llvm::MCSymbol::isDefined(), llvm::SectionKind::isThreadBSS(), llvm::SectionKind::isThreadData(), llvm::SectionKind::isThreadLocal(), llvm::MCSymbol::isVariable(), isVerbose(), MAI, Mang, llvm::MCSA_ELF_TypeObject, llvm::MCSA_Global, llvm::MCSA_Local, llvm::LCOMM::NoAlignment, OutContext, OutStreamer, llvm::Value::printAsOperand(), llvm::MCSymbol::redefineIfPossible(), llvm::report_fatal_error(), llvm::TargetLoweringObjectFile::SectionForGlobal(), T, llvm::TimePassesIsEnabled, and TM.

Referenced by doFinalization(), and emitGlobalGOTEquivs().

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.

Definition at line 641 of file AsmPrinter.cpp.

References llvm::MachineModuleInfo::getContext(), llvm::MCRegisterInfo::getName(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MCContext::getRegisterInfo(), MMI, and OutStreamer.

Referenced by EmitFunctionBody().

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 578 of file AsmPrinterInlineAsm.cpp.

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 576 of file AsmPrinterInlineAsm.cpp.

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

Targets should implement this to emit instructions.

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

Definition at line 307 of file AsmPrinter.h.

References llvm_unreachable.

Referenced by EmitFunctionBody().

void AsmPrinter::EmitInt16 ( int  Value) const

Emit a short directive and value.

EmitInt16 - Emit a short directive and value.

Definition at line 1576 of file AsmPrinter.cpp.

References OutStreamer.

Referenced by llvm::DwarfUnit::emitHeader(), llvm::DIELoc::EmitValue(), and llvm::DIEBlock::EmitValue().

void AsmPrinter::EmitInt32 ( int  Value) const

Emit a long directive and value.

EmitInt32 - Emit a long directive and value.

Definition at line 1582 of file AsmPrinter.cpp.

References OutStreamer.

Referenced by emitDwarfStringOffset(), llvm::DwarfUnit::emitHeader(), llvm::DIEEntry::EmitValue(), llvm::DIELoc::EmitValue(), llvm::DIEBlock::EmitValue(), and llvm::WinCodeViewLineTables::endModule().

void AsmPrinter::EmitInt8 ( int  Value) const

Emit a byte directive and value.

EmitInt8 - Emit a byte directive and value.

Definition at line 1570 of file AsmPrinter.cpp.

References OutStreamer.

Referenced by emitDwarfDIE(), llvm::DwarfUnit::emitHeader(), llvm::APByteStreamer::EmitInt8(), llvm::DIELoc::EmitValue(), llvm::DIEBlock::EmitValue(), and llvm::WinCodeViewLineTables::endModule().

void AsmPrinter::EmitJumpTableInfo ( )

Print assembly representations of the jump tables used by the current function to the current output stream.

EmitJumpTableInfo - Print assembly representations of the jump tables used by the current function to the current output stream.

emit a .set directive for each unique entry.

Definition at line 1278 of file AsmPrinter.cpp.

References llvm::MCSymbolRefExpr::create(), llvm::MCBinaryExpr::createSub(), llvm::DL, llvm::MCAsmInfo::doesSetDirectiveSuppressesReloc(), llvm::MachineJumpTableInfo::EK_Inline, llvm::MachineJumpTableInfo::EK_LabelDifference32, EmitAlignment(), F(), llvm::TargetMachine::getDataLayout(), llvm::MachineJumpTableInfo::getEntryAlignment(), llvm::MachineJumpTableInfo::getEntryKind(), llvm::MachineFunction::getFunction(), GetJTISymbol(), GetJTSetSymbol(), llvm::MachineFunction::getJumpTableInfo(), llvm::MachineJumpTableInfo::getJumpTables(), llvm::MachineBasicBlock::getNumber(), getObjFileLowering(), llvm::TargetLowering::getPICJumpTableRelocBaseExpr(), llvm::TargetLoweringObjectFile::getSectionForJumpTable(), llvm::MachineFunction::getSubtarget(), llvm::MachineBasicBlock::getSymbol(), llvm::MachineFunction::getTarget(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::DataLayout::hasLinkerPrivateGlobalPrefix(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::HexagonISD::JT, llvm::Log2_32(), MAI, Mang, llvm::MCDR_DataRegionEnd, llvm::MCDR_DataRegionJT32, MF, OutContext, OutStreamer, llvm::TargetLoweringObjectFile::shouldPutJumpTableInFunctionSection(), and TM.

Referenced by EmitFunctionBody().

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 1589 of file AsmPrinter.cpp.

References OutStreamer.

Referenced by emitDwarfSymbolReference(), llvm::EHStreamer::emitExceptionTable(), and llvm::DIEDelta::EmitValue().

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 1597 of file AsmPrinter.cpp.

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

Referenced by EmitLabelReference(), and llvm::DIEEntry::EmitValue().

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 391 of file AsmPrinter.h.

References EmitLabelPlusOffset().

Referenced by llvm::DIELabel::EmitValue().

void AsmPrinter::EmitMachineConstantPoolValue ( MachineConstantPoolValue MCPV)
virtual

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

Definition at line 2245 of file AsmPrinter.cpp.

References llvm_unreachable.

Referenced by EmitConstantPool(), and llvm::MipsAsmPrinter::EmitInstruction().

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 43 of file AsmPrinterDwarf.cpp.

References isVerbose(), and OutStreamer.

Referenced by llvm::EHStreamer::emitExceptionTable(), llvm::APByteStreamer::EmitSLEB128(), and llvm::DIEInteger::EmitValue().

bool AsmPrinter::EmitSpecialLLVMGlobal ( const GlobalVariable GV)

Check to see if the specified global is a special global used by LLVM.

EmitSpecialLLVMGlobal - Check to see if the specified global is a special global used by LLVM.

If so, emit it and return true, otherwise do nothing and return false.

Definition at line 1421 of file AsmPrinter.cpp.

References llvm::GlobalVariable::getInitializer(), llvm::Value::getName(), llvm::MCContext::getOrCreateSymbol(), llvm::TargetMachine::getRelocationModel(), llvm::GlobalObject::getSection(), llvm::GlobalValue::hasAppendingLinkage(), llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalVariable::hasInitializer(), llvm::MCAsmInfo::hasNoDeadStrip(), llvm::MCAsmInfo::hasStaticCtorDtorReferenceInStaticMode(), MAI, llvm::MCSA_Reference, OutContext, OutStreamer, llvm::Reloc::Static, and TM.

Referenced by EmitGlobalVariable().

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::MipsAsmPrinter, llvm::X86AsmPrinter, and llvm::ARMAsmPrinter.

Definition at line 283 of file AsmPrinter.h.

Referenced by doInitialization().

void AsmPrinter::EmitToStreamer ( MCStreamer S,
const MCInst Inst 
)
void AsmPrinter::EmitTTypeReference ( const GlobalValue GV,
unsigned  Encoding 
) const

Emit reference to a ttype global with a specified encoding.

Definition at line 147 of file AsmPrinterDwarf.cpp.

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

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

void AsmPrinter::EmitULEB128 ( uint64_t  Value,
const char *  Desc = nullptr,
unsigned  PadTo = 0 
) const
virtual void llvm::AsmPrinter::EmitXXStructor ( 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.

Definition at line 320 of file AsmPrinter.h.

References EmitGlobalConstant().

void AsmPrinter::getAnalysisUsage ( AnalysisUsage AU) const
overridevirtual
MCSymbol * AsmPrinter::GetBlockAddressSymbol ( const BlockAddress BA) const
MCSymbol * AsmPrinter::GetBlockAddressSymbol ( const BasicBlock BB) const

Definition at line 2269 of file AsmPrinter.cpp.

References llvm::MachineModuleInfo::getAddrLabelSymbol(), and MMI.

MCSymbol * AsmPrinter::GetCPISymbol ( unsigned  CPID) const
virtual
MCSymbol * AsmPrinter::getCurExceptionSym ( )
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 157 of file AsmPrinter.cpp.

References OutStreamer.

Referenced by EmitAlignment().

const DataLayout & AsmPrinter::getDataLayout ( ) const
DwarfDebug* llvm::AsmPrinter::getDwarfDebug ( )
inline
DwarfDebug* llvm::AsmPrinter::getDwarfDebug ( ) const
inline

Definition at line 148 of file AsmPrinter.h.

MCSymbol * AsmPrinter::GetExternalSymbolSymbol ( StringRef  Sym) const
MCSymbol* llvm::AsmPrinter::getFunctionBegin ( ) const
inline
MCSymbol* llvm::AsmPrinter::getFunctionEnd ( ) const
inline
unsigned AsmPrinter::getFunctionNumber ( ) const
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 435 of file AsmPrinter.h.

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

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

Return the symbol for the specified jump table entry.

GetJTISymbol - Return the symbol for the specified jump table entry.

Definition at line 2282 of file AsmPrinter.cpp.

References llvm::MachineFunction::getJTISymbol(), MF, and OutContext.

Referenced by EmitJumpTableInfo(), llvm::SystemZMCInstLower::getExpr(), llvm::HexagonLowerToMC(), llvm::AArch64MCInstLower::lowerOperand(), llvm::ARMAsmPrinter::lowerOperand(), and llvm::LowerPPCMachineInstrToMCInst().

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 2288 of file AsmPrinter.cpp.

References llvm::TargetMachine::getDataLayout(), getFunctionNumber(), llvm::MCContext::getOrCreateSymbol(), llvm::DataLayout::getPrivateGlobalPrefix(), OutContext, and TM.

Referenced by EmitJumpTableInfo().

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

Definition at line 334 of file AsmPrinter.cpp.

References llvm::TargetMachine::getNameWithPrefix(), Mang, and TM.

const TargetLoweringObjectFile & AsmPrinter::getObjFileLowering ( ) const
unsigned AsmPrinter::GetSizeOfEncodedValue ( unsigned  Encoding) const
const MCSubtargetInfo & AsmPrinter::getSubtargetInfo ( ) const

Return information about subtarget.

Definition at line 143 of file AsmPrinter.cpp.

References llvm::MachineFunction::getSubtarget(), and MF.

Referenced by EmitFunctionBody(), llvm::X86AsmPrinter::EmitInstruction(), and EmitToStreamer().

MCSymbol * AsmPrinter::getSymbol ( const GlobalValue GV) const
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 2295 of file AsmPrinter.cpp.

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

Referenced by printSymbolOperand().

StringRef AsmPrinter::getTargetTriple ( ) const

Return the target triple string.

Definition at line 152 of file AsmPrinter.cpp.

References llvm::TargetMachine::getTargetTriple(), llvm::Triple::str(), and TM.

Referenced by doInitialization().

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::MipsAsmPrinter, and llvm::HexagonAsmPrinter.

Definition at line 2440 of file AsmPrinter.cpp.

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

Referenced by EmitBasicBlockStart(), and llvm::HexagonAsmPrinter::isBlockOnlyReachableByFallthrough().

bool llvm::AsmPrinter::isVerbose ( ) const
inline
const MCExpr * AsmPrinter::lowerConstant ( const Constant CV)
AsmPrinter::CFIMoveType AsmPrinter::needsCFIMoves ( )
bool AsmPrinter::needsSEHMoves ( )
bool AsmPrinter::PrintAsmMemoryOperand ( const MachineInstr MI,
unsigned  OpNo,
unsigned  AsmVariant,
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::MipsAsmPrinter, llvm::X86AsmPrinter, llvm::ARMAsmPrinter, llvm::HexagonAsmPrinter, and llvm::SystemZAsmPrinter.

Definition at line 569 of file AsmPrinterInlineAsm.cpp.

Referenced by EmitGCCInlineAsmStr(), and EmitMSInlineAsmStr().

bool AsmPrinter::PrintAsmOperand ( const MachineInstr MI,
unsigned  OpNo,
unsigned  AsmVariant,
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.

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

Definition at line 543 of file AsmPrinterInlineAsm.cpp.

References llvm::MachineOperand::getImm(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getType(), and llvm::MachineOperand::MO_Immediate.

Referenced by EmitGCCInlineAsmStr(), EmitMSInlineAsmStr(), llvm::HexagonAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::PrintAsmOperand(), llvm::AMDGPUAsmPrinter::PrintAsmOperand(), llvm::X86AsmPrinter::PrintAsmOperand(), and llvm::MipsAsmPrinter::PrintAsmOperand().

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

This is just convenient handler for printing offsets.

Definition at line 2250 of file AsmPrinter.cpp.

Referenced by llvm::HexagonAsmPrinter::printOperand(), llvm::ARMAsmPrinter::printOperand(), and printSymbolOperand().

void AsmPrinter::PrintSpecial ( const MachineInstr MI,
raw_ostream OS,
const char *  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 513 of file AsmPrinterInlineAsm.cpp.

References llvm::DL, llvm::MCAsmInfo::getCommentString(), llvm::TargetMachine::getDataLayout(), getFunctionNumber(), llvm::DataLayout::getPrivateGlobalPrefix(), MAI, llvm::AArch64CC::MI, llvm::report_fatal_error(), llvm::raw_string_ostream::str(), and TM.

Referenced by EmitGCCInlineAsmStr().

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

Member Data Documentation

MCSymbol* llvm::AsmPrinter::CurrentFnSym
MCSymbol* llvm::AsmPrinter::CurrentFnSymForSize

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 103 of file AsmPrinter.h.

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

MapVector<const MCSymbol *, GOTEquivUsePair> llvm::AsmPrinter::GlobalGOTEquivs
const MCAsmInfo* llvm::AsmPrinter::MAI
Mangler* llvm::AsmPrinter::Mang
const MachineFunction* llvm::AsmPrinter::MF
MachineModuleInfo* llvm::AsmPrinter::MMI
MCContext& llvm::AsmPrinter::OutContext
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 83 of file AsmPrinter.h.

Referenced by AsmPrinter(), llvm::DwarfCFIException::beginFunction(), llvm::WinException::beginFunction(), llvm::ARMException::beginFunction(), doFinalization(), doInitialization(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::DwarfDebug::DwarfDebug(), llvm::DwarfStringPool::emit(), llvm::AddressPool::emit(), llvm::DwarfFile::emitAbbrevs(), EmitAlignment(), emitBasicBlockLoopComments(), EmitBasicBlockStart(), EmitCamlGlobal(), EmitCFAByte(), emitCFIInstruction(), EmitConstantPool(), emitDebugValueComment(), emitDwarfDIE(), emitDwarfSymbolReference(), EmitEncodingByte(), llvm::ARMAsmPrinter::EmitEndOfAsmFile(), llvm::AMDGPUAsmPrinter::EmitEndOfAsmFile(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::EHStreamer::emitExceptionTable(), emitFrameAlloc(), EmitFunctionBody(), llvm::ARMAsmPrinter::EmitFunctionBodyEnd(), llvm::ARMAsmPrinter::EmitFunctionEntryLabel(), EmitFunctionEntryLabel(), EmitGlobalConstant(), emitGlobalConstantArray(), emitGlobalConstantDataSequential(), emitGlobalConstantFP(), emitGlobalConstantImpl(), emitGlobalConstantLargeInt(), emitGlobalConstantStruct(), emitGlobalConstantVector(), EmitGlobalVariable(), llvm::DwarfCompileUnit::emitHeader(), llvm::DwarfUnit::emitHeader(), llvm::DwarfTypeUnit::emitHeader(), emitImplicitDef(), llvm::ARMAsmPrinter::emitInlineAsmEnd(), llvm::SystemZAsmPrinter::EmitInstruction(), llvm::HexagonAsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitInstruction(), llvm::AMDGPUAsmPrinter::EmitInstruction(), EmitInt16(), EmitInt32(), llvm::APByteStreamer::EmitInt8(), EmitInt8(), llvm::ARMAsmPrinter::EmitJumpTableAddrs(), EmitJumpTableInfo(), llvm::ARMAsmPrinter::EmitJumpTableInsts(), llvm::ARMAsmPrinter::EmitJumpTableTBInst(), emitKill(), EmitLabelDifference(), EmitLabelPlusOffset(), llvm::NVPTXAsmPrinter::emitLineNumberAsDotLoc(), llvm::SystemZAsmPrinter::EmitMachineConstantPoolValue(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), llvm::APByteStreamer::EmitSLEB128(), EmitSLEB128(), EmitSpecialLLVMGlobal(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), llvm::X86AsmPrinter::EmitStartOfAsmFile(), EmitTTypeReference(), llvm::EHStreamer::emitTypeInfos(), llvm::APByteStreamer::EmitULEB128(), EmitULEB128(), llvm::DwarfFile::emitUnits(), llvm::DIEInteger::EmitValue(), llvm::DIEExpr::EmitValue(), llvm::DIEEntry::EmitValue(), llvm::DIETypeSignature::EmitValue(), llvm::ARMAsmPrinter::EmitXXStructor(), llvm::WinException::endFunction(), llvm::ARMException::endFunction(), llvm::DwarfCFIException::endModule(), llvm::WinException::endModule(), llvm::ARMException::endModule(), llvm::WinCodeViewLineTables::endModule(), llvm::X86AsmPrinter::GetCPISymbol(), getCurrentSection(), llvm::DwarfCompileUnit::getOrCreateSourceID(), handleIndirectSymViaGOTPCRel(), llvm::DwarfCompileUnit::initStmtList(), llvm::DwarfCFIExceptionBase::markFunctionEnd(), llvm::FaultMaps::recordFaultingOp(), llvm::ARMAsmPrinter::runOnMachineFunction(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), llvm::X86AsmPrinter::runOnMachineFunction(), llvm::FaultMaps::serializeToFaultMapSection(), llvm::StackMaps::serializeToStackMapSection(), and llvm::DIEInteger::SizeOf().

TargetMachine& llvm::AsmPrinter::TM

Target machine description.

Definition at line 70 of file AsmPrinter.h.

Referenced by llvm::DwarfCFIException::beginFunction(), llvm::WinException::beginFunction(), doFinalization(), doInitialization(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::DwarfDebug::DwarfDebug(), EmitAlignment(), EmitConstantPool(), llvm::ARMAsmPrinter::EmitEndOfAsmFile(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), EmitGlobalConstant(), emitGlobalConstantArray(), emitGlobalConstantDataSequential(), emitGlobalConstantFP(), emitGlobalConstantImpl(), emitGlobalConstantLargeInt(), emitGlobalConstantStruct(), emitGlobalConstantVector(), EmitGlobalVariable(), llvm::ARMAsmPrinter::EmitInstruction(), llvm::AMDGPUAsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitJumpTableAddrs(), EmitJumpTableInfo(), llvm::SystemZAsmPrinter::EmitMachineConstantPoolValue(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), EmitSpecialLLVMGlobal(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), llvm::X86AsmPrinter::EmitStartOfAsmFile(), llvm::MipsAsmPrinter::EmitStartOfAsmFile(), EmitTTypeReference(), llvm::ARMAsmPrinter::EmitXXStructor(), llvm::DwarfCFIException::endModule(), llvm::MSP430MCInstLower::GetConstantPoolIndexSymbol(), llvm::X86AsmPrinter::GetCPISymbol(), GetCPISymbol(), llvm::MipsAsmPrinter::getCurrentABIString(), getDataLayout(), GetExternalSymbolSymbol(), GetJTSetSymbol(), llvm::MSP430MCInstLower::GetJumpTableSymbol(), getNameWithPrefix(), getObjFileLowering(), GetSizeOfEncodedValue(), getSymbol(), GetSymbolFromOperand(), getSymbolWithGlobalValueBase(), getTargetTriple(), lowerConstant(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), llvm::AMDGPUAsmPrinter::PrintAsmOperand(), llvm::MipsAsmPrinter::printOperand(), PrintSpecial(), and llvm::MipsAsmPrinter::runOnMachineFunction().


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