[clang] [KeyInstr][Clang][NFC] Don't set -dwarf-use-key-instructions (PR #144115)
Orlando Cazalet-Hyams via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 30 00:53:02 PDT 2025
================
@@ -8,8 +8,14 @@
// HELP-NOT: key-instructions
// KEY-INSTRUCTIONS: "-gkey-instructions"
-// KEY-INSTRUCTIONS: "-mllvm" "-dwarf-use-key-instructions"
// NO-KEY-INSTRUCTIONS-NOT: key-instructions
-//// TODO: Add smoke test once some functionality has been added.
+// RUN %clang %s | FileCheck %s --check-prefix=SMOKETEST-OFF
+void f() {}
+// SMOKETEST-OFF-NOT: keyInstructions
+// SMOKETEST-OFF-NOT: atomGroup
+
+// RUN %clang %s -gkey-instructions | FileCheck %s --check-prefix=SMOKETEST-ON
+// SMOKETEST-ON: keyInstructions: true
+// SMOKETEST-ON: atomGroup: 1
----------------
OCHyams wrote:
It turns out it is - same happens for `gomit-unreferenced-methods` so I expect it's a feature of using the `g` prefix? This was not my original intention, though I don't think it's necessarily a bad thing. Possibly slightly confusing that `-gno-key-instructions` turns on `-g` too, though it does make sense if you read it as `-g, no key instructions please` (again, same as `g[no-]omit-unreferenced-methods`).
Anyway,
>would it not be better to explicitly pass -g in both cases anyway?
Done (`-debug-info-kind=line-tables-only`).
https://github.com/llvm/llvm-project/pull/144115
More information about the cfe-commits
mailing list