]> granicus.if.org Git - llvm/commitdiff
[SelectionDAG] Use dyn_cast without cast.
authorFlorian Hahn <florian.hahn@arm.com>
Sat, 21 Oct 2017 05:37:10 +0000 (05:37 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Sat, 21 Oct 2017 05:37:10 +0000 (05:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316258 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 63f9198d594233d6e9f581721deddc913e4846d9..b6e3efe60c2e30053db837bc8865ba7ae8aafce6 100644 (file)
@@ -2966,8 +2966,8 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
   unsigned Tmp, Tmp2;
   unsigned FirstAnswer = 1;
 
-  if (isa<ConstantSDNode>(Op)) {
-    const APInt &Val = cast<ConstantSDNode>(Op)->getAPIntValue();
+  if (auto *C = dyn_cast<ConstantSDNode>(Op)) {
+    const APInt &Val = C->getAPIntValue();
     return Val.getNumSignBits();
   }