File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ static cl::opt<bool> ClSanitizeOnOptimizerEarlyEP(
109
109
cl::desc (" Insert sanitizers on OptimizerEarlyEP." ), cl::init(false ));
110
110
}
111
111
112
+ static cl::opt<std::string> NewPMPasses (" newpm-passes" , cl::Optional,
113
+ cl::desc (" Specify a custom pre-link pipeline. An empty string specifies the default pipeline." ),
114
+ cl::init(" " ));
115
+
112
116
namespace {
113
117
114
118
// Default filename used for profile generation.
@@ -994,7 +998,13 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
994
998
MPM.addPass (InstrProfiling (*Options, false ));
995
999
});
996
1000
997
- if (CodeGenOpts.OptimizationLevel == 0 ) {
1001
+ if (!NewPMPasses.empty ()) {
1002
+ MPM = PB.buildO0DefaultPipeline (Level, IsLTO || IsThinLTO);
1003
+ if (auto Err = PB.parsePassPipeline (MPM, NewPMPasses)) {
1004
+ report_fatal_error (Twine (" unable to parse pass pipeline description '" ) +
1005
+ NewPMPasses + " ': " + toString (std::move (Err)));
1006
+ }
1007
+ } else if (CodeGenOpts.OptimizationLevel == 0 ) {
998
1008
MPM = PB.buildO0DefaultPipeline (Level, IsLTO || IsThinLTO);
999
1009
} else if (IsThinLTO) {
1000
1010
MPM = PB.buildThinLTOPreLinkDefaultPipeline (Level);
You can’t perform that action at this time.
0 commit comments