Go to the documentation of this file.
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 "
41 cl::desc(
"MIPS: Try to allocate variables in the following"
42 " sections if possible: .rodata, .sdata, .data ."),
69 bool MipsTargetObjectFile::IsGlobalInSmallSection(
75 return IsGlobalInSmallSectionImpl(GO,
TM);
82 bool MipsTargetObjectFile::
85 return IsGlobalInSmallSectionImpl(GO, TM) &&
93 bool MipsTargetObjectFile::
115 if (Section ==
".sdata" || Section ==
".sbss")
155 if (
Kind.isBSS() && IsGlobalInSmallSection(GO,
TM,
Kind))
156 return SmallBSSSection;
157 if (
Kind.isData() && IsGlobalInSmallSection(GO,
TM,
Kind))
158 return SmallDataSection;
159 if (
Kind.isReadOnly() && IsGlobalInSmallSection(GO,
TM,
Kind))
160 return SmallDataSection;
171 ->useSmallSection() &&
179 Align &Alignment)
const {
181 return SmallDataSection;
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
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))
This is an optimization pass for GlobalISel generic memory operations.
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool hasCommonLinkage() const
A parsed version of the target data layout string in and methods for querying it.
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
bool hasExternalLinkage() const
Context object for machine code objects.
StringRef getSection() const
Get the custom section of this global if it has one.
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
The instances of the Type class are immutable: once they are created, they are never changed.
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
static bool IsInSmallSection(uint64_t Size)
static cl::opt< bool > LocalSData("mlocal-sdata", cl::Hidden, cl::desc("MIPS: Use gp_rel for object-local data."), cl::init(true))
MCContext & getContext() const
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
(vector float) vec_cmpeq(*A, *B) C
static cl::opt< unsigned > SSThreshold("mips-ssection-threshold", cl::Hidden, cl::desc("Small data and bss section threshold size (default=8)"), cl::init(8))
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
This struct is a compact representation of a valid (non-zero power of two) alignment.
static SectionKind getKindForGlobal(const GlobalObject *GO, const TargetMachine &TM)
Classify the specified global variable into a set of target independent categories embodied in Sectio...
MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment) const override
Return true if this constant should be placed into small data section.
bool hasSection() const
Check if this global has a custom object file section.
bool hasAvailableExternallyLinkage() const
This is an important base class in LLVM.
Module * getParent()
Get the module that this global value is contained inside of...
const MCExpr * getDebugThreadLocalSymbol(const MCSymbol *Sym) const override
Describe a TLS variable address within debug info.
initializer< Ty > init(const Ty &Val)
Primary interface to the complete machine description for the target machine.
bool hasLocalLinkage() const
MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment) const override
Given a constant with the SectionKind, return a section that it should be placed in.
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
StringRef - Represent a constant reference to a string, i.e.
Type * getType() const
All values are typed, get the type of this value.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Instances of this class represent a uniqued identifier for a section in the current translation unit.
static const MipsMCExpr * create(MipsExprKind Kind, const MCExpr *Expr, MCContext &Ctx)
SectionKind - This is a simple POD value that classifies the properties of a section.
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
bool useSmallSection() const
static cl::opt< bool > EmbeddedData("membedded-data", cl::Hidden, cl::desc("MIPS: Try to allocate variables in the following" " sections if possible: .rodata, .sdata, .data ."), cl::init(false))
bool isConstant() const
If the value is a global constant, its value is immutable throughout the runtime execution of the pro...
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
Type * getValueType() const
const char LLVMTargetMachineRef TM
bool IsConstantInSmallSection(const DataLayout &DL, const Constant *CN, const TargetMachine &TM) const
Return true if this constant should be placed into small data section.
Base class for the full range of assembler expressions which are needed for parsing.
TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...