-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[clang][LLVM Demangler] Add a diagnostic that validates that all mang… #111391
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -384,4 +384,8 @@ def warn_hlsl_langstd_minimal : | |
| Warning<"support for HLSL language version %0 is incomplete, " | ||
| "recommend using %1 instead">, | ||
| InGroup<HLSLDXCCompat>; | ||
|
|
||
| def warn_name_cannot_be_demangled : Warning< | ||
| "cannot demangle the name '%0'">, | ||
| InGroup<CXX20Compat>; | ||
|
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1967,6 +1967,10 @@ def fclang_abi_compat_EQ : Joined<["-"], "fclang-abi-compat=">, Group<f_clang_Gr | |||||
| Visibility<[ClangOption, CC1Option]>, | ||||||
| MetaVarName<"<version>">, Values<"<major>.<minor>,latest">, | ||||||
| HelpText<"Attempt to match the ABI of Clang <version>">; | ||||||
| def fdemangling_failures: Flag<["-"], "fdemangling-failures">, Group<f_clang_Group>, | ||||||
|
||||||
| def fdemangling_failures: Flag<["-"], "fdemangling-failures">, Group<f_clang_Group>, | |
| def fdiag-demangler_failures: Flag<["-"], "fdiag-demangler-failures">, Group<f_clang_Group>, |
Same as above... I'm not attached to the demangling vs demangler, but mentioning explicitly that this is for 'diag' everywhere is necessary for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, good point. I've looked through the existing flags, there are multiple ones that start with fdiagnostics_XXX, so I have renamed the flag to fdiagnostics_demangler_failures.
Let me know if this works.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // RUN: %clang_cc1 -emit-llvm -fdemangling-failures -triple %itanium_abi_triple -o - %s | FileCheck %s | ||
| template <class F> void parallel_loop(F &&f) { f(0); } | ||
|
|
||
| //CHECK-LABEL: @main | ||
| int main() { | ||
| int x; | ||
| parallel_loop([&](auto y) { // expected-warning {{cannot demangle the name '_ZZ4mainENK3$_0clIiEEDaT_'}} | ||
| #pragma clang __debug captured | ||
| { | ||
| x = y; | ||
| }; | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, mentioning diagnostics makes sense.