class GlobalValue
Declaration
class GlobalValue : public Constant { /* full declaration omitted */ };
Description
This is an important base class in LLVM. It provides the common facilities of all constant values in an LLVM program. A constant is a value that is immutable at runtime. Functions are constants because their address is immutable. Same with global variables. All constants share the capabilities provided in this class. All constants can have a null value. They can have an operand list. Constants can be simple (integer and floating point values), complex (arrays and structures), or expression based (computations yielding a constant value composed of only certain operators and other constant values). Note that Constants are immutable (once created they never change) and are fully shared by structural equivalence. This means that two structurally equivalent constants will always have the same address. Constants are created on demand as needed and never deleted: thus clients don't have to worry about the lifetime of the objects. LLVM Constant Representation
Declared at: llvm/include/llvm/IR/GlobalValue.h:44
Inherits from: Constant
Member Variables
- protected llvm::Type* ValueType
- protected unsigned int Linkage
- protected unsigned int Visibility
- protected unsigned int UnnamedAddrVal
- protected unsigned int DllStorageClass
- protected unsigned int ThreadLocal
- protected unsigned int HasLLVMReservedName
- True if the function's name starts with "llvm.". This corresponds to the value of Function::isIntrinsic(), which may be true even if Function::intrinsicID() returns Intrinsic::not_intrinsic.
- protected unsigned int IsDSOLocal
- If true then there is a definition within the same linkage unit and that definition cannot be runtime preempted.
- protected unsigned int HasPartition
- True if this symbol has a partition name assigned (see https://lld.llvm.org/Partitions.html).
- protected Intrinsic::ID IntID
- This is stored here to save space in Function on 64-bit hosts.
- protected llvm::Module* Parent
- protected static const unsigned int GlobalValueSubClassDataBits = 16
Inherited from Value:
- protected SubclassOptionalData
- protected NumUserOperands
- protected IsUsedByMD
- protected HasName
- protected HasHungOffUses
- protected HasDescriptor
- public static MaxAlignmentExponent = 29
- public static MaximumAlignment = 1U << MaxAlignmentExponent
Method Overview
- protected GlobalValue(llvm::Type * Ty, llvm::Value::ValueTy VTy, llvm::Use * Ops, unsigned int NumOps, llvm::GlobalValue::LinkageTypes Linkage, const llvm::Twine & Name, unsigned int AddressSpace)
- public GlobalValue(const llvm::GlobalValue &)
- public bool canBeOmittedFromSymbolTable() const
- public bool canIncreaseAlignment() const
- public static bool classof(const llvm::Value * V)
- protected void copyAttributesFrom(const llvm::GlobalValue * Src)
- public static llvm::StringRef dropLLVMManglingEscape(llvm::StringRef Name)
- public void eraseFromParent()
- public Optional<llvm::ConstantRange> getAbsoluteSymbolRange() const
- public unsigned int getAddressSpace() const
- public unsigned int getAlignment() const
- public const llvm::GlobalObject * getBaseObject() const
- public llvm::GlobalObject * getBaseObject()
- public const llvm::Comdat * getComdat() const
- public llvm::Comdat * getComdat()
- public llvm::GlobalValue::DLLStorageClassTypes getDLLStorageClass() const
- public llvm::GlobalValue::GUID getGUID() const
- public static llvm::GlobalValue::GUID getGUID(llvm::StringRef GlobalName)
- public std::string getGlobalIdentifier() const
- public static std::string getGlobalIdentifier(llvm::StringRef Name, GlobalValue::LinkageTypes Linkage, llvm::StringRef FileName)
- protected unsigned int getGlobalValueSubClassData() const
- public static llvm::GlobalValue::LinkageTypes getLinkOnceLinkage(bool ODR)
- public llvm::GlobalValue::LinkageTypes getLinkage() const
- public static llvm::GlobalValue::UnnamedAddr getMinUnnamedAddr(llvm::GlobalValue::UnnamedAddr A, llvm::GlobalValue::UnnamedAddr B)
- public const llvm::Module * getParent() const
- public llvm::Module * getParent()
- public llvm::StringRef getPartition() const
- public llvm::StringRef getSection() const
- public llvm::GlobalValue::ThreadLocalMode getThreadLocalMode() const
- public llvm::PointerType * getType() const
- public llvm::GlobalValue::UnnamedAddr getUnnamedAddr() const
- public llvm::Type * getValueType() const
- public llvm::GlobalValue::VisibilityTypes getVisibility() const
- public static llvm::GlobalValue::LinkageTypes getWeakLinkage(bool ODR)
- public bool hasAppendingLinkage() const
- public bool hasAtLeastLocalUnnamedAddr() const
- public bool hasAvailableExternallyLinkage() const
- public bool hasComdat() const
- public bool hasCommonLinkage() const
- public bool hasDLLExportStorageClass() const
- public bool hasDLLImportStorageClass() const
- public bool hasDefaultVisibility() const
- public bool hasExactDefinition() const
- public bool hasExternalLinkage() const
- public bool hasExternalWeakLinkage() const
- public bool hasGlobalUnnamedAddr() const
- public bool hasHiddenVisibility() const
- public bool hasInternalLinkage() const
- public bool hasLinkOnceLinkage() const
- public bool hasLinkOnceODRLinkage() const
- public bool hasLocalLinkage() const
- public bool hasPartition() const
- public bool hasPrivateLinkage() const
- public bool hasProtectedVisibility() const
- public bool hasSection() const
- public bool hasValidDeclarationLinkage() const
- public bool hasWeakAnyLinkage() const
- public bool hasWeakLinkage() const
- public bool hasWeakODRLinkage() const
- public bool isAbsoluteSymbolRef() const
- public static bool isAppendingLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public static bool isAvailableExternallyLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public static bool isCommonLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public bool isDSOLocal() const
- public bool isDeclaration() const
- public bool isDeclarationForLinker() const
- public bool isDefinitionExact() const
- public static bool isDiscardableIfUnused(llvm::GlobalValue::LinkageTypes Linkage)
- public bool isDiscardableIfUnused() const
- public static bool isExternalLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public static bool isExternalWeakLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public static bool isInternalLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public bool isInterposable() const
- public static bool isInterposableLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public static bool isLinkOnceLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public static bool isLinkOnceODRLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public static bool isLocalLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public bool isMaterializable() const
- public static bool isPrivateLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public bool isStrongDefinitionForLinker() const
- public bool isThreadLocal() const
- public static bool isValidDeclarationLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public static bool isWeakAnyLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public bool isWeakForLinker() const
- public static bool isWeakForLinker(llvm::GlobalValue::LinkageTypes Linkage)
- public static bool isWeakLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public static bool isWeakODRLinkage(llvm::GlobalValue::LinkageTypes Linkage)
- public llvm::Error materialize()
- public void removeFromParent()
- public void setDLLStorageClass(llvm::GlobalValue::DLLStorageClassTypes C)
- public void setDSOLocal(bool Local)
- protected void setGlobalValueSubClassData(unsigned int V)
- public void setLinkage(llvm::GlobalValue::LinkageTypes LT)
- protected void setParent(llvm::Module * parent)
- public void setPartition(llvm::StringRef Part)
- public void setThreadLocal(bool Val)
- public void setThreadLocalMode(llvm::GlobalValue::ThreadLocalMode Val)
- public void setUnnamedAddr(llvm::GlobalValue::UnnamedAddr Val)
- public void setVisibility(llvm::GlobalValue::VisibilityTypes V)
- protected ~GlobalValue()
Inherited from Constant:
- public canTrap
- public classof
- public containsConstantExpression
- public containsUndefElement
- public destroyConstant
- public getAggregateElement
- public getAggregateElement
- public getAllOnesValue
- public getIntegerValue
- public getNullValue
- public getSplatValue
- public getUniqueInteger
- public handleOperandChange
- public hasExactInverseFP
- public isAllOnesValue
- public isConstantUsed
- public isDLLImportDependent
- public isElementWiseEqual
- public isFiniteNonZeroFP
- public isMinSignedValue
- public isNaN
- public isNegativeZeroValue
- public isNormalFP
- public isNotMinSignedValue
- public isNotOneValue
- public isNullValue
- public isOneValue
- public isThreadDependent
- public isZeroValue
- public needsRelocation
- public removeDeadConstantUsers
- public replaceUndefsWith
- public stripPointerCasts
- public stripPointerCasts
Inherited from User:
- protected Op
- protected Op
- protected OpFrom
- protected allocHungoffUses
- public classof
- public dropAllReferences
- public getDescriptor
- public getDescriptor
- public getNumOperands
- public getOperand
- public getOperandList
- public getOperandList
- public getOperandUse
- public getOperandUse
- protected growHungoffUses
- public op_begin
- public op_begin
- public op_end
- public op_end
- public operand_values
- public operand_values
- public operands
- public operands
- public replaceUsesOfWith
- public setGlobalVariableNumOperands
- public setNumHungOffUseOperands
- public setOperand
- public value_op_begin
- public value_op_begin
- public value_op_end
- public value_op_end
Inherited from Value:
- public DoPHITranslation
- public DoPHITranslation
- public addUse
- public assertModuleIsMaterialized
- public assertModuleIsMaterializedImpl
- public clearSubclassOptionalData
- public deleteValue
- public dump
- public getContext
- public getName
- public getNumUses
- public getPointerAlignment
- public getPointerDereferenceableBytes
- public getRawSubclassOptionalData
- protected getSubclassDataFromValue
- public getType
- public getValueID
- public getValueName
- public hasNUses
- public hasNUsesOrMore
- public hasName
- public hasOneUse
- public hasSameSubclassOptionalData
- public hasValueHandle
- public isSwiftError
- public isUsedByMetadata
- public isUsedInBasicBlock
- public materialized_use_begin
- public materialized_use_begin
- public materialized_use_empty
- public materialized_user_begin
- public materialized_user_begin
- public materialized_users
- public materialized_users
- public materialized_uses
- public materialized_uses
- public mutateType
- public print
- public print
- public printAsOperand
- public printAsOperand
- public replaceAllUsesWith
- public replaceNonMetadataUsesWith
- public replaceUsesOutsideBlock
- public replaceUsesWithIf
- public reverseUseList
- public setName
- public setValueName
- protected setValueSubclassData
- public sortUseList
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsOffsets
- public stripInBoundsOffsets
- public stripPointerCasts
- public stripPointerCasts
- public stripPointerCastsAndAliases
- public stripPointerCastsAndAliases
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsSameRepresentation
- public stripPointerCastsSameRepresentation
- public takeName
- public use_begin
- public use_begin
- public use_empty
- public use_end
- public use_end
- public user_back
- public user_back
- public user_begin
- public user_begin
- public user_empty
- public user_end
- public user_end
- public users
- public users
- public uses
- public uses
Methods
¶GlobalValue(
llvm::Type* Ty,
llvm::Value::ValueTy VTy,
llvm::Use* Ops,
unsigned int NumOps,
llvm::GlobalValue::LinkageTypes Linkage,
const llvm::Twine& Name,
unsigned int AddressSpace)
GlobalValue(
llvm::Type* Ty,
llvm::Value::ValueTy VTy,
llvm::Use* Ops,
unsigned int NumOps,
llvm::GlobalValue::LinkageTypes Linkage,
const llvm::Twine& Name,
unsigned int AddressSpace)
Declared at: llvm/include/llvm/IR/GlobalValue.h:76
Parameters
- llvm::Type* Ty
- llvm::Value::ValueTy VTy
- llvm::Use* Ops
- unsigned int NumOps
- llvm::GlobalValue::LinkageTypes Linkage
- const llvm::Twine& Name
- unsigned int AddressSpace
¶GlobalValue(const llvm::GlobalValue&)
GlobalValue(const llvm::GlobalValue&)
Declared at: llvm/include/llvm/IR/GlobalValue.h:192
Parameters
- const llvm::GlobalValue&
¶bool canBeOmittedFromSymbolTable() const
bool canBeOmittedFromSymbolTable() const
Description
True if GV can be left out of the object symbol table. This is the case for linkonce_odr values whose address is not significant. While legal, it is not normally profitable to omit them from the .o symbol table. Using this analysis makes sense when the information can be passed down to the linker or we are in LTO.
Declared at: llvm/include/llvm/IR/GlobalValue.h:591
¶bool canIncreaseAlignment() const
bool canIncreaseAlignment() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:552
¶static bool classof(const llvm::Value* V)
static bool classof(const llvm::Value* V)
Declared at: llvm/include/llvm/IR/GlobalValue.h:579
Parameters
- const llvm::Value* V
¶void copyAttributesFrom(
const llvm::GlobalValue* Src)
void copyAttributesFrom(
const llvm::GlobalValue* Src)
Description
Copy all additional attributes (those not needed to create a GlobalValue) from the GlobalValue Src to this one.
Declared at: llvm/include/llvm/IR/GlobalValue.h:471
Parameters
- const llvm::GlobalValue* Src
¶static llvm::StringRef dropLLVMManglingEscape(
llvm::StringRef Name)
static llvm::StringRef dropLLVMManglingEscape(
llvm::StringRef Name)
Description
If the given string begins with the GlobalValue name mangling escape character ' \ 1', drop it. This function applies a specific mangling that is used in PGO profiles, among other things. If you're trying to get a symbol name for an arbitrary GlobalValue, this is not the function you're looking for; see Mangler.h.
Declared at: llvm/include/llvm/IR/GlobalValue.h:481
Parameters
- llvm::StringRef Name
¶void eraseFromParent()
void eraseFromParent()
Description
This method unlinks 'this' from the containing module and deletes it.
Declared at: llvm/include/llvm/IR/GlobalValue.h:572
¶Optional<llvm::ConstantRange>
getAbsoluteSymbolRange() const
Optional<llvm::ConstantRange>
getAbsoluteSymbolRange() const
Description
If this is an absolute symbol reference, returns the range of the symbol, otherwise returns None.
Declared at: llvm/include/llvm/IR/GlobalValue.h:565
¶unsigned int getAddressSpace() const
unsigned int getAddressSpace() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:195
¶unsigned int getAlignment() const
unsigned int getAlignment() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:194
¶const llvm::GlobalObject* getBaseObject() const
const llvm::GlobalObject* getBaseObject() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:554
¶llvm::GlobalObject* getBaseObject()
llvm::GlobalObject* getBaseObject()
Declared at: llvm/include/llvm/IR/GlobalValue.h:555
¶const llvm::Comdat* getComdat() const
const llvm::Comdat* getComdat() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:230
¶llvm::Comdat* getComdat()
llvm::Comdat* getComdat()
Declared at: llvm/include/llvm/IR/GlobalValue.h:231
¶llvm::GlobalValue::DLLStorageClassTypes
getDLLStorageClass() const
llvm::GlobalValue::DLLStorageClassTypes
getDLLStorageClass() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:262
¶llvm::GlobalValue::GUID getGUID() const
llvm::GlobalValue::GUID getGUID() const
Description
Return a 64-bit global unique ID constructed from global value name (i.e. returned by getGlobalIdentifier()).
Declared at: llvm/include/llvm/IR/GlobalValue.h:510
¶static llvm::GlobalValue::GUID getGUID(
llvm::StringRef GlobalName)
static llvm::GlobalValue::GUID getGUID(
llvm::StringRef GlobalName)
Description
Return a 64-bit global unique ID constructed from global value name (i.e. returned by getGlobalIdentifier()).
Declared at: llvm/include/llvm/IR/GlobalValue.h:506
Parameters
- llvm::StringRef GlobalName
¶std::string getGlobalIdentifier() const
std::string getGlobalIdentifier() const
Description
Return the modified name for this global value suitable to be used as the key for a global lookup (e.g. profile or ThinLTO).
Declared at: llvm/include/llvm/IR/GlobalValue.h:497
¶static std::string getGlobalIdentifier(
llvm::StringRef Name,
GlobalValue::LinkageTypes Linkage,
llvm::StringRef FileName)
static std::string getGlobalIdentifier(
llvm::StringRef Name,
GlobalValue::LinkageTypes Linkage,
llvm::StringRef FileName)
Description
Return the modified name for a global value suitable to be used as the key for a global lookup (e.g. profile or ThinLTO). The value's original name is \c Name and has linkage of type\c Linkage. The value is defined in module \c FileName.
Declared at: llvm/include/llvm/IR/GlobalValue.h:491
Parameters
- llvm::StringRef Name
- GlobalValue::LinkageTypes Linkage
- llvm::StringRef FileName
¶unsigned int getGlobalValueSubClassData() const
unsigned int getGlobalValueSubClassData() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:164
¶static llvm::GlobalValue::LinkageTypes
getLinkOnceLinkage(bool ODR)
static llvm::GlobalValue::LinkageTypes
getLinkOnceLinkage(bool ODR)
Declared at: llvm/include/llvm/IR/GlobalValue.h:293
Parameters
- bool ODR
¶llvm::GlobalValue::LinkageTypes getLinkage() const
llvm::GlobalValue::LinkageTypes getLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:460
¶static llvm::GlobalValue::UnnamedAddr
getMinUnnamedAddr(
llvm::GlobalValue::UnnamedAddr A,
llvm::GlobalValue::UnnamedAddr B)
static llvm::GlobalValue::UnnamedAddr
getMinUnnamedAddr(
llvm::GlobalValue::UnnamedAddr A,
llvm::GlobalValue::UnnamedAddr B)
Declared at: llvm/include/llvm/IR/GlobalValue.h:221
Parameters
- llvm::GlobalValue::UnnamedAddr A
- llvm::GlobalValue::UnnamedAddr B
¶const llvm::Module* getParent() const
const llvm::Module* getParent() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:576
¶llvm::Module* getParent()
llvm::Module* getParent()
Description
Get the module that this global value is contained inside of...
Declared at: llvm/include/llvm/IR/GlobalValue.h:575
¶llvm::StringRef getPartition() const
llvm::StringRef getPartition() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:290
¶llvm::StringRef getSection() const
llvm::StringRef getSection() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:274
¶llvm::GlobalValue::ThreadLocalMode
getThreadLocalMode() const
llvm::GlobalValue::ThreadLocalMode
getThreadLocalMode() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:258
¶llvm::PointerType* getType() const
llvm::PointerType* getType() const
Description
Global values are always pointers.
Declared at: llvm/include/llvm/IR/GlobalValue.h:277
¶llvm::GlobalValue::UnnamedAddr getUnnamedAddr()
const
llvm::GlobalValue::UnnamedAddr getUnnamedAddr()
const
Declared at: llvm/include/llvm/IR/GlobalValue.h:216
¶llvm::Type* getValueType() const
llvm::Type* getValueType() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:279
¶llvm::GlobalValue::VisibilityTypes getVisibility()
const
llvm::GlobalValue::VisibilityTypes getVisibility()
const
Declared at: llvm/include/llvm/IR/GlobalValue.h:236
¶static llvm::GlobalValue::LinkageTypes
getWeakLinkage(bool ODR)
static llvm::GlobalValue::LinkageTypes
getWeakLinkage(bool ODR)
Declared at: llvm/include/llvm/IR/GlobalValue.h:296
Parameters
- bool ODR
¶bool hasAppendingLinkage() const
bool hasAppendingLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:442
¶bool hasAtLeastLocalUnnamedAddr() const
bool hasAtLeastLocalUnnamedAddr() const
Description
Returns true if this value's address is not significant in this module. This attribute is intended to be used only by the code generator and LTO to allow the linker to decide whether the global needs to be in the symbol table. It should probably not be used in optimizations, as the value may have uses outside the module; use hasGlobalUnnamedAddr() instead.
Declared at: llvm/include/llvm/IR/GlobalValue.h:212
¶bool hasAvailableExternallyLinkage() const
bool hasAvailableExternallyLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:432
¶bool hasComdat() const
bool hasComdat() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:229
¶bool hasCommonLinkage() const
bool hasCommonLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:449
¶bool hasDLLExportStorageClass() const
bool hasDLLExportStorageClass() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:268
¶bool hasDLLImportStorageClass() const
bool hasDLLImportStorageClass() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:265
¶bool hasDefaultVisibility() const
bool hasDefaultVisibility() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:237
¶bool hasExactDefinition() const
bool hasExactDefinition() const
Description
Return true if this global has an exact defintion.
Declared at: llvm/include/llvm/IR/GlobalValue.h:416
¶bool hasExternalLinkage() const
bool hasExternalLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:431
¶bool hasExternalWeakLinkage() const
bool hasExternalWeakLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:446
¶bool hasGlobalUnnamedAddr() const
bool hasGlobalUnnamedAddr() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:203
¶bool hasHiddenVisibility() const
bool hasHiddenVisibility() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:238
¶bool hasInternalLinkage() const
bool hasInternalLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:443
¶bool hasLinkOnceLinkage() const
bool hasLinkOnceLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:435
¶bool hasLinkOnceODRLinkage() const
bool hasLinkOnceODRLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:436
¶bool hasLocalLinkage() const
bool hasLocalLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:445
¶bool hasPartition() const
bool hasPartition() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:287
¶bool hasPrivateLinkage() const
bool hasPrivateLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:444
¶bool hasProtectedVisibility() const
bool hasProtectedVisibility() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:239
¶bool hasSection() const
bool hasSection() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:273
¶bool hasValidDeclarationLinkage() const
bool hasValidDeclarationLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:450
¶bool hasWeakAnyLinkage() const
bool hasWeakAnyLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:440
¶bool hasWeakLinkage() const
bool hasWeakLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:439
¶bool hasWeakODRLinkage() const
bool hasWeakODRLinkage() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:441
¶bool isAbsoluteSymbolRef() const
bool isAbsoluteSymbolRef() const
Description
Returns whether this is a reference to an absolute symbol.
Declared at: llvm/include/llvm/IR/GlobalValue.h:561
¶static bool isAppendingLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isAppendingLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:321
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶static bool isAvailableExternallyLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isAvailableExternallyLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:303
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶static bool isCommonLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isCommonLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:336
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶bool isDSOLocal() const
bool isDSOLocal() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:283
¶bool isDeclaration() const
bool isDeclaration() const
Description
Return true if the primary definition of this global value is outside of the current translation unit.
Declared at: llvm/include/llvm/IR/GlobalValue.h:531
¶bool isDeclarationForLinker() const
bool isDeclarationForLinker() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:533
¶bool isDefinitionExact() const
bool isDefinitionExact() const
Description
Return true if the currently visible definition of this global (if any) is exactly the definition we will see at runtime. Non-exact linkage types inhibits most non-inlining IPO, since a differently optimized variant of the same function can have different observable or undefined behavior than in the variant currently visible. For instance, we could have started with void foo(int *v) { int t = 5 / v[0]; (void) t; } and "refined" it to void foo(int *v) { } However, we cannot infer readnone for `foo`, since that would justify DSE'ing a store to `v[0]` across a call to `foo`, which can cause undefined behavior if the linker replaces the actual call destination with the unoptimized `foo`. Inlining is okay across non-exact linkage types as long as they're not interposable (see \c isInterposable), since in such cases the currently visible variant is *a* correct implementation of the original source function; it just isn't the *only* correct implementation.
Declared at: llvm/include/llvm/IR/GlobalValue.h:411
¶static bool isDiscardableIfUnused(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isDiscardableIfUnused(
llvm::GlobalValue::LinkageTypes Linkage)
Description
Whether the definition of this global may be discarded if it is not used in its compilation unit.
Declared at: llvm/include/llvm/IR/GlobalValue.h:370
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶bool isDiscardableIfUnused() const
bool isDiscardableIfUnused() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:462
¶static bool isExternalLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isExternalLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:300
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶static bool isExternalWeakLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isExternalWeakLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:333
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶static bool isInternalLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isInternalLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:324
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶bool isInterposable() const
bool isInterposable() const
Description
Return true if this global's definition can be substituted with an *arbitrary* definition at link time. We cannot do any IPO or inlinining across interposable call edges, since the callee can be replaced with something arbitrary at link time.
Declared at: llvm/include/llvm/IR/GlobalValue.h:429
¶static bool isInterposableLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isInterposableLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Description
Whether the definition of this global may be replaced by something non-equivalent at link time. For example, if a function has weak linkage then the code defining it may be replaced by different code.
Declared at: llvm/include/llvm/IR/GlobalValue.h:346
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶static bool isLinkOnceLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isLinkOnceLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:309
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶static bool isLinkOnceODRLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isLinkOnceODRLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:306
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶static bool isLocalLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isLocalLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:330
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶bool isMaterializable() const
bool isMaterializable() const
Description
If this function's Module is being lazily streamed in functions from disk or some other source, this method can be used to check to see if the function has been read in yet or not.
Declared at: llvm/include/llvm/IR/GlobalValue.h:522
¶static bool isPrivateLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isPrivateLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:327
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶bool isStrongDefinitionForLinker() const
bool isStrongDefinitionForLinker() const
Description
Returns true if this global's definition will be the one chosen by the linker. NB! Ideally this should not be used at the IR level at all. If you're interested in optimization constraints implied by the linker's ability to choose an implementation, prefer using \c hasExactDefinition.
Declared at: llvm/include/llvm/IR/GlobalValue.h:546
¶bool isThreadLocal() const
bool isThreadLocal() const
Description
If the value is "Thread Local", its value isn't shared by the threads.
Declared at: llvm/include/llvm/IR/GlobalValue.h:250
¶static bool isValidDeclarationLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isValidDeclarationLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:339
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶static bool isWeakAnyLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isWeakAnyLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:312
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶bool isWeakForLinker() const
bool isWeakForLinker() const
Declared at: llvm/include/llvm/IR/GlobalValue.h:466
¶static bool isWeakForLinker(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isWeakForLinker(
llvm::GlobalValue::LinkageTypes Linkage)
Description
Whether the definition of this global may be replaced at link time. NB: Using this method outside of the code generators is almost always a mistake: when working at the IR level use isInterposable instead as it knows about ODR semantics.
Declared at: llvm/include/llvm/IR/GlobalValue.h:379
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶static bool isWeakLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isWeakLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:318
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶static bool isWeakODRLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
static bool isWeakODRLinkage(
llvm::GlobalValue::LinkageTypes Linkage)
Declared at: llvm/include/llvm/IR/GlobalValue.h:315
Parameters
- llvm::GlobalValue::LinkageTypes Linkage
¶llvm::Error materialize()
llvm::Error materialize()
Description
Make sure this GlobalValue is fully read.
Declared at: llvm/include/llvm/IR/GlobalValue.h:525
¶void removeFromParent()
void removeFromParent()
Description
This method unlinks 'this' from the containing module, but does not delete it.
Declared at: llvm/include/llvm/IR/GlobalValue.h:569
¶void setDLLStorageClass(
llvm::GlobalValue::DLLStorageClassTypes C)
void setDLLStorageClass(
llvm::GlobalValue::DLLStorageClassTypes C)
Declared at: llvm/include/llvm/IR/GlobalValue.h:271
Parameters
- llvm::GlobalValue::DLLStorageClassTypes C
¶void setDSOLocal(bool Local)
void setDSOLocal(bool Local)
Declared at: llvm/include/llvm/IR/GlobalValue.h:281
Parameters
- bool Local
¶void setGlobalValueSubClassData(unsigned int V)
void setGlobalValueSubClassData(unsigned int V)
Declared at: llvm/include/llvm/IR/GlobalValue.h:167
Parameters
- unsigned int V
¶void setLinkage(
llvm::GlobalValue::LinkageTypes LT)
void setLinkage(
llvm::GlobalValue::LinkageTypes LT)
Declared at: llvm/include/llvm/IR/GlobalValue.h:454
Parameters
- llvm::GlobalValue::LinkageTypes LT
¶void setParent(llvm::Module* parent)
void setParent(llvm::Module* parent)
Declared at: llvm/include/llvm/IR/GlobalValue.h:175
Parameters
- llvm::Module* parent
¶void setPartition(llvm::StringRef Part)
void setPartition(llvm::StringRef Part)
Declared at: llvm/include/llvm/IR/GlobalValue.h:291
Parameters
- llvm::StringRef Part
¶void setThreadLocal(bool Val)
void setThreadLocal(bool Val)
Declared at: llvm/include/llvm/IR/GlobalValue.h:251
Parameters
- bool Val
¶void setThreadLocalMode(
llvm::GlobalValue::ThreadLocalMode Val)
void setThreadLocalMode(
llvm::GlobalValue::ThreadLocalMode Val)
Declared at: llvm/include/llvm/IR/GlobalValue.h:254
Parameters
- llvm::GlobalValue::ThreadLocalMode Val
¶void setUnnamedAddr(
llvm::GlobalValue::UnnamedAddr Val)
void setUnnamedAddr(
llvm::GlobalValue::UnnamedAddr Val)
Declared at: llvm/include/llvm/IR/GlobalValue.h:219
Parameters
- llvm::GlobalValue::UnnamedAddr Val
¶void setVisibility(
llvm::GlobalValue::VisibilityTypes V)
void setVisibility(
llvm::GlobalValue::VisibilityTypes V)
Declared at: llvm/include/llvm/IR/GlobalValue.h:242
Parameters
- llvm::GlobalValue::VisibilityTypes V
¶~GlobalValue()
~GlobalValue()
Declared at: llvm/include/llvm/IR/GlobalValue.h:179