[llvm] r254383 - Use array_lengthof instead of manually calculating it. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 30 22:13:06 PST 2015
Author: ctopper
Date: Tue Dec 1 00:13:06 2015
New Revision: 254383
URL: http://llvm.org/viewvc/llvm-project?rev=254383&view=rev
Log:
Use array_lengthof instead of manually calculating it. NFC
Modified:
llvm/trunk/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp
Modified: llvm/trunk/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp?rev=254383&r1=254382&r2=254383&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp Tue Dec 1 00:13:06 2015
@@ -568,7 +568,7 @@ static DecodeStatus DecodeCtrRegsRegiste
Hexagon::CS0, Hexagon::CS1, Hexagon::UPCL, Hexagon::UPC
};
- if (RegNo >= sizeof(CtrlRegDecoderTable) / sizeof(CtrlRegDecoderTable[0]))
+ if (RegNo >= array_lengthof(CtrlRegDecoderTable))
return MCDisassembler::Fail;
if (CtrlRegDecoderTable[RegNo] == Hexagon::NoRegister)
@@ -592,7 +592,7 @@ static DecodeStatus DecodeCtrRegs64Regis
Hexagon::UPC, Hexagon::NoRegister
};
- if (RegNo >= sizeof(CtrlReg64DecoderTable) / sizeof(CtrlReg64DecoderTable[0]))
+ if (RegNo >= array_lengthof(CtrlReg64DecoderTable))
return MCDisassembler::Fail;
if (CtrlReg64DecoderTable[RegNo] == Hexagon::NoRegister)
More information about the llvm-commits
mailing list