if (isa<FunctionType>(Ty))
error("Cannot declare global vars of function type");
- const PointerType *PTy = PointerType::get(Ty);
+ const PointerType *PTy = PointerType::getUnqual(Ty);
std::string Name;
if (NameStr) {
}
// Put the renaming in the global rename map
- RenameMapKey Key = makeRenameMapKey(Name, PointerType::get(Ty), ID.S);
+ RenameMapKey Key =
+ makeRenameMapKey(Name, PointerType::getUnqual(Ty), ID.S);
CurModule.RenameMap[Key] = NewName;
// Rename it
break;
case 'v' : {
- const Type* PtrTy = PointerType::get(Type::Int8Ty);
+ const Type* PtrTy = PointerType::getUnqual(Type::Int8Ty);
std::vector<const Type*> Params;
if (Name == "llvm.va_start" || Name == "llvm.va_end") {
if (Args.size() != 1)
Params.push_back(PtrTy);
const FunctionType *FTy =
FunctionType::get(Type::VoidTy, Params, false);
- const PointerType *PFTy = PointerType::get(FTy);
+ const PointerType *PFTy = PointerType::getUnqual(FTy);
Value* Func = getVal(PFTy, ID);
Args[0] = new BitCastInst(Args[0], PtrTy, makeNameUnique("va"), CurBB);
return new CallInst(Func, Args.begin(), Args.end());
Params.push_back(PtrTy);
const FunctionType *FTy =
FunctionType::get(Type::VoidTy, Params, false);
- const PointerType *PFTy = PointerType::get(FTy);
+ const PointerType *PFTy = PointerType::getUnqual(FTy);
Value* Func = getVal(PFTy, ID);
std::string InstName0(makeNameUnique("va0"));
std::string InstName1(makeNameUnique("va1"));
const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID);
const Type* ArgTy = F->getFunctionType()->getReturnType();
- const Type* ArgTyPtr = PointerType::get(ArgTy);
+ const Type* ArgTyPtr = PointerType::getUnqual(ArgTy);
Function* NF = cast<Function>(Result->getOrInsertFunction(
"llvm.va_start", RetTy, ArgTyPtr, (Type *)0));
//vaend bar
const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID);
const Type* ArgTy = F->getFunctionType()->getParamType(0);
- const Type* ArgTyPtr = PointerType::get(ArgTy);
+ const Type* ArgTyPtr = PointerType::getUnqual(ArgTy);
Function* NF = cast<Function>(Result->getOrInsertFunction(
"llvm.va_end", RetTy, ArgTyPtr, (Type *)0));
const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID);
const Type* ArgTy = F->getFunctionType()->getReturnType();
- const Type* ArgTyPtr = PointerType::get(ArgTy);
+ const Type* ArgTyPtr = PointerType::getUnqual(ArgTy);
Function* NF = cast<Function>(Result->getOrInsertFunction(
"llvm.va_copy", RetTy, ArgTyPtr, ArgTyPtr, (Type *)0));
if ($1.PAT->get() == Type::LabelTy)
error("Cannot form a pointer to a basic block");
$$.S.makeComposite($1.S);
- $$.PAT = new PATypeHolder(HandleUpRefs(PointerType::get($1.PAT->get()),
- $$.S));
+ $$.PAT = new
+ PATypeHolder(HandleUpRefs(PointerType::getUnqual($1.PAT->get()),
+ $$.S));
delete $1.PAT;
}
;
// i8*. We check here for those names and override the parameter list
// types to ensure the prototype is correct.
if (FunctionName == "llvm.va_start" || FunctionName == "llvm.va_end") {
- ParamTyList.push_back(PointerType::get(Type::Int8Ty));
+ ParamTyList.push_back(PointerType::getUnqual(Type::Int8Ty));
} else if (FunctionName == "llvm.va_copy") {
- ParamTyList.push_back(PointerType::get(Type::Int8Ty));
- ParamTyList.push_back(PointerType::get(Type::Int8Ty));
+ ParamTyList.push_back(PointerType::getUnqual(Type::Int8Ty));
+ ParamTyList.push_back(PointerType::getUnqual(Type::Int8Ty));
} else if ($5) { // If there are arguments...
for (std::vector<std::pair<PATypeInfo,char*> >::iterator
I = $5->begin(), E = $5->end(); I != E; ++I) {
ParamTyList.pop_back();
const FunctionType *FT = FunctionType::get(RetTy, ParamTyList, isVarArg);
- const PointerType *PFT = PointerType::get(FT);
+ const PointerType *PFT = PointerType::getUnqual(FT);
delete $2.PAT;
ValID ID;
}
;
-// SymbolicValueRef - Reference to one of two ways of symbolically refering to // another value.
+// SymbolicValueRef - Reference to one of two ways of symbolically refering to
+// another value.
//
SymbolicValueRef
: INTVAL { $$ = ValID::create($1); $$.S.makeSignless(); }
bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy;
if (isVarArg) ParamTypes.pop_back();
Ty = FunctionType::get($3.PAT->get(), ParamTypes, isVarArg);
- PFTy = PointerType::get(Ty);
+ PFTy = PointerType::getUnqual(Ty);
$$.S.copy($3.S);
} else {
FTySign = $3.S;
error("Functions cannot return aggregate types");
FTy = FunctionType::get(RetTy, ParamTypes, isVarArg);
- PFTy = PointerType::get(FTy);
+ PFTy = PointerType::getUnqual(FTy);
$$.S.copy($3.S);
} else {
FTySign = $3.S;
Value *StoreVal = $3.V;
Value* tmpVal = getVal(PTy, $6);
if (ElTy != $3.V->getType()) {
- PTy = PointerType::get(StoreVal->getType());
+ PTy = PointerType::getUnqual(StoreVal->getType());
if (Constant *C = dyn_cast<Constant>(tmpVal))
tmpVal = ConstantExpr::getBitCast(C, PTy);
else