6 Commits

Author SHA1 Message Date
Cyndy Ishida
d65e712e30
[clang] Make "__GCC_HAVE_DWARF2_CFI_ASM" a proper predefined macro (#165731)
Use a flag to determine whether this macro should be set when
intializing the preprocessor.

This macro was added to the driver in
9d117e7b2a399a9b2bcf53fb9b9c0946e82dc75c because it can be conditionally
disabled, but before that, the flag to gate behavior was removed under
the assumption it wasn't conditional in
b5b622a03c5136fa10d245dbe1f8f278ebd98d1b. This patch is to connect the
macro with the preexisting flag
2025-11-03 18:09:18 +00:00
Reid Kleckner
56e3e30ceb
[clang] Remove -g[no-]-* bool flags from g_Group (#162750)
There are four uses of BoolGOption, and all of them are essentially debug
info feature flags, which I believe should not the enablement or
disablement of all debug info emission. `OPT_g_group` is used to control
the debug info level here:

https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Clang.cpp#L4387

This doesn't cause any test failures, and seems like the right behavior
for all four flags:
* -g[no-]flag-base
* -g[no-]inline-line-tables
* -g[no-]key-instructions
* -g[no-]structor-decl-linkage-names

None of these, even in the positive form, should enable debug info
emission.

Fixes #162747
2025-10-10 22:49:18 +00:00
Orlando Cazalet-Hyams
9d65f77159
[KeyInstr] Enable -gkey-instructions by default if optimisations are enabled (#149509)
That's enabling Clang's -gkey-instructions, cc1's -gkey-instructions
remains off by default.

Key Instructions improves the optimized-code debug-stepping experience
in debuggers that use DWARF's `is_stmt` line table register to determine
stepping behaviour.

The feature can be disabled with -gno-key-instructions (note that the
positive and negative flag both imply -g).

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668
2025-08-27 09:49:40 +01:00
Orlando Cazalet-Hyams
34bb38ffbf
[KeyInstr] Add release note & update option (#148244)
Make the option visible, improve the help text, and add a release note.
2025-07-14 11:21:20 +01:00
Orlando Cazalet-Hyams
b29fea6eeb
[KeyInstr][Clang][NFC] Don't set -dwarf-use-key-instructions (#144115)
Now PR 144104 has landed the flag is true by default (each DISubprogram tracks
whether or not it's using key instructions).
2025-06-30 12:30:35 +01:00
Orlando Cazalet-Hyams
8f03e1a9d5
[KeyInstr][Clang] Add Clang option -g[no-]key-instructions (#134627)
This needs to be driver level to pass an -mllvm flag to LLVM, though this may
change soon as the -mllvm flag will soon not be necessary.

Keep the flag help-hidden as the feature is under development.

This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
2025-05-20 11:22:36 +01:00