diff options
author | Sanjay Patel <spatel@rotateright.com> | 2015-12-29 22:00:37 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2015-12-29 22:00:37 +0000 |
commit | d1d9db588991cf7e4ef1a1e8260e0eba1005cb38 (patch) | |
tree | 14cbec2cef40ac1fab30c511b88089e87fc78a52 /llvm/lib/CodeGen/SelectionDAG | |
parent | e3773d632e74f9dbadd1aeff7f6cfab7411349a7 (diff) | |
download | bcm5719-llvm-d1d9db588991cf7e4ef1a1e8260e0eba1005cb38.tar.gz bcm5719-llvm-d1d9db588991cf7e4ef1a1e8260e0eba1005cb38.zip |
use auto with dyn_casted values; NFC
llvm-svn: 256581
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 93ca11bd168..c1032651cde 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/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<GlobalAddressSDNode>(N)) { - GlobalAddressSDNode *GASD = cast<GlobalAddressSDNode>(N); + if (auto *GASD = dyn_cast<GlobalAddressSDNode>(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<ConstantSDNode>(N2); - if (V) { + if (auto *V = dyn_cast<ConstantSDNode>(N2)) { Offset += V->getSExtValue(); return true; } } else if (isGAPlusOffset(N2.getNode(), GA, Offset)) { - ConstantSDNode *V = dyn_cast<ConstantSDNode>(N1); - if (V) { + if (auto *V = dyn_cast<ConstantSDNode>(N1)) { Offset += V->getSExtValue(); return true; } |