[llvm-commits] [llvm] r47922 - /llvm/trunk/lib/VMCore/Verifier.cpp

Devang Patel dpatel at apple.com
Tue Mar 4 16:27:05 PST 2008


Author: dpatel
Date: Tue Mar  4 18:27:05 2008
New Revision: 47922

URL: http://llvm.org/viewvc/llvm-project?rev=47922&view=rev
Log:
Check struct return type first. 

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=47922&r1=47921&r2=47922&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Mar  4 18:27:05 2008
@@ -581,18 +581,19 @@
     Assert2(F->getReturnType() == Type::VoidTy,
             "Found return instr that returns void in Function of non-void "
             "return type!", &RI, F->getReturnType());
-  else if (N == 1)
-    Assert2(F->getReturnType() == RI.getOperand(0)->getType(),
-            "Function return type does not match operand "
-            "type of return inst!", &RI, F->getReturnType());
   else if (const StructType *STy = dyn_cast<StructType>(F->getReturnType())) {
     for (unsigned i = 0; i < N; i++)
       Assert2(STy->getElementType(i) == RI.getOperand(i)->getType(),
               "Function return type does not match operand "
               "type of return inst!", &RI, F->getReturnType());
-  } else
+  } 
+  else if (N == 1) 
+    Assert2(F->getReturnType() == RI.getOperand(0)->getType(),
+            "Function return type does not match operand "
+            "type of return inst!", &RI, F->getReturnType());
+  else
     Assert1(0, "Invalid return type!", &RI);
-
+  
   // Check to make sure that the return value has necessary properties for
   // terminators...
   visitTerminatorInst(RI);





More information about the llvm-commits mailing list