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/unittests/ProfileData/CoverageMappingTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/unittests/ProfileData/CoverageMappingTest.cpp') diff --git a/llvm/unittests/ProfileData/CoverageMappingTest.cpp b/llvm/unittests/ProfileData/CoverageMappingTest.cpp index e04265e..2791f678 100644 --- a/llvm/unittests/ProfileData/CoverageMappingTest.cpp +++ b/llvm/unittests/ProfileData/CoverageMappingTest.cpp @@ -292,7 +292,7 @@ TEST_P(CoverageMappingTest, basic_write_read) { TEST_P(CoverageMappingTest, correct_deserialize_for_more_than_two_files) { const char *FileNames[] = {"bar", "baz", "foo"}; - static const unsigned N = array_lengthof(FileNames); + static const unsigned N = std::size(FileNames); startFunction("func", 0x1234); for (unsigned I = 0; I < N; ++I) @@ -321,7 +321,7 @@ TEST_P(CoverageMappingTest, load_coverage_for_more_than_two_files) { ProfileWriter.addRecord({"func", 0x1234, {0}}, Err); const char *FileNames[] = {"bar", "baz", "foo"}; - static const unsigned N = array_lengthof(FileNames); + static const unsigned N = std::size(FileNames); startFunction("func", 0x1234); for (unsigned I = 0; I < N; ++I) -- cgit v1.1