LLVM API Documentation
#include <GlobalVariable.h>
Inheritance diagram for llvm::GlobalVariable:
Public Member Functions | |
GlobalVariable (const Type *Ty, bool isConstant, LinkageTypes Linkage, Constant *Initializer=0, const std::string &Name="", Module *Parent=0) | |
virtual void | setName (const std::string &name, SymbolTable *ST=0) |
virtual bool | isExternal () const |
bool | hasInitializer () const |
Constant * | getInitializer () const |
Constant * | getInitializer () |
void | setInitializer (Constant *CPV) |
GlobalVariable * | getNext () |
const GlobalVariable * | getNext () const |
GlobalVariable * | getPrev () |
const GlobalVariable * | getPrev () const |
bool | isConstant () const |
void | setConstant (bool Value) |
void | removeFromParent () |
void | eraseFromParent () |
virtual void | replaceUsesOfWithOnConstant (Value *From, Value *To, bool DisableChecking=false) |
virtual void | print (std::ostream &OS) const |
Static Public Member Functions | |
static bool | classof (const GlobalVariable *) |
static bool | classof (const Value *V) |
Friends | |
class | SymbolTableListTraits< GlobalVariable, Module, Module,ilist_traits< GlobalVariable > > |
Definition at line 34 of file GlobalVariable.h.
|
GlobalVariable ctor - If a parent module is specified, the global is automatically inserted into the end of the specified modules global list. Definition at line 74 of file Globals.cpp. References llvm::LeakDetector::addGarbageObject(), llvm::Module::getGlobalList(), llvm::Value::getType(), and llvm::User::Operands. |
|
Reimplemented from llvm::GlobalValue. Definition at line 120 of file GlobalVariable.h. References llvm::Value::getValueType(), and llvm::Value::GlobalVariableVal. |
|
Definition at line 119 of file GlobalVariable.h. |
|
eraseFromParent - This method unlinks 'this' from the containing module and deletes it. Definition at line 113 of file Globals.cpp. References llvm::Module::getGlobalList(), and llvm::GlobalValue::getParent(). Referenced by LinkGlobals(), OptimizeAwayTrappingUsesOfLoads(), and OptimizeGlobalAddressOfMalloc(). |
|
Definition at line 75 of file GlobalVariable.h. References hasInitializer(), and llvm::User::Operands. |
|
getInitializer - Return the initializer for this global variable. It is illegal to call this method if the global is external, because we cannot tell what the value is initialized to! Definition at line 71 of file GlobalVariable.h. References hasInitializer(), and llvm::User::Operands. Referenced by llvm::ExecutionEngine::EmitGlobalVariable(), GetAddressedElementFromGlobal(), llvm::ProgramInfo::getFunction(), llvm::ProgramInfo::getSourceFile(), LinkAppendingVars(), LinkGlobalInits(), OptimizeOnceStoredGlobal(), llvm::SourceFileInfo::SourceFileInfo(), llvm::SourceFunctionInfo::SourceFunctionInfo(), and SRAGlobal(). |
|
Definition at line 90 of file GlobalVariable.h. References Next(). |
|
Definition at line 89 of file GlobalVariable.h. References Next(). |
|
Definition at line 92 of file GlobalVariable.h. |
|
Definition at line 91 of file GlobalVariable.h. |
|
hasInitializer - Unless a global variable isExternal(), it has an initializer. The initializer for the global variable/constant is held by Operands[0] if an initializer is specified. Definition at line 65 of file GlobalVariable.h. References isExternal(). Referenced by llvm::ProgramInfo::getFunction(), getInitializer(), llvm::ProgramInfo::getSourceFile(), LinkGlobalInits(), LinkGlobals(), llvm::BytecodeReader::ParseModule(), setInitializer(), llvm::SourceFileInfo::SourceFileInfo(), and llvm::SourceFunctionInfo::SourceFunctionInfo(). |
|
If the value is a global constant, its value is immutable throughout the runtime execution of the program. Assigning a value into the constant leads to undefined behavior. Definition at line 98 of file GlobalVariable.h. Referenced by LinkAppendingVars(), LinkGlobals(), and SRAGlobal(). |
|
isExternal - Is this global variable lacking an initializer? If so, the global variable is defined in some other translation unit, and is thus externally defined here. Implements llvm::GlobalValue. Definition at line 59 of file GlobalVariable.h. References llvm::User::Operands. Referenced by llvm::JIT::getOrEmitGlobalVariable(), hasInitializer(), LinkGlobals(), and ProcessGlobalsWithSameName(). |
|
print - Implement operator<< on Value... Reimplemented from llvm::Constant. Definition at line 1194 of file AsmWriter.cpp. References llvm::GlobalValue::getParent(), and llvm::AssemblyWriter::write(). |
|
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it. Definition at line 109 of file Globals.cpp. References llvm::Module::getGlobalList(), and llvm::GlobalValue::getParent(). |
|
Override Constant's implementation of this method so we can replace constant initializers. Reimplemented from llvm::Constant. Definition at line 117 of file Globals.cpp. References llvm::User::getNumOperands(), llvm::Constant::getOperand(), and llvm::Constant::setOperand(). |
|
Definition at line 99 of file GlobalVariable.h. Referenced by LinkGlobals(), and ParseGlobalVariable(). |
|
Definition at line 79 of file GlobalVariable.h. References hasInitializer(), and llvm::User::Operands. Referenced by llvm::CloneModule(), LinkAppendingVars(), LinkGlobalInits(), LinkGlobals(), ParseGlobalVariable(), and ProcessGlobalsWithSameName(). |
|
Reimplemented from llvm::Constant. Definition at line 100 of file Globals.cpp. References llvm::GlobalValue::getParent(), llvm::Module::getSymbolTable(), llvm::Value::hasName(), llvm::SymbolTable::insert(), llvm::SymbolTable::remove(), and llvm::Value::setName(). |
|
Definition at line 36 of file GlobalVariable.h. |