[clang] 0d0b901 - Revert "[FIX] Do not copy an llvm::function_ref if it has to be reused"

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 22 19:37:22 PDT 2020


Author: David Blaikie
Date: 2020-03-22T18:43:39-07:00
New Revision: 0d0b90105f92f6cd9cc7004d565834f4429183fb

URL: https://github.com/llvm/llvm-project/commit/0d0b90105f92f6cd9cc7004d565834f4429183fb
DIFF: https://github.com/llvm/llvm-project/commit/0d0b90105f92f6cd9cc7004d565834f4429183fb.diff

LOG: Revert "[FIX] Do not copy an llvm::function_ref if it has to be reused"

This fix doesn't seem to be right (function_ref can/should be passed by
value) so I'm reverted it to see if the buildbots decide to explain
what's wrong.

This reverts commit 857bf5da35af8e1f9425e1865dab5f5fce5e38f2.

Added: 
    

Modified: 
    clang/include/clang/AST/OpenMPClause.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h
index 38485cb1ad7e..548328d36a79 100644
--- a/clang/include/clang/AST/OpenMPClause.h
+++ b/clang/include/clang/AST/OpenMPClause.h
@@ -7060,10 +7060,10 @@ struct OMPTraitInfo {
   llvm::SmallVector<OMPTraitSet, 4> Sets;
 
   bool anyScoreOrCondition(
-      const llvm::function_ref<bool(Expr *&, bool /* IsScore */)> &Cond) {
-    return llvm::any_of(Sets, [&Cond](OMPTraitInfo::OMPTraitSet &Set) {
+      llvm::function_ref<bool(Expr *&, bool /* IsScore */)> Cond) {
+    return llvm::any_of(Sets, [Cond](OMPTraitInfo::OMPTraitSet &Set) {
       return llvm::any_of(
-          Set.Selectors, [&Cond](OMPTraitInfo::OMPTraitSelector &Selector) {
+          Set.Selectors, [Cond](OMPTraitInfo::OMPTraitSelector &Selector) {
             return Cond(Selector.ScoreOrCondition,
                         /* IsScore */ Selector.Kind !=
                             llvm::omp::TraitSelector::user_condition);


        


More information about the cfe-commits mailing list