From 5e96cea1db0623a833d5376c9ea2ce4528771f97 Mon Sep 17 00:00:00 2001 From: Joe Loser Date: Tue, 6 Sep 2022 18:06:58 -0600 Subject: [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 --- llvm/lib/Object/MachOObjectFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Object/MachOObjectFile.cpp') diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 0b06ec3..16a24d1 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -2329,7 +2329,7 @@ void MachOObjectFile::getRelocationTypeName( "ARM64_RELOC_ADDEND" }; - if (RType >= array_lengthof(Table)) + if (RType >= std::size(Table)) res = "Unknown"; else res = Table[RType]; -- cgit v1.1