LLVM: llvm::TargetLoweringObjectFileELF Class Reference (original) (raw)

Public Member Functions

~TargetLoweringObjectFileELF () override=default

void

Initialize (MCContext &Ctx, const TargetMachine &TM) override

This method must be called before any actual lowering is done.

void

getModuleMetadata (Module &M) override

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

void

emitModuleMetadata (MCStreamer &Streamer, Module &M) const override

Emit Obj-C garbage collection and linker options.

void

emitPersonalityValue (MCStreamer &Streamer, const DataLayout &DL, const MCSymbol *Sym, const MachineModuleInfo *MMI) const override

virtual void

emitPersonalityValueImpl (MCStreamer &Streamer, const DataLayout &DL, const MCSymbol *Sym, const MachineModuleInfo *MMI) const

void

emitLinkerDirectives (MCStreamer &Streamer, Module &M) const override

Process linker options metadata and emit platform-specific bits.

MCSection *

getSectionForConstant (const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment) const override

Given a constant with the SectionKind, return a section that it should be placed in.

MCSection *

getSectionForConstant (const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment, StringRef SectionSuffix) const override

Similar to the function above, but append SectionSuffix to the section name.

MCSection *

getExplicitSectionGlobal (const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override

Targets should implement this method to assign a section to globals with an explicit section specfied.

MCSection *

SelectSectionForGlobal (const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override

MCSection *

getSectionForJumpTable (const Function &F, const TargetMachine &TM) const override

MCSection *

getSectionForJumpTable (const Function &F, const TargetMachine &TM, const MachineJumpTableEntry *JTE) const override

MCSection *

getSectionForLSDA (const Function &F, const MCSymbol &FnSym, const TargetMachine &TM) const override

MCSection *

getSectionForMachineBasicBlock (const Function &F, const MachineBasicBlock &MBB, const TargetMachine &TM) const override

Returns a unique section for the given machine basic block.

MCSection *

getUniqueSectionForFunction (const Function &F, const TargetMachine &TM) const override

bool

shouldPutJumpTableInFunctionSection (bool UsesLabelDifference, const Function &F) const override

const MCExpr *

getTTypeGlobalReference (const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const override

Return an MCExpr to use for a reference to the specified type info global variable from exception handling information.

MCSymbol *

getCFIPersonalitySymbol (const GlobalValue *GV, const TargetMachine &TM, MachineModuleInfo *MMI) const override

void

InitializeELF (bool UseInitArray_)

MCSection *

getStaticCtorSection (unsigned Priority, const MCSymbol *KeySym) const override

MCSection *

getStaticDtorSection (unsigned Priority, const MCSymbol *KeySym) const override

const MCExpr *

lowerSymbolDifference (const MCSymbol *LHS, const MCSymbol *RHS, int64_t Addend, std::optional< int64_t > PCRelativeOffset) const

const MCExpr *

lowerDSOLocalEquivalent (const MCSymbol *LHS, const MCSymbol *RHS, int64_t Addend, std::optional< int64_t > PCRelativeOffset, const TargetMachine &TM) const override

MCSection *

getSectionForCommandLines () const override

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

Public Member Functions inherited from llvm::TargetLoweringObjectFile

TargetLoweringObjectFile ()=default

TargetLoweringObjectFile (const TargetLoweringObjectFile &)=delete

TargetLoweringObjectFile &

operator= (const TargetLoweringObjectFile &)=delete

~TargetLoweringObjectFile () override

Mangler &

getMangler () const

void

emitCGProfileMetadata (MCStreamer &Streamer, Module &M) const

Emit Call Graph Profile metadata.

void

emitPseudoProbeDescMetadata (MCStreamer &Streamer, Module &M, std::function< void(MCStreamer &Streamer)> COMDATSymEmitter=nullptr) const

Emit pseudo_probe_desc metadata.

MCSection *

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.

MCSection *

SectionForGlobal (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

MCSymbol *

getSymbolWithGlobalValueBase (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.

unsigned

getPersonalityEncoding () const

unsigned

getLSDAEncoding () const

unsigned

getTTypeEncoding () const

unsigned

getCallSiteEncoding () const

const MCExpr *

getTTypeReference (const MCSymbolRefExpr *Sym, unsigned Encoding, MCStreamer &Streamer) const

virtual const MCExpr *

getDebugThreadLocalSymbol (const MCSymbol *Sym) const

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

virtual const MCExpr *

lowerRelativeReference (const GlobalValue *LHS, const GlobalValue *RHS, int64_t Addend, std::optional< int64_t > PCRelativeOffset, const TargetMachine &TM) const

bool

hasPLTPCRelative () const

Target supports a PC-relative relocation that references the PLT of a function.

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 MCExpr *

getIndirectSymViaRWPI (const MCSymbol *Sym) const

Get the target specific RWPI relocation.

virtual const MCExpr *

getIndirectSymViaGOTPCRel (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 MCSection *

getSectionForFunctionDescriptor (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 MCSection *

getSectionForTOCEntry (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 MCSection *

getSectionForExternalReference (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 MCSymbol *

getTargetSymbol (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 MCSymbol *

getFunctionEntryPointSymbol (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 ()

MCContext &

getContext () const

bool

getSupportsCompactUnwindWithoutEHFrame () const

bool

getOmitDwarfIfHaveCompactUnwind () const

unsigned

getFDEEncoding () const

unsigned

getCompactUnwindDwarfEHFrameOnly () const

std::optional< sframe::ABI >

getSFrameABIArch () const

virtual unsigned

getTextSectionAlignment () const

MCSection *

getTextSection () const

MCSection *

getDataSection () const

MCSection *

getBSSSection () const

MCSection *

getReadOnlySection () const

MCSection *

getLSDASection () const

MCSection *

getImportCallSection () const

MCSection *

getCompactUnwindSection () const

MCSection *

getDwarfAbbrevSection () const

MCSection *

getDwarfInfoSection () const

MCSection *

getDwarfInfoSection (uint64_t Hash) const

MCSection *

getDwarfLineSection () const

MCSection *

getDwarfLineStrSection () const

MCSection *

getDwarfFrameSection () const

MCSection *

getDwarfPubNamesSection () const

MCSection *

getDwarfPubTypesSection () const

MCSection *

getDwarfGnuPubNamesSection () const

MCSection *

getDwarfGnuPubTypesSection () const

const MCSection *

getDwarfDebugInlineSection () const

MCSection *

getDwarfStrSection () const

MCSection *

getDwarfLocSection () const

MCSection *

getDwarfARangesSection () const

MCSection *

getDwarfRangesSection () const

MCSection *

getDwarfRnglistsSection () const

MCSection *

getDwarfLoclistsSection () const

MCSection *

getDwarfMacinfoSection () const

MCSection *

getDwarfMacroSection () const

MCSection *

getDwarfDebugNamesSection () const

MCSection *

getDwarfAccelNamesSection () const

MCSection *

getDwarfAccelObjCSection () const

MCSection *

getDwarfAccelNamespaceSection () const

MCSection *

getDwarfAccelTypesSection () const

MCSection *

getDwarfInfoDWOSection () const

MCSection *

getDwarfTypesSection (uint64_t Hash) const

MCSection *

getDwarfTypesDWOSection () const

MCSection *

getDwarfAbbrevDWOSection () const

MCSection *

getDwarfStrDWOSection () const

MCSection *

getDwarfLineDWOSection () const

MCSection *

getDwarfLocDWOSection () const

MCSection *

getDwarfStrOffDWOSection () const

MCSection *

getDwarfStrOffSection () const

MCSection *

getDwarfAddrSection () const

MCSection *

getDwarfRnglistsDWOSection () const

MCSection *

getDwarfLoclistsDWOSection () const

MCSection *

getDwarfMacroDWOSection () const

MCSection *

getDwarfMacinfoDWOSection () const

MCSection *

getDwarfCUIndexSection () const

MCSection *

getDwarfTUIndexSection () const

MCSection *

getDwarfSwiftASTSection () const

MCSection *

getCOFFDebugSymbolsSection () const

MCSection *

getCOFFDebugTypesSection () const

MCSection *

getCOFFGlobalTypeHashesSection () const

MCSection *

getTLSExtraDataSection () const

const MCSection *

getTLSDataSection () const

MCSection *

getTLSBSSSection () const

MCSection *

getStackMapSection () const

MCSection *

getFaultMapSection () const

MCSection *

getRemarksSection () const

MCSection *

getCallGraphSection (const MCSection &TextSec) const

MCSection *

getStackSizesSection (const MCSection &TextSec) const

MCSection *

getBBAddrMapSection (const MCSection &TextSec) const

MCSection *

getKCFITrapSection (const MCSection &TextSec) const

MCSection *

getPseudoProbeSection (const MCSection &TextSec) const

MCSection *

getPseudoProbeDescSection (StringRef FuncName) const

MCSection *

getLLVMStatsSection () const

MCSection *

getPCSection (StringRef Name, const MCSection *TextSec) const

MCSection *

getDataRelROSection () const

const MCSection *

getMergeableConst4Section () const

const MCSection *

getMergeableConst8Section () const

const MCSection *

getMergeableConst16Section () const

const MCSection *

getMergeableConst32Section () const

const MCSection *

getTLSTLVSection () const

const MCSection *

getTLSThreadInitSection () const

const MCSection *

getCStringSection () const

const MCSection *

getUStringSection () const

MCSection *

getTextCoalSection () const

const MCSection *

getConstTextCoalSection () const

const MCSection *

getConstDataSection () const

const MCSection *

getDataCoalSection () const

const MCSection *

getConstDataCoalSection () const

const MCSection *

getDataCommonSection () const

MCSection *

getDataBSSSection () const

const MCSection *

getFourByteConstantSection () const

const MCSection *

getEightByteConstantSection () const

const MCSection *

getSixteenByteConstantSection () const

MCSection *

getLazySymbolPointerSection () const

MCSection *

getNonLazySymbolPointerSection () const

MCSection *

getThreadLocalPointerSection () const

MCSection *

getAddrSigSection () const

MCSection *

getDrectveSection () const

MCSection *

getPDataSection () const

MCSection *

getXDataSection () const

MCSection *

getSXDataSection () const

MCSection *

getGEHContSection () const

MCSection *

getGFIDsSection () const

MCSection *

getGIATsSection () const

MCSection *

getGLJMPSection () const

MCSection *

getPPA2ListSection () const

MCSection *

getADASection () const

MCSection *

getIDRLSection () const

MCSection *

getTOCBaseSection () const

MCSection *

getEHFrameSection () const

MCSection *

getSFrameSection () const

bool

isPositionIndependent () const

MCSection *

getSwift5ReflectionSection (llvm::binaryformat::Swift5ReflectionSectionKind ReflSectionKind)

This method must be called before any actual lowering is done.

Initialize - this method must be called before any actual lowering is done.

This specifies the current context for codegen, and gives the lowering implementations a chance to set up their default sections.

Reimplemented from llvm::TargetLoweringObjectFile.

Reimplemented in llvm::XCoreTargetObjectFile.

Definition at line 121 of file TargetLoweringObjectFileImpl.cpp.

References llvm::Triple::aarch64, llvm::Triple::aarch64_32, llvm::Triple::aarch64_be, llvm::ARM, llvm::Triple::arm, llvm::Triple::armeb, llvm::TargetLoweringObjectFile::CallSiteEncoding, llvm::dwarf::DW_EH_PE_absptr, llvm::dwarf::DW_EH_PE_indirect, llvm::dwarf::DW_EH_PE_pcrel, llvm::dwarf::DW_EH_PE_sdata4, llvm::dwarf::DW_EH_PE_sdata8, llvm::dwarf::DW_EH_PE_udata4, llvm::dwarf::DW_EH_PE_udata8, llvm::Triple::getArch(), llvm::TargetMachine::getCodeModel(), llvm::TargetMachine::getTargetTriple(), llvm::Triple::GNUILP32, llvm::Triple::hexagon, llvm::TargetLoweringObjectFile::Initialize(), InitializeELF(), llvm::Triple::isOSFreeBSD(), llvm::MCObjectFileInfo::isPositionIndependent(), llvm::Triple::lanai, llvm::Triple::loongarch32, llvm::Triple::loongarch64, llvm::TargetLoweringObjectFile::LSDAEncoding, llvm::CodeModel::Medium, llvm::Triple::mips, llvm::Triple::mips64, llvm::Triple::mips64el, llvm::Triple::mipsel, llvm::TargetMachine::Options, llvm::TargetLoweringObjectFile::PersonalityEncoding, llvm::Triple::ppc, llvm::Triple::ppc64, llvm::Triple::ppc64le, llvm::Triple::ppcle, llvm::Triple::riscv32, llvm::Triple::riscv32be, llvm::Triple::riscv64, llvm::Triple::riscv64be, llvm::CodeModel::Small, llvm::Triple::sparc, llvm::Triple::sparcel, llvm::Triple::sparcv9, llvm::Triple::systemz, llvm::Triple::thumb, llvm::Triple::thumbeb, llvm::TargetLoweringObjectFile::TTypeEncoding, llvm::TargetOptions::UseInitArray, llvm::Triple::x86, and llvm::Triple::x86_64.

Referenced by llvm::ARMElfTargetObjectFile::Initialize(), llvm::AVRTargetObjectFile::Initialize(), llvm::CSKYELFTargetObjectFile::Initialize(), llvm::HexagonTargetObjectFile::Initialize(), llvm::LanaiTargetObjectFile::Initialize(), llvm::M68kELFTargetObjectFile::Initialize(), llvm::MipsTargetObjectFile::Initialize(), llvm::RISCVELFTargetObjectFile::Initialize(), llvm::SparcELFTargetObjectFile::Initialize(), and llvm::XCoreTargetObjectFile::Initialize().