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) {
216
216
}
217
217
}
218
218
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) {
222
223
// Set up a pipeline.
223
224
PassManagerBuilderWrapper PMBuilder (Opts);
224
225
@@ -389,6 +390,20 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts,
389
390
}
390
391
}
391
392
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
+
392
407
// / Computes the MD5 hash of the llvm \p Module including the compiler version
393
408
// / and options which influence the compilation.
394
409
static MD5::MD5Result getHashOfModule (const IRGenOptions &Opts,
You can’t perform that action at this time.
0 commit comments