20 #ifndef LLVM_IR_GLOBALVARIABLE_H
21 #define LLVM_IR_GLOBALVARIABLE_H
32 template<
typename ValueSubClass,
typename ItemParentClass>
33 class SymbolTableListTraits;
37 void *
operator new(size_t,
unsigned) =
delete;
41 void setParent(
Module *parent);
43 bool isConstantGlobal : 1;
44 bool isExternallyInitializedConstant : 1;
50 void *
operator new(
size_t s) {
51 return User::operator
new(s, 1);
129 return static_cast<Constant*
>(Op<0>().
get());
133 return static_cast<Constant*
>(Op<0>().
get());
148 return isExternallyInitializedConstant;
151 isExternallyInitializedConstant = Val;
170 return V->
getValueID() == Value::GlobalVariableVal;
static bool classof(const Value *V)
A Module instance is used to store all the information related to an LLVM module. ...
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 ...
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...
bool isWeakForLinker() const
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)
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...
ilist_node - Base class that provides next/prev services for nodes that use ilist_nextprev_traits or ...
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.
void copyAttributesFrom(const GlobalValue *Src) override
copyAttributesFrom - copy all additional attributes (those not needed to create a GlobalVariable) fro...
LLVM Value Representation.
bool mayBeOverridden() const
Constant * getInitializer()
void removeFromParent() override
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it...