Add PrettyStackTraceSwiftVersion, and use it in the swiftc executable (#24235)

As pointed out on a recent JIRA, crash traces don't mention what
version of Swift you were running. Usually that can be gleaned from
the path, but not always.
This commit is contained in:
Jordan Rose
2019-04-24 15:53:56 -07:00
committed by GitHub
parent b707e7ad4d
commit f4487881e4
4 changed files with 15 additions and 0 deletions

View File

@@ -17,6 +17,7 @@
#include "swift/Basic/PrettyStackTrace.h"
#include "swift/Basic/QuotedString.h"
#include "swift/Basic/Version.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
@@ -33,3 +34,7 @@ void PrettyStackTraceFileContents::print(llvm::raw_ostream &out) const {
out << '\n';
out << "---\n";
}
void PrettyStackTraceSwiftVersion::print(llvm::raw_ostream &out) const {
out << version::getSwiftFullVersion() << '\n';
}