Skip to content

Commit 8334cdd

Browse files
committed
[NFC] Don't pass redundant arguments
Some parameters were already part of the Config passed in.
1 parent bac1f12 commit 8334cdd

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

llvm/lib/LTO/LTOBackend.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -289,17 +289,15 @@ static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM,
289289
}
290290

291291
static void runNewPMCustomPasses(const Config &Conf, Module &Mod,
292-
TargetMachine *TM, std::string PipelineDesc,
293-
std::string AAPipelineDesc,
294-
bool DisableVerify) {
292+
TargetMachine *TM) {
295293
PassBuilder PB(Conf.DebugPassManager, TM);
296294
AAManager AA;
297295

298296
// Parse a custom AA pipeline if asked to.
299-
if (!AAPipelineDesc.empty())
300-
if (auto Err = PB.parseAAPipeline(AA, AAPipelineDesc))
297+
if (!Conf.AAPipeline.empty())
298+
if (auto Err = PB.parseAAPipeline(AA, Conf.AAPipeline))
301299
report_fatal_error("unable to parse AA pipeline description '" +
302-
AAPipelineDesc + "': " + toString(std::move(Err)));
300+
Conf.AAPipeline + "': " + toString(std::move(Err)));
303301

304302
RegisterPassPlugins(Conf.PassPlugins, PB);
305303

@@ -330,11 +328,11 @@ static void runNewPMCustomPasses(const Config &Conf, Module &Mod,
330328
MPM.addPass(VerifierPass());
331329

332330
// Now, add all the passes we've been requested to.
333-
if (auto Err = PB.parsePassPipeline(MPM, PipelineDesc))
331+
if (auto Err = PB.parsePassPipeline(MPM, Conf.OptPipeline))
334332
report_fatal_error("unable to parse pass pipeline description '" +
335-
PipelineDesc + "': " + toString(std::move(Err)));
333+
Conf.OptPipeline + "': " + toString(std::move(Err)));
336334

337-
if (!DisableVerify)
335+
if (!Conf.DisableVerify)
338336
MPM.addPass(VerifierPass());
339337
MPM.run(Mod, MAM);
340338
}
@@ -395,8 +393,7 @@ bool lto::opt(const Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod,
395393
}
396394
// FIXME: Plumb the combined index into the new pass manager.
397395
if (!Conf.OptPipeline.empty())
398-
runNewPMCustomPasses(Conf, Mod, TM, Conf.OptPipeline, Conf.AAPipeline,
399-
Conf.DisableVerify);
396+
runNewPMCustomPasses(Conf, Mod, TM);
400397
else if (Conf.UseNewPM)
401398
runNewPMPasses(Conf, Mod, TM, Conf.OptLevel, IsThinLTO, ExportSummary,
402399
ImportSummary);

0 commit comments

Comments
 (0)