Author: Orlando Cazalet-Hyams
Date: 2025-06-30T12:30:35+01:00
New Revision: b29fea6eebae562d9be32f14b8fe79c89ab80292

URL: 
https://github.com/llvm/llvm-project/commit/b29fea6eebae562d9be32f14b8fe79c89ab80292
DIFF: 
https://github.com/llvm/llvm-project/commit/b29fea6eebae562d9be32f14b8fe79c89ab80292.diff

LOG: [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).

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Clang.cpp
    clang/test/DebugInfo/KeyInstructions/flag.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index ceb592d1548f5..fea4ee909ff46 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -4631,11 +4631,8 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, 
const llvm::Triple &T,
   }
 
   if (Args.hasFlag(options::OPT_gkey_instructions,
-                   options::OPT_gno_key_instructions, false)) {
+                   options::OPT_gno_key_instructions, false))
     CmdArgs.push_back("-gkey-instructions");
-    CmdArgs.push_back("-mllvm");
-    CmdArgs.push_back("-dwarf-use-key-instructions");
-  }
 
   if (EmitCodeView) {
     CmdArgs.push_back("-gcodeview");

diff  --git a/clang/test/DebugInfo/KeyInstructions/flag.cpp 
b/clang/test/DebugInfo/KeyInstructions/flag.cpp
index 93503dd4bdb4c..813f7e908011c 100644
--- a/clang/test/DebugInfo/KeyInstructions/flag.cpp
+++ b/clang/test/DebugInfo/KeyInstructions/flag.cpp
@@ -3,13 +3,19 @@
 //// Default: Off.
 // RUN: %clang -### -target x86_64 -c -gdwarf %s 2>&1 | FileCheck %s 
--check-prefixes=NO-KEY-INSTRUCTIONS
 
-//// Help hidden.
-// RUN %clang --help | FileCheck %s --check-prefix=HELP
-// 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.
+//// Help hidden: flag should not be visible.
+// RUN: %clang --help | FileCheck %s --check-prefix=HELP
+// HELP-NOT: key-instructions
+
+// Smoke test: check for Key Instructions keywords in the IR.
+void f() {}
+// RUN: %clang_cc1 %s -triple x86_64-linux-gnu 
-debug-info-kind=line-tables-only -emit-llvm -o - | FileCheck %s 
--check-prefix=SMOKETEST-OFF
+// SMOKETEST-OFF-NOT: keyInstructions:
+// SMOKETEST-OFF-NOT: atomGroup
+
+// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -gkey-instructions 
-debug-info-kind=line-tables-only -emit-llvm -o - | FileCheck %s 
--check-prefix=SMOKETEST-ON
+// SMOKETEST-ON: keyInstructions: true
+// SMOKETEST-ON: atomGroup: 1


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to