that matches its return type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12944
91177308-0d34-0410-b5e6-
96231b3b80d8
- case Intrinsic:: readio:
+ case Intrinsic:: readio: {
+ const Type * ParamType = FT->getParamType(0);
+ const Type * ReturnType = FT->getReturnType();
+
Assert1(FT->getNumParams() == 1,
"Illegal # arguments for intrinsic function!", IF);
Assert1(FT->getNumParams() == 1,
"Illegal # arguments for intrinsic function!", IF);
- Assert1(FT->getReturnType()->isFirstClassType(),
+ Assert1(ReturnType->isFirstClassType(),
"Return type is not a first class type!", IF);
"Return type is not a first class type!", IF);
- Assert1(FT->getParamType(0)->getPrimitiveID() == Type::PointerTyID,
+ Assert1(ParamType->getPrimitiveID() == Type::PointerTyID,
"First argument not a pointer!", IF);
"First argument not a pointer!", IF);
+ Assert1(((dyn_cast<PointerType>(ParamType)->getContainedType(0)) == ReturnType), "Pointer type doesn't match return type!", IF);
case Intrinsic::setjmp: NumArgs = 1; break;
case Intrinsic::longjmp: NumArgs = 2; break;
case Intrinsic::setjmp: NumArgs = 1; break;
case Intrinsic::longjmp: NumArgs = 2; break;