[llvm] [NewPM][CodeGen] Let `ModuleToMachineFunctionPassAdaptor` own `MachineModuleInfo` (PR #87226)
Christudasan Devadasan via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 1 08:48:50 PDT 2024
================
@@ -205,8 +205,15 @@ template <typename DerivedT> class CodeGenPassBuilder {
AddMachinePass(ModulePassManager &MPM, const DerivedT &PB)
: MPM(MPM), PB(PB) {}
~AddMachinePass() {
- if (!MFPM.isEmpty())
- MPM.addPass(createModuleToMachineFunctionPassAdaptor(std::move(MFPM)));
+ if (!MFPM.isEmpty()) {
+ if (PB.PB.hasMachineModuleInfoOwnership()) {
----------------
cdevadas wrote:
Why PB.PB here and a few more places below?
https://github.com/llvm/llvm-project/pull/87226
More information about the llvm-commits
mailing list