Take Bill Wendling's suggestion for structuring a couple of asserts.
authorMatt Beaumont-Gay <matthewbg@google.com>
Tue, 1 Feb 2011 22:12:50 +0000 (22:12 +0000)
committerMatt Beaumont-Gay <matthewbg@google.com>
Tue, 1 Feb 2011 22:12:50 +0000 (22:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124688 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index d14cae39192358be7c7eed432e001be8ca17b40c..f3994b76cb6bb473d643a1bbc01834f5f03c091e 100644 (file)
@@ -2874,9 +2874,9 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT,
       assert(VT.getSimpleVT() <= N1.getValueType().getSimpleVT() &&
              "Extract subvector must be from larger vector to smaller vector!");
 
-      if (ConstantSDNode *CSD = dyn_cast<ConstantSDNode>(Index.getNode())) {
-        (void)CSD;
-        assert((VT.getVectorNumElements() + CSD->getZExtValue()
+      if (isa<ConstantSDNode>(Index.getNode())) {
+        assert((VT.getVectorNumElements() +
+                cast<ConstantSDNode>(Index.getNode())->getZExtValue()
                 <= N1.getValueType().getVectorNumElements())
                && "Extract subvector overflow!");
       }
@@ -3093,9 +3093,9 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT,
              "Dest and insert subvector source types must match!");
       assert(N2.getValueType().getSimpleVT() <= N1.getValueType().getSimpleVT() &&
              "Insert subvector must be from smaller vector to larger vector!");
-      if (ConstantSDNode *CSD = dyn_cast<ConstantSDNode>(Index.getNode())) {
-        (void)CSD;
-        assert((N2.getValueType().getVectorNumElements() + CSD->getZExtValue()
+      if (isa<ConstantSDNode>(Index.getNode())) {
+        assert((N2.getValueType().getVectorNumElements() +
+                cast<ConstantSDNode>(Index.getNode())->getZExtValue()
                 <= VT.getVectorNumElements())
                && "Insert subvector overflow!");
       }