File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -675,8 +675,18 @@ int main(int argc, char **argv) {
675
675
SILOpts.OptMode = OptModeFlag;
676
676
}
677
677
678
- // Note: SILOpts must be set before the CompilerInstance is initializer below
679
- // based on Invocation.
678
+ auto &IRGenOpts = Invocation.getIRGenOptions ();
679
+ if (OptModeFlag == OptimizationMode::NotSet) {
680
+ if (OptimizationGroup == OptGroup::Diagnostics)
681
+ IRGenOpts.OptMode = OptimizationMode::NoOptimization;
682
+ else
683
+ IRGenOpts.OptMode = OptimizationMode::ForSpeed;
684
+ } else {
685
+ IRGenOpts.OptMode = OptModeFlag;
686
+ }
687
+
688
+ // Note: SILOpts, LangOpts, and IRGenOpts must be set before the
689
+ // CompilerInstance is initializer below based on Invocation.
680
690
681
691
serialization::ExtendedValidationInfo extendedInfo;
682
692
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> FileBufOrErr =
You can’t perform that action at this time.
0 commit comments