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;
161 return V->getValueID() == Value::FunctionVal ||
162 V->getValueID() == Value::GlobalVariableVal ||
163 V->getValueID() == Value::GlobalIFuncVal;
167 void setGlobalObjectFlag(
unsigned Bit,
bool Val) {
168 unsigned Mask = 1 << Bit;
173 StringRef getSectionImpl()
const;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef getSection() const
Get the custom section of this global if it has one.
void addTypeMetadata(unsigned Offset, Metadata *TypeID)
MaybeAlign getAlign() const
Returns the alignment of the given variable or function.
static bool classof(const Value *V)
static const unsigned GlobalObjectSubClassDataBits
GlobalObject(const GlobalObject &)=delete
void setAlignment(Align Align)
Sets the alignment attribute of the GlobalObject.
GlobalObject(Type *Ty, ValueTy VTy, AllocInfo AllocInfo, LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace=0)
void copyMetadata(const GlobalObject *Src, unsigned Offset)
Copy metadata from Src, adjusting offsets by Offset.
void setComdat(Comdat *C)
VCallVisibility getVCallVisibility() const
void copyAttributesFrom(const GlobalObject *Src)
uint64_t getAlignment() const
FIXME: Remove this function once transition to Align is over.
void setSection(StringRef S)
Change the section for this global.
const Comdat * getComdat() const
@ VCallVisibilityLinkageUnit
@ VCallVisibilityTranslationUnit
void setGlobalObjectSubClassData(unsigned Val)
unsigned getGlobalObjectSubClassData() const
bool hasSection() const
Check if this global has a custom object file section.
bool canIncreaseAlignment() const
Returns true if the alignment of the value can be unilaterally increased.
void setVCallVisibilityMetadata(VCallVisibility Visibility)
static const unsigned GlobalValueSubClassDataBits
unsigned getGlobalValueSubClassData() const
void setGlobalValueSubClassData(unsigned V)
LinkageTypes
An enumeration for the kinds of linkage for global values.
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
bool hasMetadata() const
Return true if this value has any metadata attached to it.
void setMetadata(unsigned KindID, MDNode *Node)
Set a particular kind of metadata attachment.
void getAllMetadata(SmallVectorImpl< std::pair< unsigned, MDNode * > > &MDs) const
Appends all metadata attached to this value to MDs, sorting by KindID.
bool eraseMetadata(unsigned KindID)
Erase all metadata attachments with the given kind.
void addMetadata(unsigned KindID, MDNode &MD)
Add a metadata attachment.
void eraseMetadataIf(function_ref< bool(unsigned, MDNode *)> Pred)
Erase all metadata attachments matching the given predicate.
void clearMetadata()
Erase all metadata attached to this Value.
MDNode * getMetadata(unsigned KindID) const
Get the current metadata attachments for the given kind, if any.
ValueTy
Concrete subclass of this.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
MaybeAlign decodeMaybeAlign(unsigned Value)
Dual operation of the encode function above.
This struct is a compact representation of a valid (non-zero power of two) alignment.
uint64_t value() const
This is a hole in the type system and should not be abused.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Information about how a User object was allocated, to be passed into the User constructor.