15 #ifndef LLVM_IR_GLOBALOBJECT_H
16 #define LLVM_IR_GLOBALOBJECT_H
53 static const unsigned AlignmentMask = (1 << AlignmentBits) - 1;
61 unsigned AlignmentData = Data & AlignmentMask;
62 return (1u << AlignmentData) >> 1;
159 return V->
getValueID() == Value::FunctionVal ||
166 void setGlobalObjectFlag(
unsigned Bit,
bool Val) {
172 bool hasMetadataHashEntry()
const {
175 void setHasMetadataHashEntry(
bool HasEntry) {
179 StringRef getSectionImpl()
const;
184 #endif // LLVM_IR_GLOBALOBJECT_H
void getAllMetadata(SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const
Appends all attachments for the global to MDs, sorting by attachment ID.
void setAlignment(unsigned Align)
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...
static const unsigned GlobalObjectSubClassDataBits
unsigned getAlignment() const
void setComdat(Comdat *C)
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.
GlobalObject(Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace=0)
bool hasMetadata() const
Check if this has any metadata.
void addTypeMetadata(unsigned Offset, Metadata *TypeID)
The instances of the Type class are immutable: once they are created, they are never changed...
const Comdat * getComdat() const
unsigned getValueID() const
Return an ID for the concrete type of this object.
void addMetadata(unsigned KindID, MDNode &MD)
Add a metadata attachment.
void setGlobalObjectSubClassData(unsigned Val)
ValueTy
Concrete subclass of this.
unsigned getGlobalObjectSubClassData() const
LinkageTypes
An enumeration for the kinds of linkage for global values.
void setGlobalValueSubClassData(unsigned V)
static bool classof(const Value *V)
MDNode * getMetadata(unsigned KindID) const
Get the current metadata attachments for the given kind, if any.
void setMetadata(unsigned KindID, MDNode *MD)
Set a particular kind of metadata attachment.
static const unsigned GlobalValueSubClassDataBits
unsigned getGlobalValueSubClassData() const
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void eraseMetadata(unsigned KindID)
Erase all metadata attachments with the given kind.
LLVM Value Representation.
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.
void copyAttributesFrom(const GlobalObject *Src)
void setSection(StringRef S)
Change the section for this global.