Skip to content

Commit 34bb38f

Browse files
authored
[KeyInstr] Add release note & update option (#148244)
Make the option visible, improve the help text, and add a release note.
1 parent da68e72 commit 34bb38f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ New Compiler Flags
376376

377377
- New option ``-ignore-pch`` added to disable precompiled headers. It overrides ``-emit-pch`` and ``-include-pch``. (#GH142409, `PCHDocs <https://clang.llvm.org/docs/UsersManual.html#ignoring-a-pch-file>`_).
378378

379+
- New options ``-g[no-]key-instructions`` added, disabled by default. Reduces jumpiness of debug stepping for optimized code in some debuggers (not LLDB at this time). Not recommended for use without optimizations. DWARF only. Note both the positive and negative flags imply ``-g``.
380+
379381
Deprecated Compiler Flags
380382
-------------------------
381383

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4720,9 +4720,9 @@ def gno_embed_source : Flag<["-"], "gno-embed-source">, Group<g_flags_Group>,
47204720
defm key_instructions : BoolGOption<"key-instructions",
47214721
CodeGenOpts<"DebugKeyInstructions">, DefaultFalse,
47224722
NegFlag<SetFalse>, PosFlag<SetTrue, [], [],
4723-
"Enable Key Instructions, which reduces the jumpiness of optimized code stepping (DWARF only)."
4724-
" Requires LLVM built with LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS.">,
4725-
BothFlags<[HelpHidden], [ClangOption, CLOption, CC1Option]>>;
4723+
"Enable Key Instructions, which reduces the jumpiness of debug stepping in optimized C/C++ code"
4724+
" in some debuggers. DWARF only. Implies -g.">,
4725+
BothFlags<[], [ClangOption, CLOption, CC1Option]>>;
47264726
def headerpad__max__install__names : Joined<["-"], "headerpad_max_install_names">;
47274727
def help : Flag<["-", "--"], "help">,
47284728
Visibility<[ClangOption, CC1Option, CC1AsOption,

clang/test/DebugInfo/KeyInstructions/flag.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
//// Default: Off.
44
// RUN: %clang -### -target x86_64 -c -gdwarf %s 2>&1 | FileCheck %s --check-prefixes=NO-KEY-INSTRUCTIONS
55

6+
//// Help.
7+
// RUN %clang --help | FileCheck %s --check-prefix=HELP
8+
// HELP: -gkey-instructions Enable Key Instructions, which reduces the jumpiness of debug stepping in optimized C/C++ code in some debuggers. DWARF only. Implies -g.
9+
610
// KEY-INSTRUCTIONS: "-gkey-instructions"
711
// NO-KEY-INSTRUCTIONS-NOT: key-instructions
812

0 commit comments

Comments
 (0)