From 589725f6e803d77adedc3fb5a1cbeaddb99f439a Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 26 Nov 2022 13:47:32 -0800 Subject: [llvm] Use std::size (NFC) std::size, introduced in C++17, allows us to directly obtain the number of elements of an array. --- llvm/lib/IR/ModuleSummaryIndex.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp') 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(TypeOrHotness) < - sizeof(EdgeAttrs) / sizeof(EdgeAttrs[0])); + assert(static_cast(TypeOrHotness) < std::size(EdgeAttrs)); OS << Pfx << NodeId(SrcMod, SrcId) << " -> " << NodeId(DstMod, DstId) << EdgeAttrs[TypeOrHotness] << "\n"; }; -- cgit v1.1