From: Sanjay Patel Date: Tue, 29 Dec 2015 22:00:37 +0000 (+0000) Subject: use auto with dyn_casted values; NFC X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=b9a849eeb89e5858404f1ca256c0e76c306129d1 use auto with dyn_casted values; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256581 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 93ca11bd168..c1032651cde 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -2088,8 +2088,7 @@ TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1, /// node is a GlobalAddress + offset. bool TargetLowering::isGAPlusOffset(SDNode *N, const GlobalValue *&GA, int64_t &Offset) const { - if (isa(N)) { - GlobalAddressSDNode *GASD = cast(N); + if (auto *GASD = dyn_cast(N)) { GA = GASD->getGlobal(); Offset += GASD->getOffset(); return true; @@ -2099,14 +2098,12 @@ bool TargetLowering::isGAPlusOffset(SDNode *N, const GlobalValue *&GA, SDValue N1 = N->getOperand(0); SDValue N2 = N->getOperand(1); if (isGAPlusOffset(N1.getNode(), GA, Offset)) { - ConstantSDNode *V = dyn_cast(N2); - if (V) { + if (auto *V = dyn_cast(N2)) { Offset += V->getSExtValue(); return true; } } else if (isGAPlusOffset(N2.getNode(), GA, Offset)) { - ConstantSDNode *V = dyn_cast(N1); - if (V) { + if (auto *V = dyn_cast(N1)) { Offset += V->getSExtValue(); return true; }