@@ -118,6 +118,7 @@ class PipelineTuningOptions {
118118// / of the built-in passes, and those may reference these members during
119119// / construction.
120120class PassBuilder {
121+ bool DebugLogging;
121122 TargetMachine *TM;
122123 PipelineTuningOptions PTO;
123124 Optional<PGOOptions> PGOOpt;
@@ -259,11 +260,10 @@ class PassBuilder {
259260 unsigned getSizeLevel () const { return SizeLevel; }
260261 };
261262
262- explicit PassBuilder (TargetMachine *TM = nullptr ,
263+ explicit PassBuilder (bool DebugLogging = false , TargetMachine *TM = nullptr ,
263264 PipelineTuningOptions PTO = PipelineTuningOptions(),
264265 Optional<PGOOptions> PGOOpt = None,
265- PassInstrumentationCallbacks *PIC = nullptr)
266- : TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC) {}
266+ PassInstrumentationCallbacks *PIC = nullptr);
267267
268268 // / Cross register the analysis managers through their proxies.
269269 // /
@@ -321,8 +321,7 @@ class PassBuilder {
321321 // / \p Phase indicates the current ThinLTO phase.
322322 FunctionPassManager
323323 buildFunctionSimplificationPipeline (OptimizationLevel Level,
324- ThinLTOPhase Phase,
325- bool DebugLogging = false );
324+ ThinLTOPhase Phase);
326325
327326 // / Construct the core LLVM module canonicalization and simplification
328327 // / pipeline.
@@ -339,16 +338,13 @@ class PassBuilder {
339338 // / build them.
340339 // /
341340 // / \p Phase indicates the current ThinLTO phase.
342- ModulePassManager
343- buildModuleSimplificationPipeline (OptimizationLevel Level,
344- ThinLTOPhase Phase,
345- bool DebugLogging = false );
341+ ModulePassManager buildModuleSimplificationPipeline (OptimizationLevel Level,
342+ ThinLTOPhase Phase);
346343
347344 // / Construct the module pipeline that performs inlining as well as
348345 // / the inlining-driven cleanups.
349346 ModuleInlinerWrapperPass buildInlinerPipeline (OptimizationLevel Level,
350- ThinLTOPhase Phase,
351- bool DebugLogging = false );
347+ ThinLTOPhase Phase);
352348
353349 // / Construct the core LLVM module optimization pipeline.
354350 // /
@@ -364,7 +360,6 @@ class PassBuilder {
364360 // / require some transformations for semantic reasons, they should explicitly
365361 // / build them.
366362 ModulePassManager buildModuleOptimizationPipeline (OptimizationLevel Level,
367- bool DebugLogging = false ,
368363 bool LTOPreLink = false );
369364
370365 // / Build a per-module default optimization pipeline.
@@ -379,7 +374,6 @@ class PassBuilder {
379374 // / require some transformations for semantic reasons, they should explicitly
380375 // / build them.
381376 ModulePassManager buildPerModuleDefaultPipeline (OptimizationLevel Level,
382- bool DebugLogging = false ,
383377 bool LTOPreLink = false );
384378
385379 // / Build a pre-link, ThinLTO-targeting default optimization pipeline to
@@ -394,9 +388,7 @@ class PassBuilder {
394388 // / only intended for use when attempting to optimize code. If frontends
395389 // / require some transformations for semantic reasons, they should explicitly
396390 // / build them.
397- ModulePassManager
398- buildThinLTOPreLinkDefaultPipeline (OptimizationLevel Level,
399- bool DebugLogging = false );
391+ ModulePassManager buildThinLTOPreLinkDefaultPipeline (OptimizationLevel Level);
400392
401393 // / Build an ThinLTO default optimization pipeline to a pass manager.
402394 // /
@@ -410,7 +402,7 @@ class PassBuilder {
410402 // / require some transformations for semantic reasons, they should explicitly
411403 // / build them.
412404 ModulePassManager
413- buildThinLTODefaultPipeline (OptimizationLevel Level, bool DebugLogging,
405+ buildThinLTODefaultPipeline (OptimizationLevel Level,
414406 const ModuleSummaryIndex *ImportSummary);
415407
416408 // / Build a pre-link, LTO-targeting default optimization pipeline to a pass
@@ -425,8 +417,7 @@ class PassBuilder {
425417 // / only intended for use when attempting to optimize code. If frontends
426418 // / require some transformations for semantic reasons, they should explicitly
427419 // / build them.
428- ModulePassManager buildLTOPreLinkDefaultPipeline (OptimizationLevel Level,
429- bool DebugLogging = false );
420+ ModulePassManager buildLTOPreLinkDefaultPipeline (OptimizationLevel Level);
430421
431422 // / Build an LTO default optimization pipeline to a pass manager.
432423 // /
@@ -440,7 +431,6 @@ class PassBuilder {
440431 // / require some transformations for semantic reasons, they should explicitly
441432 // / build them.
442433 ModulePassManager buildLTODefaultPipeline (OptimizationLevel Level,
443- bool DebugLogging,
444434 ModuleSummaryIndex *ExportSummary);
445435
446436 // / Build the default `AAManager` with the default alias analysis pipeline
@@ -487,8 +477,7 @@ class PassBuilder {
487477 // / specifically want the pass to run under a adaptor directly. This is
488478 // / preferred when a pipeline is largely of one type, but one or just a few
489479 // / passes are of different types(See PassBuilder.cpp for examples).
490- Error parsePassPipeline (ModulePassManager &MPM, StringRef PipelineText,
491- bool DebugLogging = false );
480+ Error parsePassPipeline (ModulePassManager &MPM, StringRef PipelineText);
492481
493482 // / {{@ Parse a textual pass pipeline description into a specific PassManager
494483 // /
@@ -497,12 +486,9 @@ class PassBuilder {
497486 // / this is the valid pipeline text:
498487 // /
499488 // / function(lpass)
500- Error parsePassPipeline (CGSCCPassManager &CGPM, StringRef PipelineText,
501- bool DebugLogging = false );
502- Error parsePassPipeline (FunctionPassManager &FPM, StringRef PipelineText,
503- bool DebugLogging = false );
504- Error parsePassPipeline (LoopPassManager &LPM, StringRef PipelineText,
505- bool DebugLogging = false );
489+ Error parsePassPipeline (CGSCCPassManager &CGPM, StringRef PipelineText);
490+ Error parsePassPipeline (FunctionPassManager &FPM, StringRef PipelineText);
491+ Error parsePassPipeline (LoopPassManager &LPM, StringRef PipelineText);
506492 // / @}}
507493
508494 // / Parse a textual alias analysis pipeline into the provided AA manager.
@@ -681,12 +667,10 @@ class PassBuilder {
681667 bool DebugLogging)> &C);
682668
683669 // / Add PGOInstrumenation passes for O0 only.
684- void addPGOInstrPassesForO0 (ModulePassManager &MPM, bool DebugLogging,
685- bool RunProfileGen, bool IsCS,
686- std::string ProfileFile,
670+ void addPGOInstrPassesForO0 (ModulePassManager &MPM, bool RunProfileGen,
671+ bool IsCS, std::string ProfileFile,
687672 std::string ProfileRemappingFile);
688673
689-
690674 // / Returns PIC. External libraries can use this to register pass
691675 // / instrumentation callbacks.
692676 PassInstrumentationCallbacks *getPassInstrumentationCallbacks () const {
@@ -695,38 +679,30 @@ class PassBuilder {
695679
696680private:
697681 // O1 pass pipeline
698- FunctionPassManager buildO1FunctionSimplificationPipeline (
699- OptimizationLevel Level, ThinLTOPhase Phase, bool DebugLogging = false );
682+ FunctionPassManager
683+ buildO1FunctionSimplificationPipeline (OptimizationLevel Level,
684+ ThinLTOPhase Phase);
700685
701686 static Optional<std::vector<PipelineElement>>
702687 parsePipelineText (StringRef Text);
703688
704- Error parseModulePass (ModulePassManager &MPM, const PipelineElement &E,
705- bool DebugLogging);
706- Error parseCGSCCPass (CGSCCPassManager &CGPM, const PipelineElement &E,
707- bool DebugLogging);
708- Error parseFunctionPass (FunctionPassManager &FPM, const PipelineElement &E,
709- bool DebugLogging);
710- Error parseLoopPass (LoopPassManager &LPM, const PipelineElement &E,
711- bool DebugLogging);
689+ Error parseModulePass (ModulePassManager &MPM, const PipelineElement &E);
690+ Error parseCGSCCPass (CGSCCPassManager &CGPM, const PipelineElement &E);
691+ Error parseFunctionPass (FunctionPassManager &FPM, const PipelineElement &E);
692+ Error parseLoopPass (LoopPassManager &LPM, const PipelineElement &E);
712693 bool parseAAPassName (AAManager &AA, StringRef Name);
713694
714695 Error parseLoopPassPipeline (LoopPassManager &LPM,
715- ArrayRef<PipelineElement> Pipeline,
716- bool DebugLogging);
696+ ArrayRef<PipelineElement> Pipeline);
717697 Error parseFunctionPassPipeline (FunctionPassManager &FPM,
718- ArrayRef<PipelineElement> Pipeline,
719- bool DebugLogging);
698+ ArrayRef<PipelineElement> Pipeline);
720699 Error parseCGSCCPassPipeline (CGSCCPassManager &CGPM,
721- ArrayRef<PipelineElement> Pipeline,
722- bool DebugLogging);
700+ ArrayRef<PipelineElement> Pipeline);
723701 Error parseModulePassPipeline (ModulePassManager &MPM,
724- ArrayRef<PipelineElement> Pipeline,
725- bool DebugLogging);
702+ ArrayRef<PipelineElement> Pipeline);
726703
727- void addPGOInstrPasses (ModulePassManager &MPM, bool DebugLogging,
728- OptimizationLevel Level, bool RunProfileGen, bool IsCS,
729- std::string ProfileFile,
704+ void addPGOInstrPasses (ModulePassManager &MPM, OptimizationLevel Level,
705+ bool RunProfileGen, bool IsCS, std::string ProfileFile,
730706 std::string ProfileRemappingFile);
731707 void invokePeepholeEPCallbacks (FunctionPassManager &, OptimizationLevel);
732708
0 commit comments