[Basic] Limit version::getCompilerversion to major + minor only

At the moment the only user of this method is `-interface-compiler-version`
and it's checked against major + minor only, so this is not going
to affect functionality.

In the future we should switch from `llvm::VersionTuple` to `swift::Version`
because swift tags have five components.

Resolves: rdar://140006577
This commit is contained in:
Pavel Yaskevich
2024-11-15 16:32:44 -08:00
committed by Allan Shortlidge
parent f778170cfb
commit bc2a640ce7

View File

@@ -343,11 +343,10 @@ std::string getCompilerVersion() {
std::string buf;
llvm::raw_string_ostream OS(buf);
#if defined(SWIFT_COMPILER_VERSION)
OS << SWIFT_COMPILER_VERSION;
#else
OS << SWIFT_VERSION_STRING;
#endif
// TODO: This should print SWIFT_COMPILER_VERSION when
// available, but to do that we need to switch from
// llvm::VersionTuple to swift::Version.
OS << SWIFT_VERSION_STRING;
return OS.str();
}