<div dir="ltr">"a problem" seems a smidge vague - was there a specific explanation for the kind of problem that was signalled? Or was this fix a bit of a shot in the dark?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 15, 2020 at 10:55 PM Johannes Doerfert via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Johannes Doerfert<br>
Date: 2020-02-16T00:51:11-06:00<br>
New Revision: 857bf5da35af8e1f9425e1865dab5f5fce5e38f2<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/857bf5da35af8e1f9425e1865dab5f5fce5e38f2" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/857bf5da35af8e1f9425e1865dab5f5fce5e38f2</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/857bf5da35af8e1f9425e1865dab5f5fce5e38f2.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/857bf5da35af8e1f9425e1865dab5f5fce5e38f2.diff</a><br>
<br>
LOG: [FIX] Do not copy an llvm::function_ref if it has to be reused<br>
<br>
Some buildbots signaled a problem in this method when the<br>
llvm::function_ref was copied and reused after 1228d42ddab8. To<br>
eliminate the problem we avoid copying the llvm::function_ref and<br>
instead we pass it as a const reference.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    clang/include/clang/AST/OpenMPClause.h<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h<br>
index a3831fd5950f..453c068bbeb0 100644<br>
--- a/clang/include/clang/AST/OpenMPClause.h<br>
+++ b/clang/include/clang/AST/OpenMPClause.h<br>
@@ -6682,10 +6682,10 @@ struct OMPTraitInfo {<br>
   llvm::SmallVector<OMPTraitSet, 4> Sets;<br>
<br>
   bool anyScoreOrCondition(<br>
-      llvm::function_ref<bool(Expr *&, bool /* IsScore */)> Cond) {<br>
-    return llvm::any_of(Sets, [Cond](OMPTraitInfo::OMPTraitSet &Set) {<br>
+      const llvm::function_ref<bool(Expr *&, bool /* IsScore */)> &Cond) {<br>
+    return llvm::any_of(Sets, [&Cond](OMPTraitInfo::OMPTraitSet &Set) {<br>
       return llvm::any_of(<br>
-          Set.Selectors, [Cond](OMPTraitInfo::OMPTraitSelector &Selector) {<br>
+          Set.Selectors, [&Cond](OMPTraitInfo::OMPTraitSelector &Selector) {<br>
             return Cond(Selector.ScoreOrCondition,<br>
                         /* IsScore */ Selector.Kind !=<br>
                             llvm::omp::TraitSelector::user_condition);<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>