Skip to content

[Clang][Driver] Expose -fno-eliminate-unused-debug-types to clang-cl #95259

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
Jun 15, 2024
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
3 changes: 3 additions & 0 deletions clang/docs/UsersManual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3338,6 +3338,9 @@ below. If multiple flags are present, the last one is used.
By default, Clang does not emit type information for types that are defined
but not used in a program. To retain the debug info for these unused types,
the negation **-fno-eliminate-unused-debug-types** can be used.
This can be particulary useful on Windows, when using NATVIS files that
can reference const symbols that would otherwise be stripped, even in full
debug or standalone debug modes.

Controlling Macro Debug Info Generation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -2120,7 +2120,7 @@ def fno_elide_type : Flag<["-"], "fno-elide-type">, Group<f_Group>,
MarshallingInfoNegativeFlag<DiagnosticOpts<"ElideType">>;
def feliminate_unused_debug_symbols : Flag<["-"], "feliminate-unused-debug-symbols">, Group<f_Group>;
defm eliminate_unused_debug_types : OptOutCC1FFlag<"eliminate-unused-debug-types",
"Do not emit ", "Emit ", " debug info for defined but unused types">;
"Do not emit ", "Emit ", " debug info for defined but unused types", [ClangOption, CLOption]>;
def femit_all_decls : Flag<["-"], "femit-all-decls">, Group<f_Group>,
Visibility<[ClangOption, CC1Option]>,
HelpText<"Emit all declarations, even if unused">,
Expand Down
2 changes: 2 additions & 0 deletions clang/test/Driver/cl-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,8 @@
// RUN: -Wunused-variable \
// RUN: -fmacro-backtrace-limit=0 \
// RUN: -fstandalone-debug \
// RUN: -feliminate-unused-debug-types \
// RUN: -fno-eliminate-unused-debug-types \
// RUN: -flimit-debug-info \
// RUN: -flto \
// RUN: -fmerge-all-constants \
Expand Down
Loading