llvm.org GIT mirror llvm / 45074ea
[PM] Fix r307532: Get rid of a dangling reference. Escaping lambda by-reference capture of local variable caused a dangling reference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307534 91177308-0d34-0410-b5e6-96231b3b80d8 Philip Pfaffe 3 years ago
1 changed file(s) with 24 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
8787 static void registerEPCallbacks(PassBuilder &PB, bool VerifyEachPass,
8888 bool DebugLogging) {
8989 if (!PeepholeEPPipeline.empty())
90 PB.registerPeepholeEPCallback(
91 [&](FunctionPassManager &PM, PassBuilder::OptimizationLevel Level) {
92 return PB.parsePassPipeline(PM, PeepholeEPPipeline, VerifyEachPass,
93 DebugPM);
94 });
90 PB.registerPeepholeEPCallback([&PB, VerifyEachPass, DebugLogging](
91 FunctionPassManager &PM, PassBuilder::OptimizationLevel Level) {
92 return PB.parsePassPipeline(PM, PeepholeEPPipeline, VerifyEachPass,
93 DebugPM);
94 });
9595 if (!LateLoopOptimizationsEPPipeline.empty())
9696 PB.registerLateLoopOptimizationsEPCallback(
97 [&](LoopPassManager &PM, PassBuilder::OptimizationLevel Level) {
97 [&PB, VerifyEachPass, DebugLogging](
98 LoopPassManager &PM, PassBuilder::OptimizationLevel Level) {
9899 return PB.parsePassPipeline(PM, LateLoopOptimizationsEPPipeline,
99100 VerifyEachPass, DebugPM);
100101 });
101102 if (!LoopOptimizerEndEPPipeline.empty())
102 PB.registerLoopOptimizerEndEPCallback(
103 [&](LoopPassManager &PM, PassBuilder::OptimizationLevel Level) {
104 return PB.parsePassPipeline(PM, LoopOptimizerEndEPPipeline,
105 VerifyEachPass, DebugPM);
106 });
103 PB.registerLoopOptimizerEndEPCallback([&PB, VerifyEachPass, DebugLogging](
104 LoopPassManager &PM, PassBuilder::OptimizationLevel Level) {
105 return PB.parsePassPipeline(PM, LoopOptimizerEndEPPipeline,
106 VerifyEachPass, DebugPM);
107 });
107108 if (!ScalarOptimizerLateEPPipeline.empty())
108109 PB.registerScalarOptimizerLateEPCallback(
109 [&](FunctionPassManager &PM, PassBuilder::OptimizationLevel Level) {
110 [&PB, VerifyEachPass, DebugLogging](
111 FunctionPassManager &PM, PassBuilder::OptimizationLevel Level) {
110112 return PB.parsePassPipeline(PM, ScalarOptimizerLateEPPipeline,
111113 VerifyEachPass, DebugPM);
112114 });
113115 if (!CGSCCOptimizerLateEPPipeline.empty())
114 PB.registerCGSCCOptimizerLateEPCallback(
115 [&](CGSCCPassManager &PM, PassBuilder::OptimizationLevel Level) {
116 return PB.parsePassPipeline(PM, CGSCCOptimizerLateEPPipeline,
117 VerifyEachPass, DebugPM);
118 });
116 PB.registerCGSCCOptimizerLateEPCallback([&PB, VerifyEachPass, DebugLogging](
117 CGSCCPassManager &PM, PassBuilder::OptimizationLevel Level) {
118 return PB.parsePassPipeline(PM, CGSCCOptimizerLateEPPipeline,
119 VerifyEachPass, DebugPM);
120 });
119121 if (!VectorizerStartEPPipeline.empty())
120 PB.registerVectorizerStartEPCallback(
121 [&](FunctionPassManager &PM, PassBuilder::OptimizationLevel Level) {
122 return PB.parsePassPipeline(PM, VectorizerStartEPPipeline,
123 VerifyEachPass, DebugPM);
124 });
122 PB.registerVectorizerStartEPCallback([&PB, VerifyEachPass, DebugLogging](
123 FunctionPassManager &PM, PassBuilder::OptimizationLevel Level) {
124 return PB.parsePassPipeline(PM, VectorizerStartEPPipeline, VerifyEachPass,
125 DebugPM);
126 });
125127 }
126128
127129 bool llvm::runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,