[llvm] Use std::size instead of llvm::array_lengthof
authorJoe Loser <joeloser@fastmail.com>
Wed, 7 Sep 2022 00:06:58 +0000 (18:06 -0600)
committerJoe Loser <joeloser@fastmail.com>
Thu, 8 Sep 2022 15:01:53 +0000 (09:01 -0600)
commit5e96cea1db0623a833d5376c9ea2ce4528771f97
tree7949b48788ad2e39d81d601464cdd2bb6f5c9e20
parent7aec9ddcfd20dc241a37f862b20dddbb8a4efb2f
[llvm] Use std::size instead of llvm::array_lengthof

LLVM contains a helpful function for getting the size of a C-style
array: `llvm::array_lengthof`. This is useful prior to C++17, but not as
helpful for C++17 or later: `std::size` already has support for C-style
arrays.

Change call sites to use `std::size` instead.

Differential Revision: https://reviews.llvm.org/D133429
69 files changed:
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
llvm/lib/CodeGen/TargetLoweringBase.cpp
llvm/lib/DWP/DWP.cpp
llvm/lib/IR/DebugInfoMetadata.cpp
llvm/lib/MC/MCAsmBackend.cpp
llvm/lib/MC/MCDwarf.cpp
llvm/lib/Object/MachOObjectFile.cpp
llvm/lib/Support/ARMAttributeParser.cpp
llvm/lib/Support/CrashRecoveryContext.cpp
llvm/lib/Support/NativeFormatting.cpp
llvm/lib/Support/Triple.cpp
llvm/lib/Support/Unix/Signals.inc
llvm/lib/Support/Windows/Path.inc
llvm/lib/Support/Windows/Signals.inc
llvm/lib/Support/X86TargetParser.cpp
llvm/lib/Support/raw_ostream.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AMDGPU/AMDGPULibFunc.cpp
llvm/lib/Target/AMDGPU/R600RegisterInfo.cpp
llvm/lib/Target/ARC/ARCISelLowering.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/lib/Target/ARM/ARMFrameLowering.cpp
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/lib/Target/ARM/Thumb2SizeReduction.cpp
llvm/lib/Target/AVR/AVRISelLowering.cpp
llvm/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp
llvm/lib/Target/Hexagon/HexagonFrameLowering.h
llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp
llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.cpp
llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
llvm/lib/Target/MSP430/MCTargetDesc/MSP430AsmBackend.cpp
llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp
llvm/lib/Target/Mips/Mips16ISelLowering.cpp
llvm/lib/Target/PowerPC/PPCCallingConv.cpp
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp
llvm/lib/Target/VE/VEFrameLowering.h
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/XCore/XCoreISelLowering.cpp
llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
llvm/lib/Transforms/Utils/MetaRenamer.cpp
llvm/tools/llvm-objdump/COFFDump.cpp
llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
llvm/tools/llvm-readobj/ELFDumper.cpp
llvm/unittests/ADT/APFloatTest.cpp
llvm/unittests/ADT/StringRefTest.cpp
llvm/unittests/ADT/TinyPtrVectorTest.cpp
llvm/unittests/ProfileData/CoverageMappingTest.cpp
llvm/unittests/Support/BinaryStreamTest.cpp
llvm/unittests/Support/CSKYTargetParserTest.cpp
llvm/unittests/Support/CommandLineTest.cpp
llvm/unittests/Support/FormatVariadicTest.cpp
llvm/unittests/Support/TargetParserTest.cpp
llvm/utils/KillTheDoctor/KillTheDoctor.cpp
llvm/utils/TableGen/AsmWriterEmitter.cpp
llvm/utils/TableGen/CodeGenTarget.cpp
llvm/utils/TableGen/RegisterInfoEmitter.cpp
llvm/utils/TableGen/X86DisassemblerTables.cpp