-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[KeyInstr][Clang][NFC] Don't set -dwarf-use-key-instructions #144115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Once llvm#144104 lands the flag is true by default (because each DISubprogram will track whether or not it's using key instructions).
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Orlando Cazalet-Hyams (OCHyams) ChangesOnce #144104 lands the flag is true by default (because each DISubprogram will track whether or not it's using key instructions). Full diff: https://github.com/llvm/llvm-project/pull/144115.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 8556bcadf0915..e3e79a4894cd7 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -4627,11 +4627,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..8ce140a2ca031 100644
--- a/clang/test/DebugInfo/KeyInstructions/flag.cpp
+++ b/clang/test/DebugInfo/KeyInstructions/flag.cpp
@@ -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
|
@@ -8,8 +8,14 @@ | |||
// HELP-NOT: key-instructions | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an issue with this patch but, with no positive HELP: prefixes, this check passes vacuously.
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is -gkey-instructions
turning -g
on as well; would it not be better to explicitly pass -g
in both cases anyway?
Once #144104 lands the flag is true by default (because each DISubprogram will track whether or not it's using key instructions).