34 return Size > 0 && Size <= SSThreshold;
52 if (Section ==
".sdata" || Section ==
".sbss")
79 return SmallBSSSection;
81 return SmallDataSection;
91 for (
const auto &MFE : ModuleFlags) {
93 if (Key ==
"SmallDataLimit") {
94 SSThreshold = mdconst::extract<ConstantInt>(MFE.Val)->getZExtValue();
108 unsigned &
Align)
const {
110 return SmallDataSection;
StringRef getSection() const
Get the custom section of this global if it has one.
Instances of this class represent a uniqued identifier for a section in the current translation unit...
A parsed version of the target data layout string in and methods for querying it. ...
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
bool isSized(SmallPtrSetImpl< Type *> *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, unsigned &Align) 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, unsigned &Align) const override
Given a constant with the SectionKind, return a section that it should be placed in.
bool isGlobalInSmallSection(const GlobalObject *GO, const TargetMachine &TM) const
Return true if this global address should be placed into small data/bss section.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
bool hasCommonLinkage() const
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Context object for machine code objects.
bool hasExternalLinkage() const
Type * getType() const
All values are typed, get the type of this value.
void getModuleMetadata(Module &M) override
Get the module-level metadata that the platform cares about.
bool isConstantInSmallSection(const DataLayout &DL, const Constant *CN) const
Return true if this constant should be placed into small data section.
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
void getModuleFlagsMetadata(SmallVectorImpl< ModuleFlagEntry > &Flags) const
Returns the module flags in the provided vector.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
void InitializeELF(bool UseInitArray_)
SectionKind - This is a simple POD value that classifies the properties of a section.
MCContext & getContext() const
This struct is a compact representation of a valid (non-zero power of two) alignment.
unsigned UseInitArray
UseInitArray - Use .init_array instead of .ctors for static constructors.
bool hasSection() const
Check if this global has a custom object file section.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
Type * getValueType() const
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
Module * getParent()
Get the module that this global value is contained inside of...
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
bool isInSmallSection(uint64_t Size) const
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.