Skip to content

Commit

Permalink
Unrolled build for rust-lang#132537
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#132537 - durin42:llvm-20-prelinklto, r=DianQK

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
rust-timer authored Nov 3, 2024
2 parents 59ae5eb + c613122 commit a7405c0
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 @@ -745,10 +745,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 @@ -900,8 +898,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 @@ -910,7 +909,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 a7405c0

Please sign in to comment.