Rollup merge of #132537 - durin42:llvm-20-prelinklto, r=DianQK

PassWrapper: adapt for llvm/llvm-project@5445edb5d

As with ab5583ed1e, 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
This commit is contained in:
Matthias Krüger 2024-11-03 12:08:55 +01:00 committed by GitHub
commit 7d7f2b5e2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) {
@ -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);
@ -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);