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, const Triple &T)
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, const MachineJumpTableEntry *JTE)
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, const MachineJumpTableEntry *MJTE=nullptr)
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()

calcUniqueIDUpdateFlagsAndSize()

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 707 of file TargetLoweringObjectFileImpl.cpp.

References getELFSectionNameForGlobal(), llvm::GlobalObject::getMetadata(), llvm::TargetMachine::getSeparateNamedSections(), llvm::TargetMachine::getTargetTriple(), llvm::Triple::isOSSolaris(), llvm::MCSection::NonUniqueID, Retain, llvm::ELF::SHF_GNU_RETAIN, llvm::ELF::SHF_LINK_ORDER, llvm::ELF::SHF_MERGE, and llvm::ELF::SHF_SUNW_NODISCARD.

Referenced by selectExplicitSectionGlobal().

canUsePrivateLabel()

checkMachOComdat()

getCOFFSectionFlags()

Definition at line 1649 of file TargetLoweringObjectFileImpl.cpp.

References llvm::Triple::getArch(), llvm::TargetMachine::getTargetTriple(), 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()

Definition at line 530 of file TargetLoweringObjectFileImpl.cpp.

References llvm::ELF::SHF_AARCH64_PURECODE, llvm::ELF::SHF_ALLOC, llvm::ELF::SHF_ARM_PURECODE, llvm::ELF::SHF_EXCLUDE, llvm::ELF::SHF_EXECINSTR, llvm::ELF::SHF_MERGE, llvm::ELF::SHF_STRINGS, llvm::ELF::SHF_TLS, llvm::ELF::SHF_WRITE, and T.

Referenced by llvm::TargetLoweringObjectFileELF::getUniqueSectionForFunction(), selectExplicitSectionGlobal(), and llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal().

getELFSectionNameForGlobal()

Definition at line 635 of file TargetLoweringObjectFileImpl.cpp.

References assert(), llvm::cast(), llvm::Cold, llvm::dyn_cast(), F, llvm::GlobalValue::getDataLayout(), llvm::TargetMachine::getNameWithPrefix(), llvm::DataLayout::getPreferredAlign(), getSectionPrefixForGlobal(), llvm::Hot, llvm::MachineJumpTableEntry::Hotness, llvm::TargetMachine::isLargeGlobalValue(), llvm::Unknown, llvm::utostr(), and llvm::Align::value().

Referenced by calcUniqueIDUpdateFlagsAndSize(), and selectELFSectionForGlobal().

getELFSectionType()

getEntrySizeForKind()

getGlobalObjectInfo()

getLinkedToSymbol()

GetObjCImageInfo()

getSectionPrefixForGlobal()

getSelectionForCOFF()

Definition at line 1705 of file TargetLoweringObjectFileImpl.cpp.

References llvm::Comdat::Any, llvm::CallingConv::C, llvm::dyn_cast(), 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()

getWasmComdat()

getWasmSectionFlags()

handlePragmaClangSection()

hasPrefix()

scalarConstantToHexString()

selectELFSectionForGlobal() [1/2]

selectELFSectionForGlobal() [2/2]

selectExplicitSectionGlobal()

Definition at line 822 of file TargetLoweringObjectFileImpl.cpp.

References assert(), calcUniqueIDUpdateFlagsAndSize(), llvm::LLVMContext::diagnose(), llvm::Value::getContext(), getELFKindForNamedSection(), getELFSectionFlags(), getELFSectionType(), getEntrySizeForKind(), getGlobalObjectInfo(), getLinkedToSymbol(), llvm::Value::getName(), llvm::GlobalValue::getParent(), llvm::Module::getSourceFileName(), llvm::TargetMachine::getTargetTriple(), handlePragmaClangSection(), Retain, and llvm::ELF::SHF_MERGE.

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

selectWasmSectionForGlobal()

JumpTableInFunctionSection