File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -216,9 +216,10 @@ void setModuleFlags(IRGenModule &IGM) {
216216 }
217217}
218218
219- void swift::performLLVMOptimizations (const IRGenOptions &Opts,
220- llvm::Module *Module,
221- llvm::TargetMachine *TargetMachine) {
219+ static void
220+ performOptimizationsUsingLegacyPassManger (const IRGenOptions &Opts,
221+ llvm::Module *Module,
222+ llvm::TargetMachine *TargetMachine) {
222223 // Set up a pipeline.
223224 PassManagerBuilderWrapper PMBuilder (Opts);
224225
@@ -389,6 +390,20 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts,
389390 }
390391}
391392
393+ static void
394+ performOptimizationsUsingNewPassManger (const IRGenOptions &Opts,
395+ llvm::Module *Module,
396+ llvm::TargetMachine *TargetMachine) {}
397+
398+ void swift::performLLVMOptimizations (const IRGenOptions &Opts,
399+ llvm::Module *Module,
400+ llvm::TargetMachine *TargetMachine) {
401+ if (Opts.LegacyPassManager )
402+ performOptimizationsUsingLegacyPassManger (Opts, Module, TargetMachine);
403+ else
404+ performOptimizationsUsingNewPassManger (Opts, Module, TargetMachine);
405+ }
406+
392407// / Computes the MD5 hash of the llvm \p Module including the compiler version
393408// / and options which influence the compilation.
394409static MD5::MD5Result getHashOfModule (const IRGenOptions &Opts,
You can’t perform that action at this time.
0 commit comments