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 53d07b3..ab3a663 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.