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;
148 return V->
getValueID() == Value::FunctionVal ||
155 void setGlobalObjectFlag(
unsigned Bit,
bool Val) {
161 bool hasMetadataHashEntry()
const {
164 void setHasMetadataHashEntry(
bool HasEntry) {
168 StringRef getSectionImpl()
const;
173 #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)
unsigned getGlobalObjectSubClassData() 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...
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 copyAttributesFrom(const GlobalValue *Src) override
Copy all additional attributes (those not needed to create a GlobalValue) from the GlobalValue Src to...
ValueTy
Concrete subclass of this.
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
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
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 setSection(StringRef S)
Change the section for this global.
void setGlobalObjectSubClassData(unsigned Val)