Skip to content

[Frontend] Always output the version being compiled for #38641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/FrontendTool/FrontendTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1969,6 +1969,8 @@ class PrettyStackTraceFrontend : public llvm::PrettyStackTraceEntry {
auto effective = LangOpts.EffectiveLanguageVersion;
if (effective != version::Version::getCurrentLanguageVersion()) {
os << "Compiling with effective version " << effective;
} else {
os << "Compiling with the current language version";
}
os << "\n";
};
Expand Down
4 changes: 4 additions & 0 deletions test/Frontend/crash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
// CHECK-ALLOW: Program arguments: {{.*}} -experimental-allow-module-with-compiler-errors
// CHECK-ALLOW: Compiling with effective version

// 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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little annoying since we'll have to update this when the major version changes, but unfortunately -swift-version 4 is included in the test options. Do you have any better ideas here @xymus?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, yeah, that automatic -swift-version 4 is unfortunate. We don't update the language version that often, I think this is fine.

// CHECK-CURRENT: Program arguments: {{.*}} -experimental-allow-module-with-compiler-errors
// CHECK-CURRENT: Compiling with the current language version

func anchor() {}
anchor()