diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-24 19:30:37 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-24 19:30:37 +0000 |
commit | 5611561e99241a65a85fd07af33f07e99a897076 (patch) | |
tree | 30debaff5857cc5e5e84737671b0ebd7784299b1 /llvm/lib/Analysis/CodeMetrics.cpp | |
parent | 57fa135b407fa9e26b7db326330dba3ac26af58f (diff) | |
download | bcm5719-llvm-5611561e99241a65a85fd07af33f07e99a897076.tar.gz bcm5719-llvm-5611561e99241a65a85fd07af33f07e99a897076.zip |
Use all_of to simplify control flow. NFC.
llvm-svn: 251202
Diffstat (limited to 'llvm/lib/Analysis/CodeMetrics.cpp')
-rw-r--r-- | llvm/lib/Analysis/CodeMetrics.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/CodeMetrics.cpp b/llvm/lib/Analysis/CodeMetrics.cpp index 90fddc539dc..4090b4cd752 100644 --- a/llvm/lib/Analysis/CodeMetrics.cpp +++ b/llvm/lib/Analysis/CodeMetrics.cpp @@ -45,14 +45,8 @@ static void completeEphemeralValues(SmallVector<const Value *, 16> &WorkSet, continue; // If all uses of this value are ephemeral, then so is this value. - bool FoundNEUse = false; - for (const User *I : V->users()) - if (!EphValues.count(I)) { - FoundNEUse = true; - break; - } - - if (FoundNEUse) + if (!std::all_of(V->user_begin(), V->user_end(), + [&](const User *U) { return EphValues.count(U); })) continue; EphValues.insert(V); |