aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ProfileData/InstrProfTest.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-11-26 13:47:32 -0800
committerKazu Hirata <kazu@google.com>2022-11-26 13:47:32 -0800
commit589725f6e803d77adedc3fb5a1cbeaddb99f439a (patch)
tree947cebe2b683e28094d5a224533782f7bc6f5f9a /llvm/unittests/ProfileData/InstrProfTest.cpp
parent25f01d593ce296078f57e872778b77d074ae5888 (diff)
downloadllvm-589725f6e803d77adedc3fb5a1cbeaddb99f439a.zip
llvm-589725f6e803d77adedc3fb5a1cbeaddb99f439a.tar.gz
llvm-589725f6e803d77adedc3fb5a1cbeaddb99f439a.tar.bz2
[llvm] Use std::size (NFC)
std::size, introduced in C++17, allows us to directly obtain the number of elements of an array.
Diffstat (limited to 'llvm/unittests/ProfileData/InstrProfTest.cpp')
-rw-r--r--llvm/unittests/ProfileData/InstrProfTest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/unittests/ProfileData/InstrProfTest.cpp b/llvm/unittests/ProfileData/InstrProfTest.cpp
index aa71afe..cbc04d2 100644
--- a/llvm/unittests/ProfileData/InstrProfTest.cpp
+++ b/llvm/unittests/ProfileData/InstrProfTest.cpp
@@ -1112,7 +1112,7 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_module_test) {
StringRef Funcs[] = {"Gfoo", "Gblah", "Gbar", "Ifoo", "Iblah", "Ibar",
"Pfoo", "Pblah", "Pbar", "Wfoo", "Wblah", "Wbar"};
- for (unsigned I = 0; I < sizeof(Funcs) / sizeof(*Funcs); I++) {
+ for (unsigned I = 0; I < std::size(Funcs); I++) {
Function *F = M->getFunction(Funcs[I]);
ASSERT_TRUE(F != nullptr);
std::string PGOName = getPGOFuncName(*F);