Skip to content

Commit ba59ef5

Browse files
authored
Merge pull request swiftlang#32345 from davezarzycki/pr32345
[Basic] Revise version printing
2 parents 542721b + aefeab8 commit ba59ef5

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

lib/Basic/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ function(generate_revision_inc revision_inc_var name dir)
3434
endfunction()
3535

3636
generate_revision_inc(llvm_revision_inc LLVM "${LLVM_MAIN_SRC_DIR}")
37-
generate_revision_inc(clang_revision_inc Clang "${CLANG_MAIN_SRC_DIR}")
3837
generate_revision_inc(swift_revision_inc Swift "${SWIFT_SOURCE_DIR}")
3938

4039
add_swift_host_library(swiftBasic STATIC

lib/Basic/Version.cpp

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,34 +45,25 @@
4545
#endif
4646

4747
#include "LLVMRevision.inc"
48-
#include "ClangRevision.inc"
4948
#include "SwiftRevision.inc"
5049

5150
namespace swift {
5251
namespace version {
5352

54-
/// Print a string of the form "LLVM xxxxx, Clang yyyyy, Swift zzzzz",
55-
/// where each placeholder is the revision for the associated repository.
53+
/// Print a string of the form "LLVM xxxxx, Swift zzzzz", where each placeholder
54+
/// is the revision for the associated repository.
5655
static void printFullRevisionString(raw_ostream &out) {
57-
// Arbitrarily truncate to 10 characters. This should be enough to unique
58-
// Git hashes for the time being, and certainly enough for SVN revisions,
59-
// while keeping the version string from being ridiculously long.
56+
// Arbitrarily truncate to 15 characters. This should be enough to unique Git
57+
// hashes while keeping the REPL version string from overflowing 80 columns.
6058
#if defined(LLVM_REVISION)
61-
out << "LLVM " << StringRef(LLVM_REVISION).slice(0, 10);
62-
# if defined(CLANG_REVISION) || defined(SWIFT_REVISION)
63-
out << ", ";
64-
# endif
65-
#endif
66-
67-
#if defined(CLANG_REVISION)
68-
out << "Clang " << StringRef(CLANG_REVISION).slice(0, 10);
59+
out << "LLVM " << StringRef(LLVM_REVISION).slice(0, 15);
6960
# if defined(SWIFT_REVISION)
7061
out << ", ";
7162
# endif
7263
#endif
7364

7465
#if defined(SWIFT_REVISION)
75-
out << "Swift " << StringRef(SWIFT_REVISION).slice(0, 10);
66+
out << "Swift " << StringRef(SWIFT_REVISION).slice(0, 15);
7667
#endif
7768
}
7869

@@ -424,8 +415,7 @@ std::string getSwiftFullVersion(Version effectiveVersion) {
424415
OS << " clang-" CLANG_COMPILER_VERSION;
425416
#endif
426417
OS << ")";
427-
#elif defined(LLVM_REVISION) || defined(CLANG_REVISION) || \
428-
defined(SWIFT_REVISION)
418+
#elif defined(LLVM_REVISION) || defined(SWIFT_REVISION)
429419
OS << " (";
430420
printFullRevisionString(OS);
431421
OS << ")";

0 commit comments

Comments
 (0)