20 #ifndef LLVM_IR_GLOBALVARIABLE_H
21 #define LLVM_IR_GLOBALVARIABLE_H
37 template <
typename ValueSubClass>
class SymbolTableListTraits;
38 class DIGlobalVariable;
39 class DIGlobalVariableExpression;
44 bool isConstantGlobal : 1;
45 bool isExternallyInitializedConstant : 1;
75 void *
operator new(
size_t s) {
76 return User::operator
new(s, 1);
79 void *
operator new(size_t,
unsigned) =
delete;
132 return static_cast<Constant*
>(Op<0>().
get());
136 return static_cast<Constant*
>(Op<0>().
get());
151 return isExternallyInitializedConstant;
154 isExternallyInitializedConstant = Val;
183 return V->
getValueID() == Value::GlobalVariableVal;
196 #endif // LLVM_IR_GLOBALVARIABLE_H
static bool classof(const Value *V)
A Module instance is used to store all the information related to an LLVM module. ...
void getDebugInfo(SmallVectorImpl< DIGlobalVariableExpression * > &GVs) const
Fill the vector with all debug info attachements.
const Constant * getInitializer() const
getInitializer - Return the initializer for this global variable.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
void setInitializer(Constant *InitVal)
setInitializer - Sets the initializer for this global variable, removing any existing initializer if ...
GlobalVariable & operator=(const GlobalVariable &)=delete
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isStrongDefinitionForLinker() const
Returns true if this global's definition will be the one chosen by the linker.
bool hasUniqueInitializer() const
hasUniqueInitializer - Whether the global variable has an initializer, and any changes made to the in...
void eraseFromParent() override
eraseFromParent - This method unlinks 'this' from the containing module and deletes it...
#define DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CLASS, VALUECLASS)
Macro for generating out-of-class operand accessor definitions.
bool hasDefinitiveInitializer() const
hasDefinitiveInitializer - Whether the global variable has an initializer, and any other instances of...
GlobalVariable(Type *Ty, bool isConstant, LinkageTypes Linkage, Constant *Initializer=nullptr, const Twine &Name="", ThreadLocalMode=NotThreadLocal, unsigned AddressSpace=0, bool isExternallyInitialized=false)
GlobalVariable ctor - If a parent module is specified, the global is automatically inserted into the ...
bool isExternallyInitialized() const
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
void setExternallyInitialized(bool Val)
A pair of DIGlobalVariable and DIExpression.
unsigned getValueID() const
Return an ID for the concrete type of this object.
OptionalOperandTraits - when the number of operands may change at runtime.
void setGlobalVariableNumOperands(unsigned NumOps)
Set the number of operands on a GlobalVariable.
~GlobalVariable() override
void setConstant(bool Val)
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
bool hasInitializer() const
Definitions have initializers, declarations don't.
LinkageTypes
An enumeration for the kinds of linkage for global values.
bool isConstant() const
If the value is a global constant, its value is immutable throughout the runtime execution of the pro...
void dropAllReferences()
Drop all references in preparation to destroy the GlobalVariable.
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
Compile-time customization of User operands.
bool isInterposable() const
Return true if this global's definition can be substituted with an arbitrary definition at link time...
void copyAttributesFrom(const GlobalValue *Src) override
copyAttributesFrom - copy all additional attributes (those not needed to create a GlobalVariable) fro...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
void addDebugInfo(DIGlobalVariableExpression *GV)
Attach a DIGlobalVariableExpression.
Constant * getInitializer()
void removeFromParent() override
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it...