[llvm] 1b5a605 - [JITLink] Use unique_function rather than std::function for JITLink passes.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 9 20:03:38 PST 2023
Author: Lang Hames
Date: 2023-03-09T20:03:31-08:00
New Revision: 1b5a60511234b28aa05e552bf9d8c609659e060b
URL: https://github.com/llvm/llvm-project/commit/1b5a60511234b28aa05e552bf9d8c609659e060b
DIFF: https://github.com/llvm/llvm-project/commit/1b5a60511234b28aa05e552bf9d8c609659e060b.diff
LOG: [JITLink] Use unique_function rather than std::function for JITLink passes.
Passes aren't expected to be copied, and switching to unique_function allows
them to capture values with move-only types.
Added:
Modified:
llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
index f9d6679ef2427..1123b35a4cd76 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
@@ -1627,7 +1627,7 @@ class SymbolAddressMap {
};
/// A function for mutating LinkGraphs.
-using LinkGraphPassFunction = std::function<Error(LinkGraph &)>;
+using LinkGraphPassFunction = unique_function<Error(LinkGraph &)>;
/// A list of LinkGraph passes.
using LinkGraphPassList = std::vector<LinkGraphPassFunction>;
More information about the llvm-commits
mailing list