Make assertions more consistent with the rest of the intrinsic
authorAlkis Evlogimenos <alkis@evlogimenos.com>
Sun, 13 Jun 2004 00:55:26 +0000 (00:55 +0000)
committerAlkis Evlogimenos <alkis@evlogimenos.com>
Sun, 13 Jun 2004 00:55:26 +0000 (00:55 +0000)
function verification and make it a requirement that both arguments to
llvm.isunordered are of the same type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14165 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Verifier.cpp

index d221de9e65a94c1facce659ab5ebbbbec48d6b40..b832bd117478caf7d26a50a3f2301ee98334f310 100644 (file)
@@ -689,20 +689,24 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
   }
 
   case Intrinsic::isnan:
-    Assert1(FT->getNumParams() == 1 && FT->getParamType(0)->isFloatingPoint(),
-            "Illegal prototype for llvm.isnan", IF);
+    Assert1(FT->getNumParams() == 1,
+            "Illegal # arguments for intrinsic function!", IF);
     Assert1(FT->getReturnType() == Type::BoolTy,
-            "Illegal prototype for llvm.isnan", IF);
+            "Return type is not bool!", IF);
+    Assert1(FT->getParamType(0)->isFloatingPoint(),
+            "Argument is not a floating point type!", IF);
     NumArgs = 1;
     break;
 
   case Intrinsic::isunordered:
-    Assert1(FT->getNumParams() == 2 &&
-            FT->getParamType(0)->isFloatingPoint() &&
-            FT->getParamType(1)->isFloatingPoint(),
-            "Illegal prototype for llvm.isunordered", IF);
+    Assert1(FT->getNumParams() == 2,
+            "Illegal # arguments for intrinsic function!", IF);
     Assert1(FT->getReturnType() == Type::BoolTy,
-            "Illegal prototype for llvm.isunordered", IF);
+            "Return type is not bool!", IF);
+    Assert1(FT->getParamType(0) == FT->getParamType(1),
+            "Arguments must be of the same type!", IF);
+    Assert1(FT->getParamType(0)->isFloatingPoint(),
+            "Argument is not a floating point type!", IF);
     NumArgs = 2;
     break;