}
Value *LLParser::checkValidVariableType(LocTy Loc, const Twine &Name, Type *Ty,
- Value *Val, bool IsCall) {
+ Value *Val, bool /* IsCall */) {
if (Val->getType() == Ty)
return Val;
- // For calls we also accept variables in the program address space.
- Type *SuggestedTy = Ty;
- if (IsCall && isa<PointerType>(Ty)) {
- Type *TyInProgAS = cast<PointerType>(Ty)->getElementType()->getPointerTo(
- M->getDataLayout().getProgramAddressSpace());
- SuggestedTy = TyInProgAS;
- if (Val->getType() == TyInProgAS)
- return Val;
- }
if (Ty->isLabelTy())
error(Loc, "'" + Name + "' is not a basic block");
else
error(Loc, "'" + Name + "' defined with type '" +
getTypeString(Val->getType()) + "' but expected '" +
- getTypeString(SuggestedTy) + "'");
+ getTypeString(Ty) + "'");
return nullptr;
}