Author: reid
Date: Mon Jul 23 18:46:43 2007
New Revision: 40455

URL: http://llvm.org/viewvc/llvm-project?rev=40455&view=rev
Log:
1. Make sure we print the Function Value for parameter attribute errors
2. Fold an if statement into the Assert1 macro call.

Modified:
    llvm/trunk/lib/VMCore/Verifier.cpp

Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=40455&r1=40454&r2=40455&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Jul 23 18:46:43 2007
@@ -362,12 +362,12 @@
   if (const ParamAttrsList *Attrs = FT->getParamAttrs()) {
     unsigned Idx = 1;
 
-    Assert(!Attrs->paramHasAttr(0, ParamAttr::ByVal),
-           "Attribute ByVal should not apply to functions!");
-    Assert(!Attrs->paramHasAttr(0, ParamAttr::StructRet),
-           "Attribute SRet should not apply to functions!");
-    Assert(!Attrs->paramHasAttr(0, ParamAttr::InReg),
-           "Attribute SRet should not apply to functions!");
+    Assert1(!Attrs->paramHasAttr(0, ParamAttr::ByVal),
+            "Attribute ByVal should not apply to functions!", &F);
+    Assert1(!Attrs->paramHasAttr(0, ParamAttr::StructRet),
+            "Attribute SRet should not apply to functions!", &F);
+    Assert1(!Attrs->paramHasAttr(0, ParamAttr::InReg),
+            "Attribute SRet should not apply to functions!", &F);
 
     for (FunctionType::param_iterator I = FT->param_begin(), 
          E = FT->param_end(); I != E; ++I, ++Idx) {
@@ -391,10 +391,10 @@
                 "Attribute ByVal should only apply to pointer to structs!", 
&F);
       }
 
-      if (Attrs->paramHasAttr(Idx, ParamAttr::NoReturn))
-        Assert1(0, "Attribute NoReturn should only be applied to function", 
&F);
-      if (Attrs->paramHasAttr(Idx, ParamAttr::NoUnwind))
-        Assert1(0, "Attribute NoUnwind should only be applied to function", 
&F);
+      Assert1(!Attrs->paramHasAttr(Idx, ParamAttr::NoReturn), 
+             "Attribute NoReturn should only be applied to function", &F);
+      Assert1(!Attrs->paramHasAttr(Idx, ParamAttr::NoUnwind),
+             "Attribute NoUnwind should only be applied to function", &F);
     }
   }
 


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to