diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-08 01:26:06 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-08 01:26:06 +0000 |
commit | 3d29df3e8a203b167d8071ea6f805b21db18a5af (patch) | |
tree | 04e35fb85689b9621ea6ec76db47849335a87c5c /lib/VMCore/Globals.cpp | |
parent | 8b8d31e3ec8c491a893307069ac123728c84782c (diff) | |
download | llvm-3d29df3e8a203b167d8071ea6f805b21db18a5af.tar.gz llvm-3d29df3e8a203b167d8071ea6f805b21db18a5af.tar.bz2 llvm-3d29df3e8a203b167d8071ea6f805b21db18a5af.tar.xz |
Push LLVMContext through GlobalVariables and IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Globals.cpp')
-rw-r--r-- | lib/VMCore/Globals.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/VMCore/Globals.cpp b/lib/VMCore/Globals.cpp index 5abe1f9ac4..c31b7b5e76 100644 --- a/lib/VMCore/Globals.cpp +++ b/lib/VMCore/Globals.cpp @@ -16,6 +16,7 @@ #include "llvm/GlobalVariable.h" #include "llvm/GlobalAlias.h" #include "llvm/DerivedTypes.h" +#include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/Support/LeakDetector.h" @@ -93,11 +94,13 @@ void GlobalValue::copyAttributesFrom(const GlobalValue *Src) { // GlobalVariable Implementation //===----------------------------------------------------------------------===// -GlobalVariable::GlobalVariable(const Type *Ty, bool constant, LinkageTypes Link, +GlobalVariable::GlobalVariable(LLVMContext &Context, const Type *Ty, + bool constant, LinkageTypes Link, Constant *InitVal, const std::string &Name, Module *ParentModule, bool ThreadLocal, unsigned AddressSpace) - : GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal, + : GlobalValue(Context.getPointerType(Ty, AddressSpace), + Value::GlobalVariableVal, OperandTraits<GlobalVariable>::op_begin(this), InitVal != 0, Link, Name), isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) { @@ -113,11 +116,13 @@ GlobalVariable::GlobalVariable(const Type *Ty, bool constant, LinkageTypes Link, ParentModule->getGlobalList().push_back(this); } -GlobalVariable::GlobalVariable(const Type *Ty, bool constant, LinkageTypes Link, +GlobalVariable::GlobalVariable(LLVMContext &Context, const Type *Ty, + bool constant, LinkageTypes Link, Constant *InitVal, const std::string &Name, GlobalVariable *Before, bool ThreadLocal, unsigned AddressSpace) - : GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal, + : GlobalValue(Context.getPointerType(Ty, AddressSpace), + Value::GlobalVariableVal, OperandTraits<GlobalVariable>::op_begin(this), InitVal != 0, Link, Name), isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) { |