Skip to content

Commit 12018be

Browse files
committed
[Frontend] Always output the version being compiled for
Outputting the effective version in the pretty stack trace was skipped if the current version was the same as the effective version. This would result in an empty line, which is somewhat confusing. Output a line regardless. Resolves rdar://81140703
1 parent a87d131 commit 12018be

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,6 +1969,8 @@ class PrettyStackTraceFrontend : public llvm::PrettyStackTraceEntry {
19691969
auto effective = LangOpts.EffectiveLanguageVersion;
19701970
if (effective != version::Version::getCurrentLanguageVersion()) {
19711971
os << "Compiling with effective version " << effective;
1972+
} else {
1973+
os << "Compiling with the current language version";
19721974
}
19731975
os << "\n";
19741976
};

test/Frontend/crash.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
// CHECK-ALLOW: Program arguments: {{.*}} -experimental-allow-module-with-compiler-errors
1717
// CHECK-ALLOW: Compiling with effective version
1818

19+
// RUN: not --crash %target-swift-frontend -typecheck -debug-crash-after-parse -experimental-allow-module-with-compiler-errors -swift-version 5 %s 2>&1 | %FileCheck -check-prefix CHECK-CURRENT %s
20+
// CHECK-CURRENT: Program arguments: {{.*}} -experimental-allow-module-with-compiler-errors
21+
// CHECK-CURRENT: Compiling with the current language version
22+
1923
func anchor() {}
2024
anchor()
2125

0 commit comments

Comments
 (0)