Go to the documentation of this file.
14 #ifndef LLVM_IR_GLOBALOBJECT_H
15 #define LLVM_IR_GLOBALOBJECT_H
63 static const unsigned AlignmentMask = (1 << AlignmentBits) - 1;
81 unsigned AlignmentData =
Data & AlignmentMask;
154 return V->
getValueID() == Value::FunctionVal ||
155 V->
getValueID() == Value::GlobalVariableVal ||
160 void setGlobalObjectFlag(
unsigned Bit,
bool Val) {
166 StringRef getSectionImpl()
const;
171 #endif // LLVM_IR_GLOBALOBJECT_H
void setComdat(Comdat *C)
This is an optimization pass for GlobalISel generic memory operations.
void setGlobalObjectSubClassData(unsigned Val)
@ VCallVisibilityTranslationUnit
static bool classof(const Value *V)
StringRef getSection() const
Get the custom section of this global if it has one.
MaybeAlign getAlign() const
Returns the alignment of the given variable or function.
The instances of the Type class are immutable: once they are created, they are never changed.
GlobalObject(Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace=0)
LinkageTypes
An enumeration for the kinds of linkage for global values.
static const unsigned GlobalValueSubClassDataBits
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
static const unsigned GlobalObjectSubClassDataBits
void setSection(StringRef S)
Change the section for this global.
(vector float) vec_cmpeq(*A, *B) C
void setVCallVisibilityMetadata(VCallVisibility Visibility)
const Comdat * getComdat() const
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
unsigned getValueID() const
Return an ID for the concrete type of this object.
unsigned getGlobalObjectSubClassData() const
This struct is a compact representation of a valid (non-zero power of two) alignment.
bool hasSection() const
Check if this global has a custom object file section.
void addMetadata(unsigned KindID, MDNode &MD)
Add a metadata attachment.
bool canIncreaseAlignment() const
Returns true if the alignment of the value can be unilaterally increased.
void copyMetadata(const GlobalObject *Src, unsigned Offset)
Copy metadata from Src, adjusting offsets by Offset.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void clearMetadata()
Erase all metadata attached to this Value.
ValueTy
Concrete subclass of this.
unsigned getGlobalValueSubClassData() const
StringRef - Represent a constant reference to a string, i.e.
MDNode * getMetadata(unsigned KindID) const
Get the current metadata attachments for the given kind, if any.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
void setMetadata(unsigned KindID, MDNode *Node)
Set a particular kind of metadata attachment.
uint64_t getAlignment() const
FIXME: Remove this function once transition to Align is over.
bool eraseMetadata(unsigned KindID)
Erase all metadata attachments with the given kind.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
void addTypeMetadata(unsigned Offset, Metadata *TypeID)
uint64_t value() const
This is a hole in the type system and should not be abused.
void setGlobalValueSubClassData(unsigned V)
MaybeAlign decodeMaybeAlign(unsigned Value)
Dual operation of the encode function above.
VCallVisibility getVCallVisibility() const
void copyAttributesFrom(const GlobalObject *Src)
void getAllMetadata(SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const
Appends all metadata attached to this value to MDs, sorting by KindID.
void setAlignment(MaybeAlign Align)
bool hasMetadata() const
Return true if this value has any metadata attached to it.
LLVM Value Representation.
@ VCallVisibilityLinkageUnit
A Use represents the edge between a Value definition and its users.