Skip to content

Commit 1fa8dd4

Browse files
author
EMatejska
committed
Adding getSwiftRevision(). This is to aid cleaning up some lldb code that could use this API.
1 parent e3428ba commit 1fa8dd4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

include/swift/Basic/Version.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ std::pair<unsigned, unsigned> getSwiftNumericVersion();
149149
std::string getSwiftFullVersion(Version effectiveLanguageVersion =
150150
Version::getCurrentLanguageVersion());
151151

152+
/// Retrieves the repository revision number (or identifer) from which
153+
/// this Swift was built.
154+
std::string getSwiftRevision();
155+
152156
} // end namespace version
153157
} // end namespace swift
154158

lib/Basic/Version.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,14 @@ std::string getSwiftFullVersion(Version effectiveVersion) {
406406
return OS.str();
407407
}
408408

409+
std::string getSwiftRevision() {
410+
#ifdef SWIFT_REVISION
411+
return SWIFT_REVISION;
412+
#else
413+
return "";
414+
#endif
415+
}
416+
409417
} // end namespace version
410418
} // end namespace swift
411419

0 commit comments

Comments
 (0)