[clang] [KeyInstr] Enable -gkey-instructions by default if optimisations are enabled (PR #149509)

Jeremy Morse via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 26 04:58:29 PDT 2025


================
@@ -4394,10 +4394,15 @@ static void renderDwarfFormat(const Driver &D, const llvm::Triple &T,
 
 static void
 renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T,
-                   const ArgList &Args, bool IRInput, ArgStringList &CmdArgs,
-                   const InputInfo &Output,
+                   const ArgList &Args, types::ID InputType,
+                   ArgStringList &CmdArgs, const InputInfo &Output,
                    llvm::codegenoptions::DebugInfoKind &DebugInfoKind,
                    DwarfFissionKind &DwarfFission) {
+  bool IRInput = isLLVMIR(InputType);
+  bool PlainCOrCXX = isDerivedFromC(InputType) && !isCuda(InputType) &&
+                     !isHIP(InputType) && !isObjC(InputType) &&
+                     !isOpenCL(InputType);
----------------
jmorse wrote:

Obvious question, is there a better way of selecting "just C and C++" rather than "list of extensions that this shouldn't apply to"?

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


More information about the cfe-commits mailing list