From f32831c4e98d82c69203eb7a80ce820f415f4146 Mon Sep 17 00:00:00 2001 From: Amara Emerson Date: Mon, 7 Dec 2020 12:47:28 -0800 Subject: [PATCH] [AArch64] Fix some minor coding style issues in AArch64CompressJumpTables --- lib/Target/AArch64/AArch64CompressJumpTables.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Target/AArch64/AArch64CompressJumpTables.cpp b/lib/Target/AArch64/AArch64CompressJumpTables.cpp index 57dc8a4061f..c265592d05a 100644 --- a/lib/Target/AArch64/AArch64CompressJumpTables.cpp +++ b/lib/Target/AArch64/AArch64CompressJumpTables.cpp @@ -59,7 +59,7 @@ public: } }; char AArch64CompressJumpTables::ID = 0; -} +} // namespace INITIALIZE_PASS(AArch64CompressJumpTables, DEBUG_TYPE, "AArch64 compress jump tables pass", false, false) @@ -104,7 +104,7 @@ bool AArch64CompressJumpTables::compressJumpTable(MachineInstr &MI, int MaxOffset = std::numeric_limits::min(), MinOffset = std::numeric_limits::max(); MachineBasicBlock *MinBlock = nullptr; - for (auto Block : JT.MBBs) { + for (auto *Block : JT.MBBs) { int BlockOffset = BlockInfo[Block->getNumber()]; assert(BlockOffset % 4 == 0 && "misaligned basic block"); @@ -124,13 +124,14 @@ bool AArch64CompressJumpTables::compressJumpTable(MachineInstr &MI, } int Span = MaxOffset - MinOffset; - auto AFI = MF->getInfo(); + auto *AFI = MF->getInfo(); if (isUInt<8>(Span / 4)) { AFI->setJumpTableEntryInfo(JTIdx, 1, MinBlock->getSymbol()); MI.setDesc(TII->get(AArch64::JumpTableDest8)); ++NumJT8; return true; - } else if (isUInt<16>(Span / 4)) { + } + if (isUInt<16>(Span / 4)) { AFI->setJumpTableEntryInfo(JTIdx, 2, MinBlock->getSymbol()); MI.setDesc(TII->get(AArch64::JumpTableDest16)); ++NumJT16;