Skip to content

Commit

Permalink
Rollup merge of rust-lang#132537 - durin42:llvm-20-prelinklto, r=DianQK
Browse files Browse the repository at this point in the history
PassWrapper: adapt for llvm/llvm-project@5445edb5d

As with ab5583e, we had been explicitly passing defaults whose type have changed. Rather than do an ifdef, we simply rely on the defaults.

`@rustbot` label: +llvm-main
  • Loading branch information
workingjubilee authored Nov 3, 2024
2 parents 8260901 + c613122 commit e862ec7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,10 +777,8 @@ extern "C" LLVMRustResult LLVMRustOptimize(
CGSCCAnalysisManager CGAM;
ModuleAnalysisManager MAM;

// FIXME: We may want to expose this as an option.
bool DebugPassManager = false;

StandardInstrumentations SI(TheModule->getContext(), DebugPassManager);
StandardInstrumentations SI(TheModule->getContext(),
/*DebugLogging=*/false);
SI.registerCallbacks(PIC, &MAM);

if (LLVMPluginsLen) {
Expand Down Expand Up @@ -932,8 +930,9 @@ extern "C" LLVMRustResult LLVMRustOptimize(
for (const auto &C : OptimizerLastEPCallbacks)
PB.registerOptimizerLastEPCallback(C);

// Pass false as we manually schedule ThinLTOBufferPasses below.
MPM = PB.buildO0DefaultPipeline(OptLevel, /* PreLinkLTO */ false);
// We manually schedule ThinLTOBufferPasses below, so don't pass the value
// to enable it here.
MPM = PB.buildO0DefaultPipeline(OptLevel);
} else {
for (const auto &C : PipelineStartEPCallbacks)
PB.registerPipelineStartEPCallback(C);
Expand All @@ -942,7 +941,7 @@ extern "C" LLVMRustResult LLVMRustOptimize(

switch (OptStage) {
case LLVMRustOptStage::PreLinkNoLTO:
MPM = PB.buildPerModuleDefaultPipeline(OptLevel, DebugPassManager);
MPM = PB.buildPerModuleDefaultPipeline(OptLevel);
break;
case LLVMRustOptStage::PreLinkThinLTO:
MPM = PB.buildThinLTOPreLinkDefaultPipeline(OptLevel);
Expand Down

0 comments on commit e862ec7

Please sign in to comment.