diff options
author | Joe Loser <joeloser@fastmail.com> | 2022-09-06 18:06:58 -0600 |
---|---|---|
committer | Joe Loser <joeloser@fastmail.com> | 2022-09-08 09:01:53 -0600 |
commit | 5e96cea1db0623a833d5376c9ea2ce4528771f97 (patch) | |
tree | 7949b48788ad2e39d81d601464cdd2bb6f5c9e20 /llvm/lib/Target/XCore | |
parent | 7aec9ddcfd20dc241a37f862b20dddbb8a4efb2f (diff) | |
download | llvm-5e96cea1db0623a833d5376c9ea2ce4528771f97.zip llvm-5e96cea1db0623a833d5376c9ea2ce4528771f97.tar.gz llvm-5e96cea1db0623a833d5376c9ea2ce4528771f97.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Target/XCore')
-rw-r--r-- | llvm/lib/Target/XCore/XCoreISelLowering.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/XCore/XCoreISelLowering.cpp b/llvm/lib/Target/XCore/XCoreISelLowering.cpp index 7585321..84b74c9 100644 --- a/llvm/lib/Target/XCore/XCoreISelLowering.cpp +++ b/llvm/lib/Target/XCore/XCoreISelLowering.cpp @@ -1345,11 +1345,11 @@ SDValue XCoreTargetLowering::LowerCCCArguments( }; XCoreFunctionInfo *XFI = MF.getInfo<XCoreFunctionInfo>(); unsigned FirstVAReg = CCInfo.getFirstUnallocated(ArgRegs); - if (FirstVAReg < array_lengthof(ArgRegs)) { + if (FirstVAReg < std::size(ArgRegs)) { int offset = 0; // Save remaining registers, storing higher register numbers at a higher // address - for (int i = array_lengthof(ArgRegs) - 1; i >= (int)FirstVAReg; --i) { + for (int i = std::size(ArgRegs) - 1; i >= (int)FirstVAReg; --i) { // Create a stack slot int FI = MFI.CreateFixedObject(4, offset, true); if (i == (int)FirstVAReg) { |