diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-08 23:50:31 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-08 23:50:31 +0000 |
commit | e03e4c62a183ab2c505b98c130c693da0e43792f (patch) | |
tree | 521246e436d066afa6ee4cc628a9be3f5a23ae5b /lib | |
parent | 81b9f12415f4323652e94c388ab1ba803a88daa6 (diff) | |
download | external_llvm-e03e4c62a183ab2c505b98c130c693da0e43792f.zip external_llvm-e03e4c62a183ab2c505b98c130c693da0e43792f.tar.gz external_llvm-e03e4c62a183ab2c505b98c130c693da0e43792f.tar.bz2 |
LLVMContext-ification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75072 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Globals.cpp | 3 | ||||
-rw-r--r-- | lib/VMCore/Module.cpp | 14 |
2 files changed, 10 insertions, 7 deletions
diff --git a/lib/VMCore/Globals.cpp b/lib/VMCore/Globals.cpp index c3fe568..adc7a82 100644 --- a/lib/VMCore/Globals.cpp +++ b/lib/VMCore/Globals.cpp @@ -118,7 +118,8 @@ GlobalVariable::GlobalVariable(Module &M, const Type *Ty, bool constant, const std::string &Name, GlobalVariable *Before, bool ThreadLocal, unsigned AddressSpace) - : GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal, + : GlobalValue(M.getContext().getPointerType(Ty, AddressSpace), + Value::GlobalVariableVal, OperandTraits<GlobalVariable>::op_begin(this), InitVal != 0, Link, Name), isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) { diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 8739848..4daa92d 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -157,8 +157,8 @@ Constant *Module::getOrInsertFunction(const std::string &Name, // If the function exists but has the wrong type, return a bitcast to the // right type. - if (F->getType() != PointerType::getUnqual(Ty)) - return ConstantExpr::getBitCast(F, PointerType::getUnqual(Ty)); + if (F->getType() != Context.getPointerTypeUnqual(Ty)) + return Context.getConstantExprBitCast(F, Context.getPointerTypeUnqual(Ty)); // Otherwise, we just found the existing function or a prototype. return F; @@ -206,7 +206,8 @@ Constant *Module::getOrInsertFunction(const std::string &Name, va_end(Args); // Build the function type and chain to the other getOrInsertFunction... - return getOrInsertFunction(Name, FunctionType::get(RetTy, ArgTys, false), + return getOrInsertFunction(Name, + Context.getFunctionType(RetTy, ArgTys, false), AttributeList); } @@ -223,7 +224,8 @@ Constant *Module::getOrInsertFunction(const std::string &Name, va_end(Args); // Build the function type and chain to the other getOrInsertFunction... - return getOrInsertFunction(Name, FunctionType::get(RetTy, ArgTys, false), + return getOrInsertFunction(Name, + Context.getFunctionType(RetTy, ArgTys, false), AttrListPtr::get((AttributeWithIndex *)0, 0)); } @@ -277,8 +279,8 @@ Constant *Module::getOrInsertGlobal(const std::string &Name, const Type *Ty) { // If the variable exists but has the wrong type, return a bitcast to the // right type. - if (GV->getType() != PointerType::getUnqual(Ty)) - return ConstantExpr::getBitCast(GV, PointerType::getUnqual(Ty)); + if (GV->getType() != Context.getPointerTypeUnqual(Ty)) + return Context.getConstantExprBitCast(GV, Context.getPointerTypeUnqual(Ty)); // Otherwise, we just found the existing function or a prototype. return GV; |