aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2020-07-23 14:53:18 -0700
committerEric Christopher <echristo@gmail.com>2020-07-23 14:55:50 -0700
commit3ac828b8f7a848ab1d801fcacc515b51a9cb684a (patch)
tree34c68e4dc47e5c6fe9b3696a2321c2e32a8c4fe5 /llvm/lib
parent1d09ecf36175f7910ffedd6d497c07b5c74c22fb (diff)
downloadllvm-3ac828b8f7a848ab1d801fcacc515b51a9cb684a.zip
llvm-3ac828b8f7a848ab1d801fcacc515b51a9cb684a.tar.gz
llvm-3ac828b8f7a848ab1d801fcacc515b51a9cb684a.tar.bz2
Use llvm::size rather than an empty loop to get the number of top
level loops.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
index 3db108c..b6ff27d 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;
}