From d9531a3097559891a4bfa4f3c2e3bba9abc2d43b Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Fri, 19 Feb 2021 12:09:25 +0000 Subject: [PATCH] [RISCV] Address some clang-tidy warnings. NFCI. --- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp index c4636b231db3..95a3144d4455 100644 --- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp @@ -455,7 +455,7 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) { break; } case ISD::Constant: { - auto ConstNode = cast(Node); + auto *ConstNode = cast(Node); if (VT == XLenVT && ConstNode->isNullValue()) { SDValue New = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), DL, RISCV::X0, XLenVT); @@ -1164,14 +1164,14 @@ void RISCVDAGToDAGISel::doPeepholeLoadStoreADDI() { SDValue ImmOperand = Base.getOperand(1); uint64_t Offset2 = N->getConstantOperandVal(OffsetOpIdx); - if (auto Const = dyn_cast(ImmOperand)) { + if (auto *Const = dyn_cast(ImmOperand)) { int64_t Offset1 = Const->getSExtValue(); int64_t CombinedOffset = Offset1 + Offset2; if (!isInt<12>(CombinedOffset)) continue; ImmOperand = CurDAG->getTargetConstant(CombinedOffset, SDLoc(ImmOperand), ImmOperand.getValueType()); - } else if (auto GA = dyn_cast(ImmOperand)) { + } else if (auto *GA = dyn_cast(ImmOperand)) { // If the off1 in (addi base, off1) is a global variable's address (its // low part, really), then we can rely on the alignment of that variable // to provide a margin of safety before off1 can overflow the 12 bits. @@ -1185,7 +1185,7 @@ void RISCVDAGToDAGISel::doPeepholeLoadStoreADDI() { ImmOperand = CurDAG->getTargetGlobalAddress( GA->getGlobal(), SDLoc(ImmOperand), ImmOperand.getValueType(), CombinedOffset, GA->getTargetFlags()); - } else if (auto CP = dyn_cast(ImmOperand)) { + } else if (auto *CP = dyn_cast(ImmOperand)) { // Ditto. Align Alignment = CP->getAlign(); if (Offset2 != 0 && Alignment <= Offset2)