Skip to content

Commit

Permalink
PassWrapper: update for LLVM change D102093
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
durin42 committed May 17, 2021
1 parent c825bc4 commit 445658b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,16 +789,23 @@ LLVMRustOptimizeWithNewPassManager(
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);
#else
PassBuilder PB(TM, PTO, PGOOpt, &PIC);
#endif

#if LLVM_VERSION_GE(13, 0)
LoopAnalysisManager LAM;
FunctionAnalysisManager FAM;
CGSCCAnalysisManager CGAM;
ModuleAnalysisManager MAM;
#else
LoopAnalysisManager LAM(DebugPassManager);
FunctionAnalysisManager FAM(DebugPassManager);
CGSCCAnalysisManager CGAM(DebugPassManager);
ModuleAnalysisManager MAM(DebugPassManager);
#endif

FAM.registerPass([&] { return PB.buildDefaultAAPipeline(); });

Expand Down Expand Up @@ -935,7 +942,11 @@ LLVMRustOptimizeWithNewPassManager(
}
}

#if LLVM_VERSION_GE(13, 0)
ModulePassManager MPM;
#else
ModulePassManager MPM(DebugPassManager);
#endif
bool NeedThinLTOBufferPasses = UseThinLTOBuffers;
if (!NoPrepopulatePasses) {
if (OptLevel == PassBuilder::OptimizationLevel::O0) {
Expand Down

0 comments on commit 445658b

Please sign in to comment.