[llvm] [MCA] use std::function instead of function_ref when storing (PR #91039)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon May 6 10:54:56 PDT 2024
https://github.com/dwblaikie approved this pull request.
Let's fix the correctness issue/API subtlety first (function_ref isn't guaranteed to work in this way, even if the caller is very careful about preserving the functor for the lifetime of the object)
It'd be pretty easy for callers to get cleaned up/have the functors inlined into the call sites, etc, and break this code.
Some other tool should be created/used if there's a need for a lightweight functor reference that can be preserved in a longer-term situation like this.
https://github.com/llvm/llvm-project/pull/91039
More information about the llvm-commits
mailing list