From: Sterling Augustine Date: Sat, 7 Dec 2019 01:09:19 +0000 (-0800) Subject: Move variable only used in an assert into the assert itself. X-Git-Tag: llvmorg-11-init~2699 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa3c877fb58db238a86e734511bdeed9bc40086c;p=platform%2Fupstream%2Fllvm.git Move variable only used in an assert into the assert itself. This prevents unused variable warnings from breaking the build. --- diff --git a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp index d44dbf7..29fa8c0 100644 --- a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp +++ b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp @@ -1010,8 +1010,7 @@ bool AArch64InstructionSelector::selectCompareBranch( /// This needs to detect a splat-like operation, e.g. a G_BUILD_VECTOR. static Optional getVectorShiftImm(Register Reg, MachineRegisterInfo &MRI) { - const LLT Ty = MRI.getType(Reg); - assert(Ty.isVector() && "Expected a *vector* shift operand"); + assert(MRI.getType(Reg).isVector() && "Expected a *vector* shift operand"); MachineInstr *OpMI = MRI.getVRegDef(Reg); assert(OpMI && "Expected to find a vreg def for vector shift operand"); if (OpMI->getOpcode() != TargetOpcode::G_BUILD_VECTOR)