[llvm] [CodeGen] Port mir-strip-debug to new pass manager (PR #190738)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 7 13:00:14 PDT 2026
================
@@ -103,6 +123,21 @@ INITIALIZE_PASS_BEGIN(StripDebugMachineModule, DEBUG_TYPE,
INITIALIZE_PASS_END(StripDebugMachineModule, DEBUG_TYPE,
"Machine Strip Debug Module", false, false)
-ModulePass *llvm::createStripDebugMachineModulePass(bool OnlyDebugified) {
+ModulePass *llvm::createStripDebugMachineModulePassLegacy(bool OnlyDebugified) {
return new StripDebugMachineModule(OnlyDebugified);
}
+
+PreservedAnalyses StripDebugMachineModulePass::run(Module &M,
+ ModuleAnalysisManager &AM) {
+ FunctionAnalysisManager &FAM =
+ AM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
+ bool Changed = stripDebugMachineModuleImpl(M, FAM, OnlyDebugifiedDefault);
+ if (!Changed) {
+ return PreservedAnalyses::all();
+ }
+
+ PreservedAnalyses PA;
+ PA.preserveSet<AllAnalysesOn<Module>>();
----------------
boomanaiden154 wrote:
`PA.preserve<MachineModuleInfoAnalysis>` or something similar should work.
https://github.com/llvm/llvm-project/pull/190738
More information about the llvm-commits
mailing list