Do not use dyn_cast<> after isa<>
authorMehdi Amini <mehdi.amini@apple.com>
Sun, 23 Aug 2015 00:27:57 +0000 (00:27 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Sun, 23 Aug 2015 00:27:57 +0000 (00:27 +0000)
Reported by coverity.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245799 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 53d07b385e317295baca39a819bb2fb6db378c3e..ab3a6631d3393ffb569189e53d443c792f23e6ef 100644 (file)
@@ -12278,7 +12278,7 @@ static SDValue combineConcatVectorOfExtracts(SDNode *N, SelectionDAG &DAG) {
     EVT ExtVT = ExtVec.getValueType();
     if (!isa<ConstantSDNode>(Op.getOperand(1)))
       return SDValue();
-    int ExtIdx = dyn_cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue();
+    int ExtIdx = cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue();
 
     // Ensure that we are extracting a subvector from a vector the same
     // size as the result.