[llvm] [CodeGenPassBuilder] Replace `AnalysisKey` -> `MachinePassKey` (PR #77053)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 4 23:12:08 PST 2024
https://github.com/paperchalice created https://github.com/llvm/llvm-project/pull/77053
Forgot to update them in #75567.
>From 2df04d6e19c49d253287f1eb57bbd4e8d84b6de6 Mon Sep 17 00:00:00 2001
From: PaperChalice <liujunchang97 at outlook.com>
Date: Fri, 5 Jan 2024 15:10:01 +0800
Subject: [PATCH] [CodeGenPassBuilder] Replace `AnalysisKey` ->
`MachinePassKey`
Forgot to update them in #75567
---
llvm/include/llvm/CodeGen/CodeGenPassBuilder.h | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h b/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h
index 32d6e5f91f7b09..cc1c0254bb541b 100644
--- a/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h
+++ b/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h
@@ -229,25 +229,27 @@ template <typename DerivedT> class CodeGenPassBuilder {
C(&PassT::Key);
}
- template <typename PassT> void insertPass(AnalysisKey *ID, PassT Pass) {
+ template <typename PassT> void insertPass(MachinePassKey *ID, PassT Pass) {
AfterCallbacks.emplace_back(
- [this, ID, Pass = std::move(Pass)](AnalysisKey *PassID) {
+ [this, ID, Pass = std::move(Pass)](MachinePassKey *PassID) {
if (PassID == ID)
this->PM.addPass(std::move(Pass));
});
}
- void disablePass(AnalysisKey *ID) {
+ void disablePass(MachinePassKey *ID) {
BeforeCallbacks.emplace_back(
- [ID](AnalysisKey *PassID) { return PassID != ID; });
+ [ID](MachinePassKey *PassID) { return PassID != ID; });
}
MachineFunctionPassManager releasePM() { return std::move(PM); }
private:
MachineFunctionPassManager &PM;
- SmallVector<llvm::unique_function<bool(AnalysisKey *)>, 4> BeforeCallbacks;
- SmallVector<llvm::unique_function<void(AnalysisKey *)>, 4> AfterCallbacks;
+ SmallVector<llvm::unique_function<bool(MachinePassKey *)>, 4>
+ BeforeCallbacks;
+ SmallVector<llvm::unique_function<void(MachinePassKey *)>, 4>
+ AfterCallbacks;
};
LLVMTargetMachine &TM;
More information about the llvm-commits
mailing list