LLVM 19.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::TargetLoweringObjectFile Class Referenceabstract

#include "llvm/Target/TargetLoweringObjectFile.h"

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

Public Member Functions

 TargetLoweringObjectFile ()=default
 
 TargetLoweringObjectFile (const TargetLoweringObjectFile &)=delete
 
TargetLoweringObjectFileoperator= (const TargetLoweringObjectFile &)=delete
 
virtual ~TargetLoweringObjectFile ()
 
ManglergetMangler () const
 
virtual void Initialize (MCContext &ctx, const TargetMachine &TM)
 This method must be called before any actual lowering is done.
 
virtual void emitPersonalityValue (MCStreamer &Streamer, const DataLayout &TM, const MCSymbol *Sym) const
 
virtual void emitModuleMetadata (MCStreamer &Streamer, Module &M) const
 Emit the module-level metadata that the platform cares about.
 
void emitCGProfileMetadata (MCStreamer &Streamer, Module &M) const
 Emit Call Graph Profile metadata.
 
virtual void getModuleMetadata (Module &M)
 Get the module-level metadata that the platform cares about.
 
virtual MCSectiongetSectionForConstant (const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment) const
 Given a constant with the SectionKind, return a section that it should be placed in.
 
virtual MCSectiongetSectionForMachineBasicBlock (const Function &F, const MachineBasicBlock &MBB, const TargetMachine &TM) const
 
virtual MCSectiongetUniqueSectionForFunction (const Function &F, const TargetMachine &TM) const
 
MCSectionSectionForGlobal (const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const
 This method computes the appropriate section to emit the specified global variable or function definition.
 
MCSectionSectionForGlobal (const GlobalObject *GO, const TargetMachine &TM) const
 This method computes the appropriate section to emit the specified global variable or function definition.
 
virtual void getNameWithPrefix (SmallVectorImpl< char > &OutName, const GlobalValue *GV, const TargetMachine &TM) const
 
virtual MCSectiongetSectionForJumpTable (const Function &F, const TargetMachine &TM) const
 
virtual MCSectiongetSectionForLSDA (const Function &, const MCSymbol &, const TargetMachine &) const
 
virtual bool shouldPutJumpTableInFunctionSection (bool UsesLabelDifference, const Function &F) const
 
virtual MCSectiongetExplicitSectionGlobal (const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const =0
 Targets should implement this method to assign a section to globals with an explicit section specfied.
 
virtual const MCExprgetTTypeGlobalReference (const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const
 Return an MCExpr to use for a reference to the specified global variable from exception handling information.
 
MCSymbolgetSymbolWithGlobalValueBase (const GlobalValue *GV, StringRef Suffix, const TargetMachine &TM) const
 Return the MCSymbol for a private symbol with global value name as its base, with the specified suffix.
 
virtual MCSymbolgetCFIPersonalitySymbol (const GlobalValue *GV, const TargetMachine &TM, MachineModuleInfo *MMI) const
 
unsigned getPersonalityEncoding () const
 
unsigned getLSDAEncoding () const
 
unsigned getTTypeEncoding () const
 
unsigned getCallSiteEncoding () const
 
const MCExprgetTTypeReference (const MCSymbolRefExpr *Sym, unsigned Encoding, MCStreamer &Streamer) const
 
virtual MCSectiongetStaticCtorSection (unsigned Priority, const MCSymbol *KeySym) const
 
virtual MCSectiongetStaticDtorSection (unsigned Priority, const MCSymbol *KeySym) const
 
virtual const MCExprgetDebugThreadLocalSymbol (const MCSymbol *Sym) const
 Create a symbol reference to describe the given TLS variable when emitting the address in debug info.
 
virtual const MCExprlowerRelativeReference (const GlobalValue *LHS, const GlobalValue *RHS, const TargetMachine &TM) const
 
bool supportDSOLocalEquivalentLowering () const
 Target supports a native lowering of a dso_local_equivalent constant without needing to replace it with equivalent IR.
 
virtual const MCExprlowerDSOLocalEquivalent (const DSOLocalEquivalent *Equiv, const TargetMachine &TM) const
 
bool supportIndirectSymViaGOTPCRel () const
 Target supports replacing a data "PC"-relative access to a symbol through another symbol, by accessing the later via a GOT entry instead?
 
bool supportGOTPCRelWithOffset () const
 Target GOT "PC"-relative relocation supports encoding an additional binary expression with an offset?
 
bool supportDebugThreadLocalLocation () const
 Target supports TLS offset relocation in debug section?
 
virtual MCRegister getStaticBase () const
 Returns the register used as static base in RWPI variants.
 
virtual const MCExprgetIndirectSymViaRWPI (const MCSymbol *Sym) const
 Get the target specific RWPI relocation.
 
virtual const MCExprgetIndirectSymViaGOTPCRel (const GlobalValue *GV, const MCSymbol *Sym, const MCValue &MV, int64_t Offset, MachineModuleInfo *MMI, MCStreamer &Streamer) const
 Get the target specific PC relative GOT entry relocation.
 
virtual MCSectiongetSectionForCommandLines () const
 If supported, return the section to use for the llvm.commandline metadata.
 
virtual MCSectiongetSectionForFunctionDescriptor (const Function *F, const TargetMachine &TM) const
 On targets that use separate function descriptor symbols, return a section for the descriptor given its symbol.
 
virtual MCSectiongetSectionForTOCEntry (const MCSymbol *S, const TargetMachine &TM) const
 On targets that support TOC entries, return a section for the entry given the symbol it refers to.
 
virtual MCSectiongetSectionForExternalReference (const GlobalObject *GO, const TargetMachine &TM) const
 On targets that associate external references with a section, return such a section for the given external global.
 
virtual MCSymbolgetTargetSymbol (const GlobalValue *GV, const TargetMachine &TM) const
 Targets that have a special convention for their symbols could use this hook to return a specialized symbol.
 
virtual MCSymbolgetFunctionEntryPointSymbol (const GlobalValue *Func, const TargetMachine &TM) const
 If supported, return the function entry point symbol.
 
- Public Member Functions inherited from llvm::MCObjectFileInfo
void initMCObjectFileInfo (MCContext &MCCtx, bool PIC, bool LargeCodeModel=false)
 
virtual ~MCObjectFileInfo ()
 
MCContextgetContext () const
 
bool getSupportsWeakOmittedEHFrame () const
 
bool getSupportsCompactUnwindWithoutEHFrame () const
 
bool getOmitDwarfIfHaveCompactUnwind () const
 
unsigned getFDEEncoding () const
 
unsigned getCompactUnwindDwarfEHFrameOnly () const
 
virtual unsigned getTextSectionAlignment () const
 
MCSectiongetTextSection () const
 
MCSectiongetDataSection () const
 
MCSectiongetBSSSection () const
 
MCSectiongetReadOnlySection () const
 
MCSectiongetLSDASection () const
 
MCSectiongetCompactUnwindSection () const
 
MCSectiongetDwarfAbbrevSection () const
 
MCSectiongetDwarfInfoSection () const
 
MCSectiongetDwarfInfoSection (uint64_t Hash) const
 
MCSectiongetDwarfLineSection () const
 
MCSectiongetDwarfLineStrSection () const
 
MCSectiongetDwarfFrameSection () const
 
MCSectiongetDwarfPubNamesSection () const
 
MCSectiongetDwarfPubTypesSection () const
 
MCSectiongetDwarfGnuPubNamesSection () const
 
MCSectiongetDwarfGnuPubTypesSection () const
 
const MCSectiongetDwarfDebugInlineSection () const
 
MCSectiongetDwarfStrSection () const
 
MCSectiongetDwarfLocSection () const
 
MCSectiongetDwarfARangesSection () const
 
MCSectiongetDwarfRangesSection () const
 
MCSectiongetDwarfRnglistsSection () const
 
MCSectiongetDwarfLoclistsSection () const
 
MCSectiongetDwarfMacinfoSection () const
 
MCSectiongetDwarfMacroSection () const
 
MCSectiongetDwarfDebugNamesSection () const
 
MCSectiongetDwarfAccelNamesSection () const
 
MCSectiongetDwarfAccelObjCSection () const
 
MCSectiongetDwarfAccelNamespaceSection () const
 
MCSectiongetDwarfAccelTypesSection () const
 
MCSectiongetDwarfInfoDWOSection () const
 
MCSectiongetDwarfTypesSection (uint64_t Hash) const
 
MCSectiongetDwarfTypesDWOSection () const
 
MCSectiongetDwarfAbbrevDWOSection () const
 
MCSectiongetDwarfStrDWOSection () const
 
MCSectiongetDwarfLineDWOSection () const
 
MCSectiongetDwarfLocDWOSection () const
 
MCSectiongetDwarfStrOffDWOSection () const
 
MCSectiongetDwarfStrOffSection () const
 
MCSectiongetDwarfAddrSection () const
 
MCSectiongetDwarfRnglistsDWOSection () const
 
MCSectiongetDwarfLoclistsDWOSection () const
 
MCSectiongetDwarfMacroDWOSection () const
 
MCSectiongetDwarfMacinfoDWOSection () const
 
MCSectiongetDwarfCUIndexSection () const
 
MCSectiongetDwarfTUIndexSection () const
 
MCSectiongetDwarfSwiftASTSection () const
 
MCSectiongetCOFFDebugSymbolsSection () const
 
MCSectiongetCOFFDebugTypesSection () const
 
MCSectiongetCOFFGlobalTypeHashesSection () const
 
MCSectiongetTLSExtraDataSection () const
 
const MCSectiongetTLSDataSection () const
 
MCSectiongetTLSBSSSection () const
 
MCSectiongetStackMapSection () const
 
MCSectiongetFaultMapSection () const
 
MCSectiongetRemarksSection () const
 
MCSectiongetStackSizesSection (const MCSection &TextSec) const
 
MCSectiongetBBAddrMapSection (const MCSection &TextSec) const
 
MCSectiongetKCFITrapSection (const MCSection &TextSec) const
 
MCSectiongetPseudoProbeSection (const MCSection &TextSec) const
 
MCSectiongetPseudoProbeDescSection (StringRef FuncName) const
 
MCSectiongetLLVMStatsSection () const
 
MCSectiongetPCSection (StringRef Name, const MCSection *TextSec) const
 
MCSectiongetDataRelROSection () const
 
const MCSectiongetMergeableConst4Section () const
 
const MCSectiongetMergeableConst8Section () const
 
const MCSectiongetMergeableConst16Section () const
 
const MCSectiongetMergeableConst32Section () const
 
const MCSectiongetTLSTLVSection () const
 
const MCSectiongetTLSThreadInitSection () const
 
const MCSectiongetCStringSection () const
 
const MCSectiongetUStringSection () const
 
MCSectiongetTextCoalSection () const
 
const MCSectiongetConstTextCoalSection () const
 
const MCSectiongetConstDataSection () const
 
const MCSectiongetDataCoalSection () const
 
const MCSectiongetConstDataCoalSection () const
 
const MCSectiongetDataCommonSection () const
 
MCSectiongetDataBSSSection () const
 
const MCSectiongetFourByteConstantSection () const
 
const MCSectiongetEightByteConstantSection () const
 
const MCSectiongetSixteenByteConstantSection () const
 
MCSectiongetLazySymbolPointerSection () const
 
MCSectiongetNonLazySymbolPointerSection () const
 
MCSectiongetThreadLocalPointerSection () const
 
MCSectiongetAddrSigSection () const
 
MCSectiongetDrectveSection () const
 
MCSectiongetPDataSection () const
 
MCSectiongetXDataSection () const
 
MCSectiongetSXDataSection () const
 
MCSectiongetGEHContSection () const
 
MCSectiongetGFIDsSection () const
 
MCSectiongetGIATsSection () const
 
MCSectiongetGLJMPSection () const
 
MCSectiongetPPA1Section () const
 
MCSectiongetPPA2Section () const
 
MCSectiongetPPA2ListSection () const
 
MCSectiongetADASection () const
 
MCSectiongetIDRLSection () const
 
MCSectiongetTOCBaseSection () const
 
MCSectiongetEHFrameSection () const
 
bool isPositionIndependent () const
 
MCSectiongetSwift5ReflectionSection (llvm::binaryformat::Swift5ReflectionSectionKind ReflSectionKind)
 
void setSDKVersion (const VersionTuple &TheSDKVersion)
 
const VersionTuplegetSDKVersion () const
 
void setDarwinTargetVariantTriple (const Triple &T)
 
const TriplegetDarwinTargetVariantTriple () const
 
void setDarwinTargetVariantSDKVersion (const VersionTuple &TheSDKVersion)
 
const VersionTuplegetDarwinTargetVariantSDKVersion () const
 

Static Public Member Functions

static SectionKind getKindForGlobal (const GlobalObject *GO, const TargetMachine &TM)
 Classify the specified global variable into a set of target independent categories embodied in SectionKind.
 

Protected Member Functions

virtual MCSectionSelectSectionForGlobal (const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const =0
 

Protected Attributes

bool SupportIndirectSymViaGOTPCRel = false
 
bool SupportGOTPCRelWithOffset = true
 
bool SupportDebugThreadLocalLocation = true
 
bool SupportDSOLocalEquivalentLowering = false
 
unsigned PersonalityEncoding = 0
 PersonalityEncoding, LSDAEncoding, TTypeEncoding - Some encoding values for EH.
 
unsigned LSDAEncoding = 0
 
unsigned TTypeEncoding = 0
 
unsigned CallSiteEncoding = 0
 
MCSectionStaticCtorSection = nullptr
 This section contains the static constructor pointer list.
 
MCSectionStaticDtorSection = nullptr
 This section contains the static destructor pointer list.
 
const TargetMachineTM = nullptr
 
- Protected Attributes inherited from llvm::MCObjectFileInfo
bool SupportsWeakOmittedEHFrame = false
 True if target object file supports a weak_definition of constant 0 for an omitted EH frame.
 
bool SupportsCompactUnwindWithoutEHFrame = false
 True if the target object file supports emitting a compact unwind section without an associated EH frame section.
 
bool OmitDwarfIfHaveCompactUnwind = false
 OmitDwarfIfHaveCompactUnwind - True if the target object file supports having some functions with compact unwind and other with dwarf unwind.
 
unsigned FDECFIEncoding = 0
 FDE CFI encoding.
 
unsigned CompactUnwindDwarfEHFrameOnly = 0
 Compact unwind encoding indicating that we should emit only an EH frame.
 
MCSectionTextSection = nullptr
 Section directive for standard text.
 
MCSectionDataSection = nullptr
 Section directive for standard data.
 
MCSectionBSSSection = nullptr
 Section that is default initialized to zero.
 
MCSectionReadOnlySection = nullptr
 Section that is readonly and can contain arbitrary initialized data.
 
MCSectionLSDASection = nullptr
 If exception handling is supported by the target, this is the section the Language Specific Data Area information is emitted to.
 
MCSectionCompactUnwindSection = nullptr
 If exception handling is supported by the target and the target can support a compact representation of the CIE and FDE, this is the section to emit them into.
 
MCSectionDwarfAbbrevSection = nullptr
 
MCSectionDwarfInfoSection = nullptr
 
MCSectionDwarfLineSection = nullptr
 
MCSectionDwarfLineStrSection = nullptr
 
MCSectionDwarfFrameSection = nullptr
 
MCSectionDwarfPubTypesSection = nullptr
 
const MCSectionDwarfDebugInlineSection = nullptr
 
MCSectionDwarfStrSection = nullptr
 
MCSectionDwarfLocSection = nullptr
 
MCSectionDwarfARangesSection = nullptr
 
MCSectionDwarfRangesSection = nullptr
 
MCSectionDwarfMacinfoSection = nullptr
 
MCSectionDwarfMacroSection = nullptr
 
MCSectionDwarfPubNamesSection = nullptr
 
MCSectionDwarfDebugNamesSection = nullptr
 Accelerator table sections.
 
MCSectionDwarfAccelNamesSection = nullptr
 
MCSectionDwarfAccelObjCSection = nullptr
 
MCSectionDwarfAccelNamespaceSection = nullptr
 
MCSectionDwarfAccelTypesSection = nullptr
 
MCSectionDwarfInfoDWOSection = nullptr
 
MCSectionDwarfTypesDWOSection = nullptr
 
MCSectionDwarfAbbrevDWOSection = nullptr
 
MCSectionDwarfStrDWOSection = nullptr
 
MCSectionDwarfLineDWOSection = nullptr
 
MCSectionDwarfLocDWOSection = nullptr
 
MCSectionDwarfStrOffDWOSection = nullptr
 
MCSectionDwarfMacinfoDWOSection = nullptr
 
MCSectionDwarfMacroDWOSection = nullptr
 
MCSectionDwarfStrOffSection = nullptr
 The DWARF v5 string offset and address table sections.
 
MCSectionDwarfAddrSection = nullptr
 
MCSectionDwarfRnglistsSection = nullptr
 The DWARF v5 range list section.
 
MCSectionDwarfLoclistsSection = nullptr
 The DWARF v5 locations list section.
 
MCSectionDwarfRnglistsDWOSection = nullptr
 The DWARF v5 range and location list sections for fission.
 
MCSectionDwarfLoclistsDWOSection = nullptr
 
MCSectionDwarfCUIndexSection = nullptr
 
MCSectionDwarfTUIndexSection = nullptr
 
MCSectionDwarfGnuPubNamesSection = nullptr
 Section for newer gnu pubnames.
 
MCSectionDwarfGnuPubTypesSection = nullptr
 Section for newer gnu pubtypes.
 
MCSectionDwarfSwiftASTSection = nullptr
 
MCSectionCOFFDebugSymbolsSection = nullptr
 
MCSectionCOFFDebugTypesSection = nullptr
 
MCSectionCOFFGlobalTypeHashesSection = nullptr
 
MCSectionTLSExtraDataSection = nullptr
 Extra TLS Variable Data section.
 
MCSectionTLSDataSection = nullptr
 Section directive for Thread Local data. ELF, MachO, COFF, and Wasm.
 
MCSectionTLSBSSSection = nullptr
 Section directive for Thread Local uninitialized data.
 
MCSectionStackMapSection = nullptr
 StackMap section.
 
MCSectionFaultMapSection = nullptr
 FaultMap section.
 
MCSectionRemarksSection = nullptr
 Remarks section.
 
MCSectionEHFrameSection = nullptr
 EH frame section.
 
MCSectionStackSizesSection = nullptr
 Section containing metadata on function stack sizes.
 
MCSectionPseudoProbeSection = nullptr
 Section for pseudo probe information used by AutoFDO.
 
MCSectionPseudoProbeDescSection = nullptr
 
MCSectionLLVMStatsSection = nullptr
 
MCSectionDataRelROSection = nullptr
 
MCSectionMergeableConst4Section = nullptr
 
MCSectionMergeableConst8Section = nullptr
 
MCSectionMergeableConst16Section = nullptr
 
MCSectionMergeableConst32Section = nullptr
 
MCSectionTLSTLVSection = nullptr
 Section for thread local structure information.
 
const MCSectionTLSThreadInitSection = nullptr
 Section for thread local data initialization functions.
 
MCSectionCStringSection = nullptr
 
MCSectionUStringSection = nullptr
 
MCSectionTextCoalSection = nullptr
 
MCSectionConstTextCoalSection = nullptr
 
MCSectionConstDataSection = nullptr
 
MCSectionDataCoalSection = nullptr
 
MCSectionConstDataCoalSection = nullptr
 
MCSectionDataCommonSection = nullptr
 
MCSectionDataBSSSection = nullptr
 
MCSectionFourByteConstantSection = nullptr
 
MCSectionEightByteConstantSection = nullptr
 
MCSectionSixteenByteConstantSection = nullptr
 
MCSectionLazySymbolPointerSection = nullptr
 
MCSectionNonLazySymbolPointerSection = nullptr
 
MCSectionThreadLocalPointerSection = nullptr
 
MCSectionAddrSigSection = nullptr
 
MCSectionDrectveSection = nullptr
 COFF specific sections.
 
MCSectionPDataSection = nullptr
 
MCSectionXDataSection = nullptr
 
MCSectionSXDataSection = nullptr
 
MCSectionGEHContSection = nullptr
 
MCSectionGFIDsSection = nullptr
 
MCSectionGIATsSection = nullptr
 
MCSectionGLJMPSection = nullptr
 
MCSectionPPA1Section = nullptr
 
MCSectionPPA2Section = nullptr
 
MCSectionPPA2ListSection = nullptr
 
MCSectionADASection = nullptr
 
MCSectionIDRLSection = nullptr
 
MCSectionTOCBaseSection = nullptr
 
MCSectionReadOnly8Section = nullptr
 
MCSectionReadOnly16Section = nullptr
 
std::array< MCSection *, binaryformat::Swift5ReflectionSectionKind::lastSwift5ReflectionSections = {}
 

Detailed Description

Definition at line 45 of file TargetLoweringObjectFile.h.

Constructor & Destructor Documentation

◆ TargetLoweringObjectFile() [1/2]

llvm::TargetLoweringObjectFile::TargetLoweringObjectFile ( )
default

◆ TargetLoweringObjectFile() [2/2]

llvm::TargetLoweringObjectFile::TargetLoweringObjectFile ( const TargetLoweringObjectFile )
delete

◆ ~TargetLoweringObjectFile()

TargetLoweringObjectFile::~TargetLoweringObjectFile ( )
virtual

Definition at line 55 of file TargetLoweringObjectFile.cpp.

Member Function Documentation

◆ emitCGProfileMetadata()

void TargetLoweringObjectFile::emitCGProfileMetadata ( MCStreamer Streamer,
Module M 
) const

◆ emitModuleMetadata()

virtual void llvm::TargetLoweringObjectFile::emitModuleMetadata ( MCStreamer Streamer,
Module M 
) const
inlinevirtual

Emit the module-level metadata that the platform cares about.

Reimplemented in llvm::TargetLoweringObjectFileELF, llvm::TargetLoweringObjectFileMachO, and llvm::TargetLoweringObjectFileCOFF.

Definition at line 88 of file TargetLoweringObjectFile.h.

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

◆ emitPersonalityValue()

void TargetLoweringObjectFile::emitPersonalityValue ( MCStreamer Streamer,
const DataLayout TM,
const MCSymbol Sym 
) const
virtual

◆ getCallSiteEncoding()

unsigned TargetLoweringObjectFile::getCallSiteEncoding ( ) const

◆ getCFIPersonalitySymbol()

MCSymbol * TargetLoweringObjectFile::getCFIPersonalitySymbol ( const GlobalValue GV,
const TargetMachine TM,
MachineModuleInfo MMI 
) const
virtual

◆ getDebugThreadLocalSymbol()

const MCExpr * TargetLoweringObjectFile::getDebugThreadLocalSymbol ( const MCSymbol Sym) const
virtual

Create a symbol reference to describe the given TLS variable when emitting the address in debug info.

Reimplemented in llvm::ARMElfTargetObjectFile, llvm::MipsTargetObjectFile, llvm::SystemZELFTargetObjectFile, and llvm::X86ELFTargetObjectFile.

Definition at line 432 of file TargetLoweringObjectFile.cpp.

References llvm::MCSymbolRefExpr::create(), llvm::MCObjectFileInfo::getContext(), and Sym.

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

◆ getExplicitSectionGlobal()

virtual MCSection * llvm::TargetLoweringObjectFile::getExplicitSectionGlobal ( const GlobalObject GO,
SectionKind  Kind,
const TargetMachine TM 
) const
pure virtual

◆ getFunctionEntryPointSymbol()

virtual MCSymbol * llvm::TargetLoweringObjectFile::getFunctionEntryPointSymbol ( const GlobalValue Func,
const TargetMachine TM 
) const
inlinevirtual

If supported, return the function entry point symbol.

Otherwise, returns nullptr. Func must be a function or an alias which has a function as base object.

Reimplemented in llvm::TargetLoweringObjectFileXCOFF.

Definition at line 282 of file TargetLoweringObjectFile.h.

Referenced by llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::SetupMachineFunction(), and transformCallee().

◆ getIndirectSymViaGOTPCRel()

virtual const MCExpr * llvm::TargetLoweringObjectFile::getIndirectSymViaGOTPCRel ( const GlobalValue GV,
const MCSymbol Sym,
const MCValue MV,
int64_t  Offset,
MachineModuleInfo MMI,
MCStreamer Streamer 
) const
inlinevirtual

◆ getIndirectSymViaRWPI()

virtual const MCExpr * llvm::TargetLoweringObjectFile::getIndirectSymViaRWPI ( const MCSymbol Sym) const
inlinevirtual

Get the target specific RWPI relocation.

Reimplemented in llvm::ARMElfTargetObjectFile.

Definition at line 228 of file TargetLoweringObjectFile.h.

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

◆ getKindForGlobal()

SectionKind TargetLoweringObjectFile::getKindForGlobal ( const GlobalObject GO,
const TargetMachine TM 
)
static

Classify the specified global variable into a set of target independent categories embodied in SectionKind.

getKindForGlobal - This is a top-level target-independent classifier for a global object.

Given a global variable and information from the TM, this function classifies the global in a target independent manner. This function may be overridden by the target implementation.

Definition at line 200 of file TargetLoweringObjectFile.cpp.

References assert(), llvm::CallingConv::C, llvm::SectionKind::getBSS(), llvm::SectionKind::getBSSExtern(), llvm::SectionKind::getBSSLocal(), llvm::SectionKind::getCommon(), llvm::SectionKind::getData(), llvm::SectionKind::getExclude(), llvm::SectionKind::getMergeable1ByteCString(), llvm::SectionKind::getMergeable2ByteCString(), llvm::SectionKind::getMergeable4ByteCString(), llvm::SectionKind::getMergeableConst16(), llvm::SectionKind::getMergeableConst32(), llvm::SectionKind::getMergeableConst4(), llvm::SectionKind::getMergeableConst8(), llvm::SectionKind::getReadOnly(), llvm::SectionKind::getReadOnlyWithRel(), llvm::TargetMachine::getRelocationModel(), llvm::SectionKind::getText(), llvm::SectionKind::getThreadBSS(), llvm::SectionKind::getThreadBSSLocal(), llvm::SectionKind::getThreadData(), llvm::GlobalValue::isDeclarationForLinker(), IsNullTerminatedString(), isSuitableForBSS(), llvm::TargetOptions::NoZerosInBSS, llvm::TargetMachine::Options, llvm::Reloc::ROPI, llvm::Reloc::ROPI_RWPI, llvm::Reloc::RWPI, llvm::Reloc::Static, and TM.

Referenced by llvm::DwarfCompileUnit::addLocationAttribute(), llvm::AsmPrinter::emitGlobalVariable(), llvm::TargetLoweringObjectFileMachO::getNameWithPrefix(), llvm::TargetLoweringObjectFileXCOFF::getTargetSymbol(), llvm::SystemZSubtarget::isAddressedViaADA(), llvm::LanaiTargetObjectFile::isGlobalInSmallSection(), llvm::MipsTargetObjectFile::IsGlobalInSmallSection(), and SectionForGlobal().

◆ getLSDAEncoding()

unsigned llvm::TargetLoweringObjectFile::getLSDAEncoding ( ) const
inline

◆ getMangler()

Mangler & llvm::TargetLoweringObjectFile::getMangler ( ) const
inline

◆ getModuleMetadata()

virtual void llvm::TargetLoweringObjectFile::getModuleMetadata ( Module M)
inlinevirtual

Get the module-level metadata that the platform cares about.

Reimplemented in llvm::TargetLoweringObjectFileELF, llvm::TargetLoweringObjectFileWasm, and llvm::RISCVELFTargetObjectFile.

Definition at line 94 of file TargetLoweringObjectFile.h.

◆ getNameWithPrefix()

void TargetLoweringObjectFile::getNameWithPrefix ( SmallVectorImpl< char > &  OutName,
const GlobalValue GV,
const TargetMachine TM 
) const
virtual

◆ getPersonalityEncoding()

unsigned llvm::TargetLoweringObjectFile::getPersonalityEncoding ( ) const
inline

◆ getSectionForCommandLines()

virtual MCSection * llvm::TargetLoweringObjectFile::getSectionForCommandLines ( ) const
inlinevirtual

If supported, return the section to use for the llvm.commandline metadata.

Otherwise, return nullptr.

Reimplemented in llvm::TargetLoweringObjectFileELF, and llvm::TargetLoweringObjectFileMachO.

Definition at line 244 of file TargetLoweringObjectFile.h.

◆ getSectionForConstant()

MCSection * TargetLoweringObjectFile::getSectionForConstant ( const DataLayout DL,
SectionKind  Kind,
const Constant C,
Align Alignment 
) const
virtual

◆ getSectionForExternalReference()

virtual MCSection * llvm::TargetLoweringObjectFile::getSectionForExternalReference ( const GlobalObject GO,
const TargetMachine TM 
) const
inlinevirtual

On targets that associate external references with a section, return such a section for the given external global.

Reimplemented in llvm::TargetLoweringObjectFileXCOFF.

Definition at line 267 of file TargetLoweringObjectFile.h.

◆ getSectionForFunctionDescriptor()

virtual MCSection * llvm::TargetLoweringObjectFile::getSectionForFunctionDescriptor ( const Function F,
const TargetMachine TM 
) const
inlinevirtual

On targets that use separate function descriptor symbols, return a section for the descriptor given its symbol.

Use only with defined functions.

Reimplemented in llvm::TargetLoweringObjectFileXCOFF.

Definition at line 251 of file TargetLoweringObjectFile.h.

◆ getSectionForJumpTable()

MCSection * TargetLoweringObjectFile::getSectionForJumpTable ( const Function F,
const TargetMachine TM 
) const
virtual

◆ getSectionForLSDA()

virtual MCSection * llvm::TargetLoweringObjectFile::getSectionForLSDA ( const Function ,
const MCSymbol ,
const TargetMachine  
) const
inlinevirtual

◆ getSectionForMachineBasicBlock()

MCSection * TargetLoweringObjectFile::getSectionForMachineBasicBlock ( const Function F,
const MachineBasicBlock MBB,
const TargetMachine TM 
) const
virtual

Reimplemented in llvm::TargetLoweringObjectFileELF.

Definition at line 389 of file TargetLoweringObjectFile.cpp.

◆ getSectionForTOCEntry()

virtual MCSection * llvm::TargetLoweringObjectFile::getSectionForTOCEntry ( const MCSymbol S,
const TargetMachine TM 
) const
inlinevirtual

On targets that support TOC entries, return a section for the entry given the symbol it refers to.

TODO: Implement this interface for existing ELF targets.

Reimplemented in llvm::TargetLoweringObjectFileXCOFF.

Definition at line 259 of file TargetLoweringObjectFile.h.

◆ getStaticBase()

virtual MCRegister llvm::TargetLoweringObjectFile::getStaticBase ( ) const
inlinevirtual

Returns the register used as static base in RWPI variants.

Reimplemented in llvm::ARMElfTargetObjectFile.

Definition at line 225 of file TargetLoweringObjectFile.h.

References llvm::MCRegister::NoRegister.

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

◆ getStaticCtorSection()

virtual MCSection * llvm::TargetLoweringObjectFile::getStaticCtorSection ( unsigned  Priority,
const MCSymbol KeySym 
) const
inlinevirtual

◆ getStaticDtorSection()

virtual MCSection * llvm::TargetLoweringObjectFile::getStaticDtorSection ( unsigned  Priority,
const MCSymbol KeySym 
) const
inlinevirtual

◆ getSymbolWithGlobalValueBase()

MCSymbol * TargetLoweringObjectFile::getSymbolWithGlobalValueBase ( const GlobalValue GV,
StringRef  Suffix,
const TargetMachine TM 
) const

◆ getTargetSymbol()

virtual MCSymbol * llvm::TargetLoweringObjectFile::getTargetSymbol ( const GlobalValue GV,
const TargetMachine TM 
) const
inlinevirtual

Targets that have a special convention for their symbols could use this hook to return a specialized symbol.

Reimplemented in llvm::TargetLoweringObjectFileXCOFF.

Definition at line 274 of file TargetLoweringObjectFile.h.

Referenced by llvm::TargetMachine::getSymbol().

◆ getTTypeEncoding()

unsigned llvm::TargetLoweringObjectFile::getTTypeEncoding ( ) const
inline

Definition at line 170 of file TargetLoweringObjectFile.h.

References TTypeEncoding.

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

◆ getTTypeGlobalReference()

const MCExpr * TargetLoweringObjectFile::getTTypeGlobalReference ( const GlobalValue GV,
unsigned  Encoding,
const TargetMachine TM,
MachineModuleInfo MMI,
MCStreamer Streamer 
) const
virtual

◆ getTTypeReference()

const MCExpr * TargetLoweringObjectFile::getTTypeReference ( const MCSymbolRefExpr Sym,
unsigned  Encoding,
MCStreamer Streamer 
) const

◆ getUniqueSectionForFunction()

MCSection * TargetLoweringObjectFile::getUniqueSectionForFunction ( const Function F,
const TargetMachine TM 
) const
virtual

Reimplemented in llvm::TargetLoweringObjectFileELF.

Definition at line 395 of file TargetLoweringObjectFile.cpp.

◆ Initialize()

void TargetLoweringObjectFile::Initialize ( MCContext ctx,
const TargetMachine TM 
)
virtual

◆ lowerDSOLocalEquivalent()

virtual const MCExpr * llvm::TargetLoweringObjectFile::lowerDSOLocalEquivalent ( const DSOLocalEquivalent Equiv,
const TargetMachine TM 
) const
inlinevirtual

Reimplemented in llvm::TargetLoweringObjectFileELF.

Definition at line 202 of file TargetLoweringObjectFile.h.

Referenced by llvm::AsmPrinter::lowerConstant().

◆ lowerRelativeReference()

virtual const MCExpr * llvm::TargetLoweringObjectFile::lowerRelativeReference ( const GlobalValue LHS,
const GlobalValue RHS,
const TargetMachine TM 
) const
inlinevirtual

◆ operator=()

TargetLoweringObjectFile & llvm::TargetLoweringObjectFile::operator= ( const TargetLoweringObjectFile )
delete

◆ SectionForGlobal() [1/2]

MCSection * TargetLoweringObjectFile::SectionForGlobal ( const GlobalObject GO,
const TargetMachine TM 
) const

This method computes the appropriate section to emit the specified global variable or function definition.

This should not be passed external (or available externally) globals.

Definition at line 350 of file TargetLoweringObjectFile.cpp.

References getKindForGlobal(), SectionForGlobal(), and TM.

◆ SectionForGlobal() [2/2]

MCSection * TargetLoweringObjectFile::SectionForGlobal ( const GlobalObject GO,
SectionKind  Kind,
const TargetMachine TM 
) const

This method computes the appropriate section to emit the specified global variable or function definition.

This should not be passed external (or available externally) globals.

Definition at line 321 of file TargetLoweringObjectFile.cpp.

References F, getExplicitSectionGlobal(), llvm::GlobalObject::hasSection(), SelectSectionForGlobal(), and TM.

Referenced by llvm::AVRAsmPrinter::doFinalization(), llvm::AsmPrinter::emitGlobalVariable(), llvm::TargetLoweringObjectFileMachO::getNameWithPrefix(), llvm::TargetLoweringObjectFileXCOFF::getTargetSymbol(), and SectionForGlobal().

◆ SelectSectionForGlobal()

virtual MCSection * llvm::TargetLoweringObjectFile::SelectSectionForGlobal ( const GlobalObject GO,
SectionKind  Kind,
const TargetMachine TM 
) const
protectedpure virtual

◆ shouldPutJumpTableInFunctionSection()

bool TargetLoweringObjectFile::shouldPutJumpTableInFunctionSection ( bool  UsesLabelDifference,
const Function F 
) const
virtual

◆ supportDebugThreadLocalLocation()

bool llvm::TargetLoweringObjectFile::supportDebugThreadLocalLocation ( ) const
inline

Target supports TLS offset relocation in debug section?

Definition at line 220 of file TargetLoweringObjectFile.h.

References SupportDebugThreadLocalLocation.

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

◆ supportDSOLocalEquivalentLowering()

bool llvm::TargetLoweringObjectFile::supportDSOLocalEquivalentLowering ( ) const
inline

Target supports a native lowering of a dso_local_equivalent constant without needing to replace it with equivalent IR.

Definition at line 198 of file TargetLoweringObjectFile.h.

References SupportDSOLocalEquivalentLowering.

Referenced by llvm::TargetLoweringObjectFileELF::lowerDSOLocalEquivalent().

◆ supportGOTPCRelWithOffset()

bool llvm::TargetLoweringObjectFile::supportGOTPCRelWithOffset ( ) const
inline

Target GOT "PC"-relative relocation supports encoding an additional binary expression with an offset?

Definition at line 215 of file TargetLoweringObjectFile.h.

References SupportGOTPCRelWithOffset.

Referenced by handleIndirectSymViaGOTPCRel().

◆ supportIndirectSymViaGOTPCRel()

bool llvm::TargetLoweringObjectFile::supportIndirectSymViaGOTPCRel ( ) const
inline

Target supports replacing a data "PC"-relative access to a symbol through another symbol, by accessing the later via a GOT entry instead?

Definition at line 209 of file TargetLoweringObjectFile.h.

References SupportIndirectSymViaGOTPCRel.

Referenced by emitGlobalConstantImpl().

Member Data Documentation

◆ CallSiteEncoding

unsigned llvm::TargetLoweringObjectFile::CallSiteEncoding = 0
protected

◆ LSDAEncoding

unsigned llvm::TargetLoweringObjectFile::LSDAEncoding = 0
protected

◆ PersonalityEncoding

unsigned llvm::TargetLoweringObjectFile::PersonalityEncoding = 0
protected

◆ StaticCtorSection

MCSection* llvm::TargetLoweringObjectFile::StaticCtorSection = nullptr
protected

◆ StaticDtorSection

MCSection* llvm::TargetLoweringObjectFile::StaticDtorSection = nullptr
protected

◆ SupportDebugThreadLocalLocation

bool llvm::TargetLoweringObjectFile::SupportDebugThreadLocalLocation = true
protected

◆ SupportDSOLocalEquivalentLowering

bool llvm::TargetLoweringObjectFile::SupportDSOLocalEquivalentLowering = false
protected

◆ SupportGOTPCRelWithOffset

bool llvm::TargetLoweringObjectFile::SupportGOTPCRelWithOffset = true
protected

◆ SupportIndirectSymViaGOTPCRel

bool llvm::TargetLoweringObjectFile::SupportIndirectSymViaGOTPCRel = false
protected

◆ TM

const TargetMachine* llvm::TargetLoweringObjectFile::TM = nullptr
protected

Definition at line 68 of file TargetLoweringObjectFile.h.

Referenced by emitCGProfileMetadata(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), getCFIPersonalitySymbol(), llvm::TargetLoweringObjectFileELF::getCFIPersonalitySymbol(), llvm::TargetLoweringObjectFileMachO::getCFIPersonalitySymbol(), llvm::AArch64_MachoTargetObjectFile::getCFIPersonalitySymbol(), llvm::X86_64MachoTargetObjectFile::getCFIPersonalitySymbol(), llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileWasm::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileXCOFF::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileGOFF::getExplicitSectionGlobal(), llvm::AMDGPUTargetObjectFile::getExplicitSectionGlobal(), llvm::ARMElfTargetObjectFile::getExplicitSectionGlobal(), llvm::HexagonTargetObjectFile::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileXCOFF::getFunctionEntryPointSymbol(), getKindForGlobal(), llvm::TargetLoweringObjectFileMachO::getNameWithPrefix(), llvm::TargetLoweringObjectFileXCOFF::getSectionForExternalReference(), llvm::TargetLoweringObjectFileXCOFF::getSectionForFunctionDescriptor(), llvm::TargetLoweringObjectFileELF::getSectionForJumpTable(), llvm::TargetLoweringObjectFileXCOFF::getSectionForJumpTable(), llvm::TargetLoweringObjectFileELF::getSectionForLSDA(), llvm::TargetLoweringObjectFileXCOFF::getSectionForLSDA(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), llvm::TargetLoweringObjectFileXCOFF::getSectionForTOCEntry(), getSymbolWithGlobalValueBase(), llvm::TargetLoweringObjectFileXCOFF::getTargetSymbol(), getTTypeGlobalReference(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::ARMElfTargetObjectFile::getTTypeGlobalReference(), llvm::SparcELFTargetObjectFile::getTTypeGlobalReference(), llvm::X86_64MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileELF::getUniqueSectionForFunction(), Initialize(), llvm::TargetLoweringObjectFileMachO::Initialize(), llvm::ARMElfTargetObjectFile::Initialize(), llvm::AVRTargetObjectFile::Initialize(), llvm::CSKYELFTargetObjectFile::Initialize(), llvm::HexagonTargetObjectFile::Initialize(), llvm::LanaiTargetObjectFile::Initialize(), llvm::RISCVELFTargetObjectFile::Initialize(), llvm::SparcELFTargetObjectFile::Initialize(), llvm::SPIRVTargetObjectFile::Initialize(), llvm::WebAssemblyTargetObjectFile::Initialize(), llvm::XCoreTargetObjectFile::Initialize(), llvm::HexagonTargetObjectFile::isGlobalInSmallSection(), llvm::LanaiTargetObjectFile::isGlobalInSmallSection(), llvm::HexagonTargetObjectFile::isSmallDataEnabled(), llvm::TargetLoweringObjectFileELF::lowerDSOLocalEquivalent(), llvm::TargetLoweringObjectFileELF::lowerRelativeReference(), llvm::TargetLoweringObjectFileWasm::lowerRelativeReference(), SectionForGlobal(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileWasm::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileXCOFF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileGOFF::SelectSectionForGlobal(), llvm::AMDGPUTargetObjectFile::SelectSectionForGlobal(), llvm::ARMElfTargetObjectFile::SelectSectionForGlobal(), llvm::AVRTargetObjectFile::SelectSectionForGlobal(), llvm::HexagonTargetObjectFile::SelectSectionForGlobal(), llvm::LanaiTargetObjectFile::SelectSectionForGlobal(), llvm::RISCVELFTargetObjectFile::SelectSectionForGlobal(), and llvm::XCoreTargetObjectFile::SelectSectionForGlobal().

◆ TTypeEncoding

unsigned llvm::TargetLoweringObjectFile::TTypeEncoding = 0
protected

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