[llvm-branch-commits] [clang] [KeyInstr][Clang] Add Clang option -g[no-]key-instructions (PR #134627)

Reid Kleckner via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu May 1 16:27:10 PDT 2025


================
@@ -4767,6 +4767,13 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T,
       CmdArgs.push_back("-gembed-source");
   }
 
+  if (Args.hasFlag(options::OPT_gkey_instructions,
+                   options::OPT_gno_key_instructions, false)) {
+    CmdArgs.push_back("-gkey-instructions");
----------------
rnk wrote:

I was going to say "we avoid setting mllvm flags in the Driver" because LLVM option parsing handles duplicate options as an error conflict, rather than "last one wins silently", but I found lots of prior art contradicting that position, so I think you're in the clear:
```
$ git grep mllvm ../clang/lib/Driver/ | wc -l
100
```

https://github.com/llvm/llvm-project/pull/134627


More information about the llvm-branch-commits mailing list