[llvm-commits] [llvm] r134968 - /llvm/trunk/lib/VMCore/Constants.cpp

Chris Lattner sabre at nondot.org
Mon Jul 11 22:26:21 PDT 2011


Author: lattner
Date: Tue Jul 12 00:26:21 2011
New Revision: 134968

URL: http://llvm.org/viewvc/llvm-project?rev=134968&view=rev
Log:
simplify assertions to not be completely redundant.

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

Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=134968&r1=134967&r2=134968&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Tue Jul 12 00:26:21 2011
@@ -1716,26 +1716,13 @@
 
 Constant *ConstantExpr::getInsertValue(Constant *Agg, Constant *Val,
                                      const unsigned *Idxs, unsigned NumIdx) {
-  assert(Agg->getType()->isFirstClassType() &&
-         "Tried to create insertelement operation on non-first-class type!");
-
-  const Type *ReqTy = Agg->getType();
-  (void)ReqTy;
-#ifndef NDEBUG
-  const Type *ValTy =
-    ExtractValueInst::getIndexedType(Agg->getType(), Idxs, Idxs+NumIdx);
-  assert(ValTy == Val->getType() && "insertvalue indices invalid!");
-#endif
-
   assert(ExtractValueInst::getIndexedType(Agg->getType(), Idxs,
                                           Idxs+NumIdx) == Val->getType() &&
          "insertvalue indices invalid!");
-  assert(Agg->getType() == ReqTy &&
-         "insertvalue type invalid!");
   assert(Agg->getType()->isFirstClassType() &&
-         "Non-first-class type for constant InsertValue expression");
+         "Non-first-class type for constant insertvalue expression");
   Constant *FC = ConstantFoldInsertValueInstruction(Agg, Val, Idxs, NumIdx);
-  assert(FC && "InsertValue constant expr couldn't be folded!");
+  assert(FC && "insertvalue constant expr couldn't be folded!");
   return FC;
 }
 





More information about the llvm-commits mailing list