mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Frontend] Add compiler version information to -print-target-info output.
Clients that use -print-target-info can avoid an extra frontend invocation by using this information.
This commit is contained in:
@@ -1985,6 +1985,12 @@ static void printTargetInfo(const CompilerInvocation &invocation,
|
||||
llvm::raw_ostream &out) {
|
||||
out << "{\n";
|
||||
|
||||
// Compiler version, as produced by --version.
|
||||
out << " \"compilerVersion\": \"";
|
||||
out.write_escaped(version::getSwiftFullVersion(
|
||||
version::Version::getCurrentLanguageVersion()));
|
||||
out << "\",\n";
|
||||
|
||||
// Target triple and target variant triple.
|
||||
auto &langOpts = invocation.getLangOptions();
|
||||
out << " \"target\": ";
|
||||
|
||||
Reference in New Issue
Block a user