From 3ac828b8f7a848ab1d801fcacc515b51a9cb684a Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 23 Jul 2020 14:53:18 -0700 Subject: [PATCH] Use llvm::size rather than an empty loop to get the number of top level loops. --- llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp index 3db108c94985..b6ff27dcaf55 100644 --- a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp +++ b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp @@ -53,9 +53,7 @@ FunctionPropertiesInfo::getFunctionPropertiesInfo(const Function &F, if (FPI.MaxLoopDepth < LoopDepth) FPI.MaxLoopDepth = LoopDepth; } - for (Loop *L : LI) { - ++FPI.TopLevelLoopCount; - } + FPI.TopLevelLoopCount += llvm::size(LI); return FPI; }