Index: llvm/lib/LTO/LTOBackend.cpp =================================================================== --- llvm/lib/LTO/LTOBackend.cpp +++ llvm/lib/LTO/LTOBackend.cpp @@ -222,7 +222,8 @@ static void runNewPMCustomPasses(Module &Mod, TargetMachine *TM, std::string PipelineDesc, std::string AAPipelineDesc, - bool DisableVerify) { + bool DisableVerify, + bool DebugPassManager) { PassBuilder PB(TM); AAManager AA; @@ -232,10 +233,10 @@ report_fatal_error("unable to parse AA pipeline description '" + AAPipelineDesc + "': " + toString(std::move(Err))); - LoopAnalysisManager LAM; - FunctionAnalysisManager FAM; - CGSCCAnalysisManager CGAM; - ModuleAnalysisManager MAM; + LoopAnalysisManager LAM(DebugPassManager); + FunctionAnalysisManager FAM(DebugPassManager); + CGSCCAnalysisManager CGAM(DebugPassManager); + ModuleAnalysisManager MAM(DebugPassManager); // Register the AA manager first so that our version is the one used. FAM.registerPass([&] { return std::move(AA); }); @@ -247,13 +248,13 @@ PB.registerLoopAnalyses(LAM); PB.crossRegisterProxies(LAM, FAM, CGAM, MAM); - ModulePassManager MPM; + ModulePassManager MPM(DebugPassManager); // Always verify the input. MPM.addPass(VerifierPass()); // Now, add all the passes we've been requested to. - if (auto Err = PB.parsePassPipeline(MPM, PipelineDesc)) + if (auto Err = PB.parsePassPipeline(MPM, PipelineDesc, true, DebugPassManager)) report_fatal_error("unable to parse pass pipeline description '" + PipelineDesc + "': " + toString(std::move(Err))); @@ -299,7 +300,7 @@ // FIXME: Plumb the combined index into the new pass manager. if (!Conf.OptPipeline.empty()) runNewPMCustomPasses(Mod, TM, Conf.OptPipeline, Conf.AAPipeline, - Conf.DisableVerify); + Conf.DisableVerify, Conf.DebugPassManager); else if (Conf.UseNewPM) runNewPMPasses(Conf, Mod, TM, Conf.OptLevel, IsThinLTO, ExportSummary, ImportSummary);