diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -1469,24 +1469,15 @@ } 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(Ty)) { - Type *TyInProgAS = cast(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; }