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) {
// 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;
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);
}
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));
}
// 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;