summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Hahn <florian.hahn@arm.com>2017-10-21 05:37:10 +0000
committerFlorian Hahn <florian.hahn@arm.com>2017-10-21 05:37:10 +0000
commitb0a263cf94a87db97addde56d3e7005eb686f2c3 (patch)
tree6044df5bc39a751b41ff9edbb71af87ca104a98b
parent3d81254b7c3b78a77b5c7ffe15fcaf90cd8894b1 (diff)
downloadbcm5719-llvm-b0a263cf94a87db97addde56d3e7005eb686f2c3.tar.gz
bcm5719-llvm-b0a263cf94a87db97addde56d3e7005eb686f2c3.zip
[SelectionDAG] Use dyn_cast without cast.
llvm-svn: 316258
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 63f9198d594..b6e3efe60c2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -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();
}
OpenPOWER on IntegriCloud