|
16 | 16 | #include "swift/AST/Identifier.h" |
17 | 17 | #include "swift/Basic/CXXStdlibKind.h" |
18 | 18 | #include "swift/Basic/LLVM.h" |
| 19 | +#include "swift/Basic/SourceLoc.h" |
19 | 20 | #include "swift/Basic/Version.h" |
| 21 | +#include "swift/Parse/ParseVersion.h" |
20 | 22 | #include "swift/Serialization/SerializationOptions.h" |
21 | 23 | #include "llvm/ADT/ArrayRef.h" |
22 | 24 | #include "llvm/ADT/SmallVector.h" |
@@ -131,7 +133,7 @@ class ExtendedValidationInfo { |
131 | 133 | StringRef ExportAsName; |
132 | 134 | StringRef PublicModuleName; |
133 | 135 | CXXStdlibKind CXXStdlib; |
134 | | - llvm::VersionTuple SwiftInterfaceCompilerVersion; |
| 136 | + version::Version SwiftInterfaceCompilerVersion; |
135 | 137 | struct { |
136 | 138 | unsigned ArePrivateImportsEnabled : 1; |
137 | 139 | unsigned IsSIB : 1; |
@@ -252,14 +254,13 @@ class ExtendedValidationInfo { |
252 | 254 | CXXStdlibKind getCXXStdlibKind() const { return CXXStdlib; } |
253 | 255 | void setCXXStdlibKind(CXXStdlibKind kind) { CXXStdlib = kind; } |
254 | 256 |
|
255 | | - llvm::VersionTuple getSwiftInterfaceCompilerVersion() const { |
| 257 | + version::Version getSwiftInterfaceCompilerVersion() const { |
256 | 258 | return SwiftInterfaceCompilerVersion; |
257 | 259 | } |
258 | 260 | void setSwiftInterfaceCompilerVersion(StringRef version) { |
259 | | - llvm::VersionTuple compilerVersion; |
260 | | - if (compilerVersion.tryParse(version)) |
261 | | - return; |
262 | | - SwiftInterfaceCompilerVersion = compilerVersion; |
| 261 | + if (auto genericVersion = VersionParser::parseVersionString( |
| 262 | + version, SourceLoc(), /*Diags=*/nullptr)) |
| 263 | + SwiftInterfaceCompilerVersion = genericVersion.value(); |
263 | 264 | } |
264 | 265 | }; |
265 | 266 |
|
|
0 commit comments