[llvm] [CodeGen] Port mir-debugify to new pass manager (PR #193201)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 27 07:52:46 PDT 2026
================
@@ -205,6 +211,28 @@ INITIALIZE_PASS_BEGIN(DebugifyMachineModule, DEBUG_TYPE,
INITIALIZE_PASS_END(DebugifyMachineModule, DEBUG_TYPE,
"Machine Debugify Module", false, false)
-ModulePass *llvm::createDebugifyMachineModulePass() {
+ModulePass *llvm::createDebugifyMachineModuleLegacyPass() {
return new DebugifyMachineModule();
}
+
+PreservedAnalyses DebugifyMachineModulePass::run(Module &M,
+ ModuleAnalysisManager &AM) {
+ FunctionAnalysisManager &FAM =
+ AM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
+ const bool Changed = applyDebugifyMetadata(
+ M, M.functions(),
+ "ModuleDebugify: ", [&](DIBuilder &DIB, Function &F) -> bool {
+ return applyDebugifyMetadataToMachineFunction(
+ DIB, F, [&FAM](Function &F) -> MachineFunction * {
+ return &FAM.getResult<MachineFunctionAnalysis>(F).getMF();
----------------
juanvazquez wrote:
Thanks, I've changed it to use `getCachedResult` instead then. Kindly let me know if the result looks good to you.
https://github.com/llvm/llvm-project/pull/193201
More information about the llvm-commits
mailing list