[Frontend/AST] Make it possible to determine Swift compiler version used to build a ModuleDecl

This commit is contained in:
Pavel Yaskevich
2024-10-23 14:50:24 -07:00
parent 3bd4853626
commit 39fb638516
2 changed files with 18 additions and 3 deletions

View File

@@ -1489,6 +1489,9 @@ ModuleDecl *CompilerInstance::getMainModule() const {
if (Invocation.getSILOptions().EnableSerializePackage)
MainModule->setSerializePackageEnabled();
MainModule->setSwiftCompilerVersion(
Invocation.getFrontendOptions().SwiftCompilerVersion);
// Register the main module with the AST context.
Context->addLoadedModule(MainModule);
Context->MainModule = MainModule;