aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ModuleSummaryIndex.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/lib/IR/ModuleSummaryIndex.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/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r--llvm/lib/IR/ModuleSummaryIndex.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp
index 3e82987..2d14407 100644
--- a/llvm/lib/IR/ModuleSummaryIndex.cpp
+++ b/llvm/lib/IR/ModuleSummaryIndex.cpp
@@ -570,8 +570,7 @@ void ModuleSummaryIndex::exportToDot(
" [color=brown]; // call (hotness : Hot)",
" [style=bold,color=red]; // call (hotness : Critical)"};
- assert(static_cast<size_t>(TypeOrHotness) <
- sizeof(EdgeAttrs) / sizeof(EdgeAttrs[0]));
+ assert(static_cast<size_t>(TypeOrHotness) < std::size(EdgeAttrs));
OS << Pfx << NodeId(SrcMod, SrcId) << " -> " << NodeId(DstMod, DstId)
<< EdgeAttrs[TypeOrHotness] << "\n";
};