@@ -254,6 +254,9 @@ class ModuleDecl
254254
255255 mutable Identifier PublicModuleName;
256256
257+ // / Indicates that version of the Swift compiler this module was built with.
258+ mutable llvm::VersionTuple SwiftCompilerVersion;
259+
257260public:
258261 // / Produces the components of a given module's full name in reverse order.
259262 // /
@@ -518,11 +521,20 @@ class ModuleDecl
518521 PublicModuleName = name;
519522 }
520523
524+ // / The version of the Swift compiler this module was built with.
525+ llvm::VersionTuple getSwiftCompilerVersion () const {
526+ return SwiftCompilerVersion;
527+ }
528+
529+ void setSwiftCompilerVersion (llvm::VersionTuple version) {
530+ SwiftCompilerVersion = version;
531+ }
532+
521533 // / Retrieve the actual module name of an alias used for this module (if any).
522534 // /
523- // / For example, if '-module-alias Foo=Bar' is passed in when building the main module,
524- // / and this module is (a) not the main module and (b) is named Foo, then it returns
525- // / the real (physically on-disk) module name Bar.
535+ // / For example, if '-module-alias Foo=Bar' is passed in when building the
536+ // / main module, and this module is (a) not the main module and (b) is named
537+ // / Foo, then it returns the real (physically on-disk) module name Bar.
526538 // /
527539 // / If no module aliasing is set, it will return getName(), i.e. Foo.
528540 Identifier getRealName () const ;
0 commit comments