18 #ifndef LLVM_IR_GLOBALVALUE_H
19 #define LLVM_IR_GLOBALVALUE_H
23 #include <system_error>
70 :
Constant(Ty, VTy, Ops, NumOps), Linkage(Linkage),
94 void destroyConstantImpl();
147 "local linkage requires default visibility");
307 if (!Name.
empty() && Name[0] ==
'\1')
370 return V->
getValueID() == Value::FunctionVal ||
371 V->
getValueID() == Value::GlobalVariableVal ||
void setVisibility(VisibilityTypes V)
LinkageTypes getLinkage() const
Special purpose, only applies to global arrays.
VisibilityTypes getVisibility() const
virtual void copyAttributesFrom(const GlobalValue *Src)
Copy all additional attributes (those not needed to create a GlobalValue) from the GlobalValue Src to...
A Module instance is used to store all the information related to an LLVM module. ...
Same, but only replaced by something equivalent.
ThreadLocal - A class used to abstract thread-local storage.
static bool isExternalLinkage(LinkageTypes Linkage)
Available for inspection, not emission.
Type * getValueType() const
bool hasAppendingLinkage() const
StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
Like Internal, but omit from symbol table.
Externally visible function.
static bool isWeakAnyLinkage(LinkageTypes Linkage)
bool hasAvailableExternallyLinkage() const
static bool isCommonLinkage(LinkageTypes Linkage)
const char * getSection() const
static bool isLocalLinkage(LinkageTypes Linkage)
static bool isLinkOnceLinkage(LinkageTypes Linkage)
bool hasCommonLinkage() const
bool hasDLLExportStorageClass() const
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
bool hasDefaultVisibility() const
A Use represents the edge between a Value definition and its users.
bool hasWeakODRLinkage() const
bool hasInternalLinkage() const
GlobalValue(PointerType *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name)
void setThreadLocalMode(ThreadLocalMode Val)
void setName(const Twine &Name)
Change the name of the value.
bool isStrongDefinitionForLinker() const
Returns true if this global's definition will be the one chosen by the linker.
void setDLLStorageClass(DLLStorageClassTypes C)
bool hasPrivateLinkage() const
static bool isLinkOnceODRLinkage(LinkageTypes Linkage)
static bool isPrivateLinkage(LinkageTypes Linkage)
VisibilityTypes
An enumeration for the kinds of visibility of global values.
bool isMaterializable() const
If this function's Module is being lazily streamed in functions from disk or some other source...
static bool isAppendingLinkage(LinkageTypes Linkage)
bool isDiscardableIfUnused() const
Type * getElementType() const
PointerType - Class to represent pointers.
bool isWeakForLinker() const
static bool isWeakForLinker(LinkageTypes Linkage)
Whether the definition of this global may be replaced at link time.
ExternalWeak linkage description.
Same, but only replaced by something equivalent.
static bool isInternalLinkage(LinkageTypes Linkage)
The instances of the Type class are immutable: once they are created, they are never changed...
static bool isWeakODRLinkage(LinkageTypes Linkage)
static bool mayBeOverridden(LinkageTypes Linkage)
Whether the definition of this global may be replaced by something non-equivalent at link time...
static bool classof(const Value *V)
This is an important base class in LLVM.
bool hasHiddenVisibility() const
bool isDematerializable() const
Returns true if this function was loaded from a GVMaterializer that's still attached to its Module an...
unsigned getValueID() const
Return an ID for the concrete type of this object.
static bool isDiscardableIfUnused(LinkageTypes Linkage)
Whether the definition of this global may be discarded if it is not used in its compilation unit...
DLLStorageClassTypes
Storage classes of global values for PE targets.
Intrinsic::ID IntID
The intrinsic ID for this subclass (which must be a Function).
const Module * getParent() const
bool hasWeakAnyLinkage() const
bool isThreadLocal() const
If the value is "Thread Local", its value isn't shared by the threads.
bool hasWeakLinkage() const
static LinkageTypes getWeakLinkage(bool ODR)
bool hasExternalWeakLinkage() const
bool hasExternalLinkage() const
bool hasDLLImportStorageClass() const
virtual void removeFromParent()=0
This method unlinks 'this' from the containing module, but does not delete it.
static bool isWeakLinkage(LinkageTypes Linkage)
Keep one copy of function when linking (inline)
Type * getType() const
All values are typed, get the type of this value.
void setUnnamedAddr(bool Val)
static bool isAvailableExternallyLinkage(LinkageTypes Linkage)
ValueTy
Concrete subclass of this.
void setLinkage(LinkageTypes LT)
static bool isExternalWeakLinkage(LinkageTypes Linkage)
LinkageTypes
An enumeration for the kinds of linkage for global values.
void setGlobalValueSubClassData(unsigned V)
const Comdat * getComdat() const
static const unsigned GlobalValueSubClassDataBits
ThreadLocalMode getThreadLocalMode() const
bool hasLinkOnceLinkage() const
unsigned getGlobalValueSubClassData() const
static StringRef getRealLinkageName(StringRef Name)
If special LLVM prefix that is used to inform the asm printer to not emit usual symbol prefix before ...
Function to be accessible from DLL.
PointerType * getType() const
Global values are always pointers.
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
bool hasLinkOnceODRLinkage() const
bool hasProtectedVisibility() const
Keep one copy of named function when linking (weak)
Rename collisions when linking (static functions).
Function to be imported from DLL.
bool hasLocalLinkage() const
unsigned getAlignment() const
void removeDeadConstantUsers() const
removeDeadConstantUsers - If there are any dead constant users dangling off of this constant...
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
bool hasUnnamedAddr() const
static LinkageTypes getLinkOnceLinkage(bool ODR)
void dematerialize()
If this GlobalValue is read in, and if the GVMaterializer supports it, release the memory for the fun...
void setThreadLocal(bool Val)
bool mayBeOverridden() const
virtual void eraseFromParent()=0
This method unlinks 'this' from the containing module and deletes it.
DLLStorageClassTypes getDLLStorageClass() const
StringRef - Represent a constant reference to a string, i.e.
std::error_code materialize()
Make sure this GlobalValue is fully read.
bool isDeclarationForLinker() const
bool empty() const
empty - Check if the string is empty.