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 | e0f136d9637981bbc5096ca396e4df383c59eafe (patch) | |
tree | 04e35fb85689b9621ea6ec76db47849335a87c5c /lib/VMCore/Globals.cpp | |
parent | b00d54ed680a35df08561e6e852b57a88c49c004 (diff) | |
download | external_llvm-e0f136d9637981bbc5096ca396e4df383c59eafe.zip external_llvm-e0f136d9637981bbc5096ca396e4df383c59eafe.tar.gz external_llvm-e0f136d9637981bbc5096ca396e4df383c59eafe.tar.bz2 |
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 5abe1f9..c31b7b5 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) { |