================ @@ -68,9 +68,9 @@ class PatternApplicator { /// invalidate the match and try another pattern. LogicalResult matchAndRewrite(Operation *op, PatternRewriter &rewriter, - function_ref<bool(const Pattern &)> canApply = {}, - function_ref<void(const Pattern &)> onFailure = {}, - function_ref<LogicalResult(const Pattern &)> onSuccess = {}); + std::function<bool(const Pattern &)> canApply = {}, + std::function<void(const Pattern &)> onFailure = {}, + std::function<LogicalResult(const Pattern &)> onSuccess = {}); ---------------- joker-eph wrote:
> What are you referring to with this function? Where this comment thread is anchored: `matchAndRewrite` > The problem here is really just caused by the fact that the canApply = > assignment is inside of a nested scope. And the lambda object is dead by the > time matcher.matchAndRewrite is called. I.e., the canApply function_ref > points to an already free'd lambda. At least that's my understanding. Yes, but that's a problem for the call-site, I don't quite see where you make the connection to the signature of `matchAndRewrite`? https://github.com/llvm/llvm-project/pull/84131 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits