18 #ifndef LLVM_IR_GLOBALVALUE_H
19 #define LLVM_IR_GLOBALVALUE_H
113 void destroyConstantImpl();
119 bool mayBeDerefined()
const {
227 "local linkage requires default visibility");
382 return !mayBeDerefined();
445 if (!Name.
empty() && Name[0] ==
'\1')
542 return V->
getValueID() == Value::FunctionVal ||
543 V->
getValueID() == Value::GlobalVariableVal ||
551 #endif // LLVM_IR_GLOBALVALUE_H
void setVisibility(VisibilityTypes V)
static bool isInterposableLinkage(LinkageTypes Linkage)
Whether the definition of this global may be replaced by something non-equivalent at link time...
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...
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
A Module instance is used to store all the information related to an LLVM module. ...
GUID getGUID() const
Return a 64-bit global unique ID constructed from global value name (i.e.
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.
UnnamedAddr getUnnamedAddr() const
Type * getValueType() const
bool hasAppendingLinkage() const
uint64_t MD5Hash(StringRef Str)
Helper to compute and return lower 64 bits of the given string's MD5 hash.
Like Internal, but omit from symbol table.
bool hasExactDefinition() const
Return true if this global has an exact defintion.
Externally visible function.
static bool isWeakAnyLinkage(LinkageTypes Linkage)
bool hasAvailableExternallyLinkage() const
static bool isCommonLinkage(LinkageTypes Linkage)
bool canIncreaseAlignment() const
static bool isLocalLinkage(LinkageTypes Linkage)
static bool isLinkOnceLinkage(LinkageTypes Linkage)
void setParent(Module *parent)
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
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)
bool hasValidDeclarationLinkage() const
static bool isPrivateLinkage(LinkageTypes Linkage)
VisibilityTypes
An enumeration for the kinds of visibility of global values.
Function Alias Analysis false
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)
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
bool isDiscardableIfUnused() const
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)
bool hasAtLeastLocalUnnamedAddr() const
Returns true if this value's address is not significant in this module.
The instances of the Type class are immutable: once they are created, they are never changed...
static bool isWeakODRLinkage(LinkageTypes Linkage)
static bool classof(const Value *V)
This is an important base class in LLVM.
bool hasHiddenVisibility() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
unsigned getValueID() const
Return an ID for the concrete type of this object.
bool isDefinitionExact() const
Return true if the currently visible definition of this global (if any) is exactly the definition we ...
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.
GlobalValue(Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace)
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.
static GUID getGUID(StringRef GlobalName)
Return a 64-bit global unique ID constructed from global value name (i.e.
Error materialize()
Make sure this GlobalValue is fully read.
bool hasWeakLinkage() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static LinkageTypes getWeakLinkage(bool ODR)
bool hasExternalWeakLinkage() const
bool hasExternalLinkage() const
bool hasDLLImportStorageClass() const
bool hasGlobalUnnamedAddr() const
virtual void removeFromParent()=0
This method unlinks 'this' from the containing module, but does not delete it.
static bool isWeakLinkage(LinkageTypes Linkage)
Optional< ConstantRange > getAbsoluteSymbolRange() const
If this is an absolute symbol reference, returns the range of the symbol, otherwise returns None...
Keep one copy of function when linking (inline)
Type * getType() const
All values are typed, get the type of this value.
std::string getGlobalIdentifier() const
Return the modified name for this global value suitable to be used as the key for a global lookup (e...
static bool isAvailableExternallyLinkage(LinkageTypes Linkage)
ValueTy
Concrete subclass of this.
void setLinkage(LinkageTypes LT)
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
static bool isExternalWeakLinkage(LinkageTypes Linkage)
LinkageTypes
An enumeration for the kinds of linkage for global values.
void setGlobalValueSubClassData(unsigned V)
unsigned HasLLVMReservedName
True if the function's name starts with "llvm.".
const GlobalObject * getBaseObject() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
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.
void setUnnamedAddr(UnnamedAddr Val)
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).
bool isInterposable() const
Return true if this global's definition can be substituted with an arbitrary definition at link time...
Function to be imported from DLL.
bool hasLocalLinkage() const
unsigned getAlignment() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void removeDeadConstantUsers() const
If there are any dead constant users dangling off of this constant, remove them.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
static LinkageTypes getLinkOnceLinkage(bool ODR)
void setThreadLocal(bool Val)
Lightweight error class with error context and mandatory checking.
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.
static UnnamedAddr getMinUnnamedAddr(UnnamedAddr A, UnnamedAddr B)
static bool isValidDeclarationLinkage(LinkageTypes Linkage)
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
bool isDeclarationForLinker() const
bool isAbsoluteSymbolRef() const
Returns whether this is a reference to an absolute symbol.
StringRef getSection() const