25 cl::desc(
"Small data and bss section threshold size (default=8)"),
30 cl::desc(
"MIPS: Use gp_rel for object-local data."),
35 cl::desc(
"MIPS: Use gp_rel for data that is not defined by the "
64 bool MipsTargetObjectFile::IsGlobalInSmallSection(
70 return IsGlobalInSmallSectionImpl(GO, TM);
77 bool MipsTargetObjectFile::
80 return (IsGlobalInSmallSectionImpl(GO, TM) &&
87 bool MipsTargetObjectFile::
122 if (Kind.
isBSS() && IsGlobalInSmallSection(GO, TM, Kind))
123 return SmallBSSSection;
124 if (Kind.
isData() && IsGlobalInSmallSection(GO, TM, Kind))
125 return SmallDataSection;
134 return (static_cast<const MipsTargetMachine &>(TM)
136 ->useSmallSection() &&
144 unsigned &Align)
const {
146 return SmallDataSection;
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. ...
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, unsigned &Align) const override
Return true if this constant should be placed into small data section.
const MCExpr * getDebugThreadLocalSymbol(const MCSymbol *Sym) const override
Describe a TLS variable address within debug info.
Type * getValueType() const
static bool IsInSmallSection(uint64_t Size)
bool hasAvailableExternallyLinkage() const
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.
static cl::opt< bool > ExternSData("mextern-sdata", cl::Hidden, cl::desc("MIPS: Use gp_rel for data that is not defined by the ""current object."), cl::init(true))
bool hasCommonLinkage() const
virtual void Initialize(MCContext &ctx, const TargetMachine &TM)
This method must be called before any actual lowering is done.
Base class for the full range of assembler expressions which are needed for parsing.
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Context object for machine code objects.
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
MCContext & getContext() const
static cl::opt< bool > LocalSData("mlocal-sdata", cl::Hidden, cl::desc("MIPS: Use gp_rel for object-local data."), cl::init(true))
initializer< Ty > init(const Ty &Val)
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
bool IsConstantInSmallSection(const DataLayout &DL, const Constant *CN, const TargetMachine &TM) const
Return true if this constant should be placed into small data section.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
void InitializeELF(bool UseInitArray_)
SectionKind - This is a simple POD value that classifies the properties of a section.
bool hasExternalLinkage() const
unsigned UseInitArray
UseInitArray - Use .init_array instead of .ctors for static constructors.
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Type * getType() const
All values are typed, get the type of this value.
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
static cl::opt< unsigned > SSThreshold("mips-ssection-threshold", cl::Hidden, cl::desc("Small data and bss section threshold size (default=8)"), cl::init(8))
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
bool hasLocalLinkage() const
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
Module * getParent()
Get the module that this global value is contained inside of...
bool useSmallSection() const
Primary interface to the complete machine description for the target machine.
static SectionKind getKindForGlobal(const GlobalObject *GO, const TargetMachine &TM)
Classify the specified global variable into a set of target independent categories embodied in Sectio...
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)