40 return Size > 0 &&
Size <= CLOpts.ssection_threshold;
45bool MipsTargetObjectFile::IsGlobalInSmallSection(
51 return IsGlobalInSmallSectionImpl(GO);
58bool MipsTargetObjectFile::IsGlobalInSmallSection(
const GlobalObject *GO,
60 return IsGlobalInSmallSectionImpl(GO) &&
61 (Kind.isData() || Kind.isBSS() || Kind.isCommon() ||
68bool MipsTargetObjectFile::IsGlobalInSmallSectionImpl(
70 const MipsOptions &CLOpts =
84 if (Section ==
".sdata" || Section ==
".sbss")
105 if (!CLOpts.mextern_sdata &&
111 if (CLOpts.membedded_data && GVA->
isConstant())
131 if (IsGlobalInSmallSection(GO, Kind)) {
133 return SmallBSSSection;
134 if (Kind.isData() || Kind.isReadOnly())
135 return SmallDataSection;
146 bool UseSmallSection =
148 : this->UseSmallSection;
149 const MipsOptions &CLOpts =
151 return UseSmallSection && CN && CLOpts.mlocal_sdata &&
160 return SmallDataSection;
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static bool isInSmallSection(uint64_t Size)
This is an important base class in LLVM.
A parsed version of the target data layout string in and methods for querying it.
LLVM_ABI TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
StringRef getSection() const
Get the custom section of this global if it has one.
bool hasSection() const
Check if this global has a custom object file section.
bool hasExternalLinkage() const
LLVM_ABI bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
bool hasLocalLinkage() const
LLVM_ABI const DataLayout & getDataLayout() const
Get the data layout of the module this global belongs to.
bool hasCommonLinkage() const
bool hasAvailableExternallyLinkage() const
Type * getValueType() const
bool isConstant() const
If the value is a global constant, its value is immutable throughout the runtime execution of the pro...
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
Base class for the full range of assembler expressions which are needed for parsing.
MCContext & getContext() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
static const MCSpecifierExpr * create(const MCExpr *Expr, Spec S, MCContext &Ctx, SMLoc Loc=SMLoc())
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool useSmallSection() const
bool IsConstantInSmallSection(const DataLayout &DL, const Constant *CN, const Function *F) 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 initialize(MCContext &Ctx, const TargetMachine &TM, const Module &M) override
This method must be called before any actual lowering is done.
const MCExpr * getDebugThreadLocalSymbol(const MCSymbol *Sym) const override
Describe a TLS variable address within debug info.
MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment, const Function *F) const override
Return true if this constant should be placed into small data section.
A Module instance is used to store all the information related to an LLVM module.
SectionKind - This is a simple POD value that classifies the properties of a section.
Represent a constant reference to a string, i.e.
MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment, const Function *F) const override
Given a constant with the SectionKind, return a section that it should be placed in.
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
void initialize(MCContext &Ctx, const TargetMachine &TM, const Module &M) override
This method must be called before any actual lowering is done.
static SectionKind getKindForGlobal(const GlobalObject *GO, const TargetMachine &TM)
Classify the specified global variable into a set of target independent categories embodied in Sectio...
Primary interface to the complete machine description for the target machine.
bool isSized() const
Return true if it makes sense to take the size of this type.
Type * getType() const
All values are typed, get the type of this value.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
This struct is a compact representation of a valid (non-zero power of two) alignment.