Skip to content

Commit b29fea6

Browse files
authored
[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).
1 parent be75ded commit b29fea6

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4631,11 +4631,8 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T,
46314631
}
46324632

46334633
if (Args.hasFlag(options::OPT_gkey_instructions,
4634-
options::OPT_gno_key_instructions, false)) {
4634+
options::OPT_gno_key_instructions, false))
46354635
CmdArgs.push_back("-gkey-instructions");
4636-
CmdArgs.push_back("-mllvm");
4637-
CmdArgs.push_back("-dwarf-use-key-instructions");
4638-
}
46394636

46404637
if (EmitCodeView) {
46414638
CmdArgs.push_back("-gcodeview");

clang/test/DebugInfo/KeyInstructions/flag.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@
33
//// Default: Off.
44
// RUN: %clang -### -target x86_64 -c -gdwarf %s 2>&1 | FileCheck %s --check-prefixes=NO-KEY-INSTRUCTIONS
55

6-
//// Help hidden.
7-
// RUN %clang --help | FileCheck %s --check-prefix=HELP
8-
// HELP-NOT: key-instructions
9-
106
// KEY-INSTRUCTIONS: "-gkey-instructions"
11-
// KEY-INSTRUCTIONS: "-mllvm" "-dwarf-use-key-instructions"
12-
137
// NO-KEY-INSTRUCTIONS-NOT: key-instructions
148

15-
//// TODO: Add smoke test once some functionality has been added.
9+
//// Help hidden: flag should not be visible.
10+
// RUN: %clang --help | FileCheck %s --check-prefix=HELP
11+
// HELP-NOT: key-instructions
12+
13+
// Smoke test: check for Key Instructions keywords in the IR.
14+
void f() {}
15+
// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -debug-info-kind=line-tables-only -emit-llvm -o - | FileCheck %s --check-prefix=SMOKETEST-OFF
16+
// SMOKETEST-OFF-NOT: keyInstructions:
17+
// SMOKETEST-OFF-NOT: atomGroup
18+
19+
// 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
20+
// SMOKETEST-ON: keyInstructions: true
21+
// SMOKETEST-ON: atomGroup: 1

0 commit comments

Comments
 (0)