[PATCH] D136187: [clang][AIX] Omitting Explicit Debugger Tuning Option
Qiongsi Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 18 11:01:12 PDT 2022
qiongsiwu1 updated this revision to Diff 468626.
qiongsiwu1 added a comment.
Adding one more test case.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136187/new/
https://reviews.llvm.org/D136187
Files:
clang/lib/Driver/ToolChains/AIX.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/debug-options.c
Index: clang/test/Driver/debug-options.c
===================================================================
--- clang/test/Driver/debug-options.c
+++ clang/test/Driver/debug-options.c
@@ -116,17 +116,25 @@
// RUN: %clang -### %s -g -target x86_64-scei-ps5 2>&1 \
// RUN: | FileCheck -check-prefix=LDGARANGE %s
-// On the AIX, -g defaults to -gdbx and limited debug info.
+// On the AIX, -g defaults to limited debug info.
// RUN: %clang -### -c -g %s -target powerpc-ibm-aix-xcoff 2>&1 \
-// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_DBX %s
+// RUN: | FileCheck -check-prefix=G_LIMITED %s
// RUN: %clang -### -c -g %s -target powerpc64-ibm-aix-xcoff 2>&1 \
-// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_DBX %s
+// RUN: | FileCheck -check-prefix=G_LIMITED %s
+// RUN: %clang -### -c -g -gdbx %s -target powerpc-ibm-aix-xcoff 2>&1 \
+// RUN: | FileCheck -check-prefixes=G_LIMITED,G_DBX %s
+// RUN: %clang -### -c -g -gdbx %s -target powerpc64-ibm-aix-xcoff 2>&1 \
+// RUN: | FileCheck -check-prefixes=G_LIMITED,G_DBX %s
// For DBX, -g defaults to -gstrict-dwarf.
// RUN: %clang -### -c -g %s -target powerpc-ibm-aix-xcoff 2>&1 \
// RUN: | FileCheck -check-prefix=STRICT %s
// RUN: %clang -### -c -g %s -target powerpc64-ibm-aix-xcoff 2>&1 \
// RUN: | FileCheck -check-prefix=STRICT %s
+// RUN: %clang -### -c -g -gdbx %s -target powerpc-ibm-aix-xcoff 2>&1 \
+// RUN: | FileCheck -check-prefix=STRICT %s
+// RUN: %clang -### -c -g -gdbx %s -target powerpc64-ibm-aix-xcoff 2>&1 \
+// RUN: | FileCheck -check-prefix=STRICT %s
// RUN: %clang -### -c -g -gno-strict-dwarf %s -target powerpc-ibm-aix-xcoff \
// RUN: 2>&1 | FileCheck -check-prefix=NOSTRICT %s
// RUN: %clang -### -c -g %s -target x86_64-linux-gnu 2>&1 \
@@ -143,6 +151,10 @@
// RUN: | FileCheck -check-prefix=CI %s
// RUN: %clang -### -c -g %s -target powerpc64-ibm-aix-xcoff -gcolumn-info \
// RUN: 2>&1 | FileCheck -check-prefix=CI %s
+// RUN: %clang -### -c -g -gdbx %s -target powerpc-ibm-aix-xcoff \
+// RUN: -gcolumn-info 2>&1 | FileCheck -check-prefix=CI %s
+// RUN: %clang -### -c -g -gdbx %s -target powerpc64-ibm-aix-xcoff \
+// RUN: -gcolumn-info 2>&1 | FileCheck -check-prefix=CI %s
// WebAssembly.
// WebAssembly should default to DWARF4.
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4259,13 +4259,17 @@
DebugInfoKind == codegenoptions::DebugDirectivesOnly)
DebugInfoKind = codegenoptions::NoDebugInfo;
+ const bool UseDBX =
+ DebuggerTuning == llvm::DebuggerKind::DBX ||
+ (DebuggerTuning == llvm::DebuggerKind::Default && T.isOSAIX());
// strict DWARF is set to false by default. But for DBX, we need it to be set
// as true by default.
if (const Arg *A = Args.getLastArg(options::OPT_gstrict_dwarf))
(void)checkDebugInfoOption(A, Args, D, TC);
if (Args.hasFlag(options::OPT_gstrict_dwarf, options::OPT_gno_strict_dwarf,
- DebuggerTuning == llvm::DebuggerKind::DBX))
+ UseDBX)) {
CmdArgs.push_back("-gstrict-dwarf");
+ }
// And we handle flag -grecord-gcc-switches later with DWARFDebugFlags.
Args.ClaimAllArgs(options::OPT_g_flags_Group);
@@ -4280,8 +4284,7 @@
(void)checkDebugInfoOption(A, Args, D, TC);
if (!Args.hasFlag(options::OPT_gcolumn_info, options::OPT_gno_column_info,
!EmitCodeView &&
- (DebuggerTuning != llvm::DebuggerKind::SCE &&
- DebuggerTuning != llvm::DebuggerKind::DBX)))
+ (DebuggerTuning != llvm::DebuggerKind::SCE && !UseDBX)))
CmdArgs.push_back("-gno-column-info");
// FIXME: Move backend command line options to the module.
Index: clang/lib/Driver/ToolChains/AIX.h
===================================================================
--- clang/lib/Driver/ToolChains/AIX.h
+++ clang/lib/Driver/ToolChains/AIX.h
@@ -88,7 +88,7 @@
unsigned GetDefaultDwarfVersion() const override { return 3; }
llvm::DebuggerKind getDefaultDebuggerTuning() const override {
- return llvm::DebuggerKind::DBX;
+ return llvm::DebuggerKind::Default;
}
protected:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136187.468626.patch
Type: text/x-patch
Size: 4460 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221018/a5894215/attachment.bin>
More information about the cfe-commits
mailing list