Skip to content

Commit 8fcccc6

Browse files
committed
[NewPM][CodeGen] add TargetPassConfig like API
1 parent a46422a commit 8fcccc6

File tree

12 files changed

+326
-251
lines changed

12 files changed

+326
-251
lines changed

llvm/include/llvm/CodeGen/MachinePassManager.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "llvm/ADT/SmallVector.h"
2828
#include "llvm/IR/PassManager.h"
2929
#include "llvm/Support/Error.h"
30+
#include "llvm/Target/CGPassBuilderOption.h"
3031

3132
#include <map>
3233

@@ -143,10 +144,7 @@ class MachineFunctionPassManager
143144
using Base = PassManager<MachineFunction, MachineFunctionAnalysisManager>;
144145

145146
public:
146-
MachineFunctionPassManager(bool RequireCodeGenSCCOrder = false,
147-
bool VerifyMachineFunction = false)
148-
: RequireCodeGenSCCOrder(RequireCodeGenSCCOrder),
149-
VerifyMachineFunction(VerifyMachineFunction) {}
147+
MachineFunctionPassManager() : Opt(getCGPassBuilderOption()) {}
150148
MachineFunctionPassManager(MachineFunctionPassManager &&) = default;
151149
MachineFunctionPassManager &
152150
operator=(MachineFunctionPassManager &&) = default;
@@ -254,10 +252,7 @@ class MachineFunctionPassManager
254252
using PassIndex = decltype(Passes)::size_type;
255253
std::map<PassIndex, llvm::unique_function<FuncTy>> MachineModulePasses;
256254

257-
// Run codegen in the SCC order.
258-
bool RequireCodeGenSCCOrder;
259-
260-
bool VerifyMachineFunction;
255+
CGPassBuilderOption Opt;
261256
};
262257

263258
} // end namespace llvm

0 commit comments

Comments
 (0)