Skip to content

Commit 2ac4d0f

Browse files
committed
[AArch64] Fix some minor coding style issues in AArch64CompressJumpTables
1 parent a61d508 commit 2ac4d0f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Target/AArch64/AArch64CompressJumpTables.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class AArch64CompressJumpTables : public MachineFunctionPass {
5959
}
6060
};
6161
char AArch64CompressJumpTables::ID = 0;
62-
}
62+
} // namespace
6363

6464
INITIALIZE_PASS(AArch64CompressJumpTables, DEBUG_TYPE,
6565
"AArch64 compress jump tables pass", false, false)
@@ -104,7 +104,7 @@ bool AArch64CompressJumpTables::compressJumpTable(MachineInstr &MI,
104104
int MaxOffset = std::numeric_limits<int>::min(),
105105
MinOffset = std::numeric_limits<int>::max();
106106
MachineBasicBlock *MinBlock = nullptr;
107-
for (auto Block : JT.MBBs) {
107+
for (auto *Block : JT.MBBs) {
108108
int BlockOffset = BlockInfo[Block->getNumber()];
109109
assert(BlockOffset % 4 == 0 && "misaligned basic block");
110110

@@ -124,13 +124,14 @@ bool AArch64CompressJumpTables::compressJumpTable(MachineInstr &MI,
124124
}
125125

126126
int Span = MaxOffset - MinOffset;
127-
auto AFI = MF->getInfo<AArch64FunctionInfo>();
127+
auto *AFI = MF->getInfo<AArch64FunctionInfo>();
128128
if (isUInt<8>(Span / 4)) {
129129
AFI->setJumpTableEntryInfo(JTIdx, 1, MinBlock->getSymbol());
130130
MI.setDesc(TII->get(AArch64::JumpTableDest8));
131131
++NumJT8;
132132
return true;
133-
} else if (isUInt<16>(Span / 4)) {
133+
}
134+
if (isUInt<16>(Span / 4)) {
134135
AFI->setJumpTableEntryInfo(JTIdx, 2, MinBlock->getSymbol());
135136
MI.setDesc(TII->get(AArch64::JumpTableDest16));
136137
++NumJT16;

0 commit comments

Comments
 (0)