LLVM: lib/CodeGen/TargetLoweringObjectFileImpl.cpp File Reference (original) (raw)

Go to the source code of this file.

Functions
static void GetObjCImageInfo (Module &M, unsigned &Version, unsigned &Flags, StringRef &Section)
static SectionKind getELFKindForNamedSection (StringRef Name, SectionKind K)
static bool hasPrefix (StringRef SectionName, StringRef Prefix)
static unsigned getELFSectionType (StringRef Name, SectionKind K)
static unsigned getELFSectionFlags (SectionKind K)
static const Comdat * getELFComdat (const GlobalValue *GV)
static const MCSymbolELF * getLinkedToSymbol (const GlobalObject *GO, const TargetMachine &TM)
static unsigned getEntrySizeForKind (SectionKind Kind)
static StringRef getSectionPrefixForGlobal (SectionKind Kind, bool IsLarge)
Return the section prefix name used by options FunctionsSections and DataSections.
static SmallString< 128 > getELFSectionNameForGlobal (const GlobalObject *GO, SectionKind Kind, Mangler &Mang, const TargetMachine &TM, unsigned EntrySize, bool UniqueSectionName)
static unsigned calcUniqueIDUpdateFlagsAndSize (const GlobalObject *GO, StringRef SectionName, SectionKind Kind, const TargetMachine &TM, MCContext &Ctx, Mangler &Mang, unsigned &Flags, unsigned &EntrySize, unsigned &NextUniqueID, const bool Retain, const bool ForceUnique)
Calculate an appropriate unique ID for a section, and update Flags, EntrySize and NextUniqueID where appropriate.
static std::tuple< StringRef, bool, unsigned > getGlobalObjectInfo (const GlobalObject *GO, const TargetMachine &TM)
static StringRef handlePragmaClangSection (const GlobalObject *GO, SectionKind Kind)
static MCSection * selectExplicitSectionGlobal (const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM, MCContext &Ctx, Mangler &Mang, unsigned &NextUniqueID, bool Retain, bool ForceUnique)
static MCSectionELF * selectELFSectionForGlobal (MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, const TargetMachine &TM, bool EmitUniqueSection, unsigned Flags, unsigned *NextUniqueID, const MCSymbolELF *AssociatedSymbol)
static MCSection * selectELFSectionForGlobal (MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, const TargetMachine &TM, bool Retain, bool EmitUniqueSection, unsigned Flags, unsigned *NextUniqueID)
static MCSectionELF * getStaticStructorSection (MCContext &Ctx, bool UseInitArray, bool IsCtor, unsigned Priority, const MCSymbol *KeySym)
static void checkMachOComdat (const GlobalValue *GV)
static bool canUsePrivateLabel (const MCAsmInfo &AsmInfo, const MCSection &Section)
static unsigned getCOFFSectionFlags (SectionKind K, const TargetMachine &TM)
static const GlobalValue * getComdatGVForCOFF (const GlobalValue *GV)
static int getSelectionForCOFF (const GlobalValue *GV)
static StringRef getCOFFSectionNameForUniqueGlobal (SectionKind Kind)
static MCSectionCOFF * getCOFFStaticStructorSection (MCContext &Ctx, const Triple &T, bool IsCtor, unsigned Priority, const MCSymbol *KeySym, MCSectionCOFF *Default)
static std::string APIntToHexString (const APInt &AI)
static std::string scalarConstantToHexString (const Constant *C)
static const Comdat * getWasmComdat (const GlobalValue *GV)
static unsigned getWasmSectionFlags (SectionKind K, bool Retain)
static MCSectionWasm * selectWasmSectionForGlobal (MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, const TargetMachine &TM, bool EmitUniqueSection, unsigned *NextUniqueID, bool Retain)

APIntToHexString()

static std::string APIntToHexString ( const APInt & AI) static

calcUniqueIDUpdateFlagsAndSize()

static unsigned calcUniqueIDUpdateFlagsAndSize ( const GlobalObject * GO, StringRef SectionName, SectionKind Kind, const TargetMachine & TM, MCContext & Ctx, Mangler & Mang, unsigned & Flags, unsigned & EntrySize, unsigned & NextUniqueID, const bool Retain, const bool ForceUnique ) static

Calculate an appropriate unique ID for a section, and update Flags, EntrySize and NextUniqueID where appropriate.

Definition at line 703 of file TargetLoweringObjectFileImpl.cpp.

References llvm::MCAsmInfo::binutilsIsAtLeast(), llvm::MCContext::GenericSectionID, llvm::MCContext::getAsmInfo(), getELFSectionNameForGlobal(), llvm::MCContext::getELFUniqueIDForEntsize(), llvm::GlobalObject::getMetadata(), llvm::MCContext::isELFGenericMergeableSection(), llvm::MCContext::isELFImplicitMergeableSectionNamePrefix(), llvm::ELF::SHF_GNU_RETAIN, llvm::ELF::SHF_LINK_ORDER, llvm::ELF::SHF_MERGE, llvm::ELF::SHF_SUNW_NODISCARD, and llvm::MCAsmInfo::useIntegratedAssembler().

Referenced by selectExplicitSectionGlobal().

canUsePrivateLabel()

checkMachOComdat()

getCOFFSectionFlags()

Definition at line 1597 of file TargetLoweringObjectFileImpl.cpp.

References llvm::COFF::IMAGE_SCN_CNT_CODE, llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA, llvm::COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA, llvm::COFF::IMAGE_SCN_LNK_REMOVE, llvm::COFF::IMAGE_SCN_MEM_16BIT, llvm::COFF::IMAGE_SCN_MEM_DISCARDABLE, llvm::COFF::IMAGE_SCN_MEM_EXECUTE, llvm::COFF::IMAGE_SCN_MEM_READ, llvm::COFF::IMAGE_SCN_MEM_WRITE, isThumb(), and llvm::Triple::thumb.

Referenced by llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileCOFF::getSectionForJumpTable(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().

getCOFFSectionNameForUniqueGlobal()

getCOFFStaticStructorSection()

getComdatGVForCOFF()

getELFComdat()

getELFKindForNamedSection()

getELFSectionFlags()

getELFSectionNameForGlobal()

getELFSectionType()

Definition at line 522 of file TargetLoweringObjectFileImpl.cpp.

References hasPrefix(), Name, llvm::ELF::SHT_FINI_ARRAY, llvm::ELF::SHT_INIT_ARRAY, llvm::ELF::SHT_LLVM_LTO, llvm::ELF::SHT_LLVM_OFFLOADING, llvm::ELF::SHT_NOBITS, llvm::ELF::SHT_NOTE, llvm::ELF::SHT_PREINIT_ARRAY, and llvm::ELF::SHT_PROGBITS.

Referenced by selectELFSectionForGlobal(), and selectExplicitSectionGlobal().

getEntrySizeForKind()

getGlobalObjectInfo()

getLinkedToSymbol()

GetObjCImageInfo()

getSectionPrefixForGlobal()

getSelectionForCOFF()

Definition at line 1653 of file TargetLoweringObjectFileImpl.cpp.

References llvm::Comdat::Any, llvm::CallingConv::C, llvm::Comdat::ExactMatch, llvm::GlobalValue::getAliaseeObject(), llvm::GlobalValue::getComdat(), getComdatGVForCOFF(), llvm::COFF::IMAGE_COMDAT_SELECT_ANY, llvm::COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE, llvm::COFF::IMAGE_COMDAT_SELECT_EXACT_MATCH, llvm::COFF::IMAGE_COMDAT_SELECT_LARGEST, llvm::COFF::IMAGE_COMDAT_SELECT_NODUPLICATES, llvm::COFF::IMAGE_COMDAT_SELECT_SAME_SIZE, llvm::Comdat::Largest, llvm::Comdat::NoDeduplicate, and llvm::Comdat::SameSize.

Referenced by llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().

getStaticStructorSection()

Definition at line 1097 of file TargetLoweringObjectFileImpl.cpp.

References llvm::format(), llvm::MCContext::getELFSection(), llvm::MCSymbol::getName(), Name, llvm::ELF::SHF_ALLOC, llvm::ELF::SHF_GROUP, llvm::ELF::SHF_WRITE, llvm::ELF::SHT_FINI_ARRAY, llvm::ELF::SHT_INIT_ARRAY, and llvm::ELF::SHT_PROGBITS.

Referenced by llvm::TargetLoweringObjectFileELF::getStaticCtorSection(), and llvm::TargetLoweringObjectFileELF::getStaticDtorSection().

getWasmComdat()

getWasmSectionFlags()

handlePragmaClangSection()

hasPrefix()

scalarConstantToHexString()

static std::string scalarConstantToHexString ( const Constant * C) static

selectELFSectionForGlobal() [1/2]

selectELFSectionForGlobal() [2/2]

selectExplicitSectionGlobal()

Definition at line 818 of file TargetLoweringObjectFileImpl.cpp.

References assert(), llvm::MCAsmInfo::binutilsIsAtLeast(), calcUniqueIDUpdateFlagsAndSize(), llvm::LLVMContext::diagnose(), llvm::MCContext::getAsmInfo(), llvm::Value::getContext(), getELFKindForNamedSection(), llvm::MCContext::getELFSection(), getELFSectionFlags(), getELFSectionType(), getEntrySizeForKind(), getGlobalObjectInfo(), getLinkedToSymbol(), llvm::Value::getName(), llvm::GlobalValue::getParent(), llvm::Module::getSourceFileName(), handlePragmaClangSection(), llvm::ELF::SHF_MERGE, and llvm::MCAsmInfo::useIntegratedAssembler().

Referenced by llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), and llvm::TargetLoweringObjectFileELF::getUniqueSectionForFunction().

selectWasmSectionForGlobal()

JumpTableInFunctionSection