14 #ifndef LLVM_IR_GLOBALOBJECT_H 15 #define LLVM_IR_GLOBALOBJECT_H 67 static const unsigned AlignmentMask = (1 << AlignmentBits) - 1;
75 unsigned AlignmentData = Data & AlignmentMask;
77 return Align ? Align->value() : 0;
82 "Please use `void setAlignment(MaybeAlign Align)`");
93 (Val << GlobalObjectBits));
190 return V->
getValueID() == Value::FunctionVal ||
197 void setGlobalObjectFlag(
unsigned Bit,
bool Val) {
203 bool hasMetadataHashEntry()
const {
206 void setHasMetadataHashEntry(
bool HasEntry) {
215 #endif // LLVM_IR_GLOBALOBJECT_H
StringRef getSection() const
Get the custom section of this global if it has one.
unsigned getAlignment() const
unsigned getValueID() const
Return an ID for the concrete type of this object.
This class represents lattice values for constants.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
MaybeAlign decodeMaybeAlign(unsigned Value)
Dual operation of the encode function above.
void getAllMetadata(SmallVectorImpl< std::pair< unsigned, MDNode *>> &MDs) const
Appends all attachments for the global to MDs, sorting by attachment ID.
VCallVisibility getVCallVisibility() const
void copyMetadata(const GlobalObject *Src, unsigned Offset)
Copy metadata from Src, adjusting offsets by Offset.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
A Use represents the edge between a Value definition and its users.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
MDNode * getMetadata(unsigned KindID) const
Get the current metadata attachments for the given kind, if any.
static const unsigned GlobalObjectSubClassDataBits
void setComdat(Comdat *C)
void addVCallVisibilityMetadata(VCallVisibility Visibility)
GlobalObject(Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace=0)
void addTypeMetadata(unsigned Offset, Metadata *TypeID)
The instances of the Type class are immutable: once they are created, they are never changed...
unsigned getGlobalObjectSubClassData() const
unsigned getGlobalValueSubClassData() const
This struct is a compact representation of a valid (non-zero power of two) alignment.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment...
bool hasSection() const
Check if this global has a custom object file section.
void addMetadata(unsigned KindID, MDNode &MD)
Add a metadata attachment.
void setGlobalObjectSubClassData(unsigned Val)
LLVM_ATTRIBUTE_DEPRECATED(void setAlignment(unsigned Align), "Please use `void setAlignment(MaybeAlign Align)`")
FIXME: Remove this setter once the migration to MaybeAlign is over.
ValueTy
Concrete subclass of this.
LinkageTypes
An enumeration for the kinds of linkage for global values.
void setGlobalValueSubClassData(unsigned V)
static bool classof(const Value *V)
void setMetadata(unsigned KindID, MDNode *MD)
Set a particular kind of metadata attachment.
const Comdat * getComdat() const
static const unsigned GlobalValueSubClassDataBits
void setAlignment(MaybeAlign Align)
bool hasMetadata(StringRef Kind) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
bool hasMetadata() const
Check if this has any metadata.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
StringRef - Represent a constant reference to a string, i.e.
bool eraseMetadata(unsigned KindID)
Erase all metadata attachments with the given kind.
bool hasMetadata(unsigned KindID) const
Check if this has any metadata of the given kind.
void copyAttributesFrom(const GlobalObject *Src)
void setSection(StringRef S)
Change the section for this global.