simplify assertions to not be completely redundant.
authorChris Lattner <sabre@nondot.org>
Tue, 12 Jul 2011 05:26:21 +0000 (05:26 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 12 Jul 2011 05:26:21 +0000 (05:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134968 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Constants.cpp

index 57498b485921dd3c004ade3ea55b76187857b67b..f29afa7980e0293136c8308c8d192554ad85d7d0 100644 (file)
@@ -1716,26 +1716,13 @@ Constant *ConstantExpr::getShuffleVector(Constant *V1, Constant *V2,
 
 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;
 }