Auto merge of #85416 - durin42:llvm-catchup-may-2021, r=nagisa

PassWrapper: update for LLVM change D102093

In https://reviews.llvm.org/D102093 lots of things stopped taking the
DebugLogging boolean parameter. Mercifully we appear to always set
DebugPassManager to false, so I don't think we're losing anything by not
passing this parameter.
This commit is contained in:
bors 2021-05-21 11:21:06 +00:00
commit fc81ad22c4

View File

@ -793,16 +793,23 @@ LLVMRustOptimizeWithNewPassManager(
PGOOpt = PGOOptions(PGOUsePath, "", "", PGOOptions::IRUse); PGOOpt = PGOOptions(PGOUsePath, "", "", PGOOptions::IRUse);
} }
#if LLVM_VERSION_GE(12, 0) #if LLVM_VERSION_GE(12, 0) && !LLVM_VERSION_GE(13,0)
PassBuilder PB(DebugPassManager, TM, PTO, PGOOpt, &PIC); PassBuilder PB(DebugPassManager, TM, PTO, PGOOpt, &PIC);
#else #else
PassBuilder PB(TM, PTO, PGOOpt, &PIC); PassBuilder PB(TM, PTO, PGOOpt, &PIC);
#endif #endif
#if LLVM_VERSION_GE(13, 0)
LoopAnalysisManager LAM;
FunctionAnalysisManager FAM;
CGSCCAnalysisManager CGAM;
ModuleAnalysisManager MAM;
#else
LoopAnalysisManager LAM(DebugPassManager); LoopAnalysisManager LAM(DebugPassManager);
FunctionAnalysisManager FAM(DebugPassManager); FunctionAnalysisManager FAM(DebugPassManager);
CGSCCAnalysisManager CGAM(DebugPassManager); CGSCCAnalysisManager CGAM(DebugPassManager);
ModuleAnalysisManager MAM(DebugPassManager); ModuleAnalysisManager MAM(DebugPassManager);
#endif
FAM.registerPass([&] { return PB.buildDefaultAAPipeline(); }); FAM.registerPass([&] { return PB.buildDefaultAAPipeline(); });
@ -956,7 +963,11 @@ LLVMRustOptimizeWithNewPassManager(
} }
} }
#if LLVM_VERSION_GE(13, 0)
ModulePassManager MPM;
#else
ModulePassManager MPM(DebugPassManager); ModulePassManager MPM(DebugPassManager);
#endif
bool NeedThinLTOBufferPasses = UseThinLTOBuffers; bool NeedThinLTOBufferPasses = UseThinLTOBuffers;
if (!NoPrepopulatePasses) { if (!NoPrepopulatePasses) {
if (OptLevel == PassBuilder::OptimizationLevel::O0) { if (OptLevel == PassBuilder::OptimizationLevel::O0) {