[PATCH] D97706: Make -f[no-]split-dwarf-inlining CC1 default align with driver default (no inlining)

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 1 10:27:48 PST 2021


MaskRay created this revision.
MaskRay added a reviewer: dblaikie.
Herald added subscribers: jansvoboda11, dang.
MaskRay requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Verified that the below is still true:

- `clang -g` => `splitDebugInlining: false` in DICompileUnit
- `clang -g -gsplit-dwarf` => no `splitDebugInlining: false`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97706

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/CodeGen/split-debug-inlining.c
  clang/test/Driver/split-debug.c


Index: clang/test/Driver/split-debug.c
===================================================================
--- clang/test/Driver/split-debug.c
+++ clang/test/Driver/split-debug.c
@@ -7,8 +7,8 @@
 /// -gsplit-dwarf=split is equivalent to -gsplit-dwarf.
 // RUN: %clang -### -c -target x86_64 -gsplit-dwarf=split -g %s 2>&1 | FileCheck %s --check-prefixes=NOINLINE,SPLIT
 
-// INLINE-NOT: "-fno-split-dwarf-inlining"
-// NOINLINE:   "-fno-split-dwarf-inlining"
+// INLINE:     "-fsplit-dwarf-inlining"
+// NOINLINE-NOT: "-fsplit-dwarf-inlining"
 // SPLIT:      "-debug-info-kind=limited"
 // SPLIT-SAME: "-ggnu-pubnames"
 // SPLIT-SAME: "-split-dwarf-file" "split-debug.dwo" "-split-dwarf-output" "split-debug.dwo"
Index: clang/test/CodeGen/split-debug-inlining.c
===================================================================
--- clang/test/CodeGen/split-debug-inlining.c
+++ clang/test/CodeGen/split-debug-inlining.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -debug-info-kind=limited -fno-split-dwarf-inlining -S -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -debug-info-kind=limited -S -emit-llvm -o - %s | FileCheck --check-prefix=ABSENT %s
+// RUN: %clang_cc1 -debug-info-kind=limited -S -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -debug-info-kind=limited -fsplit-dwarf-inlining -S -emit-llvm -o - %s | FileCheck --check-prefix=ABSENT %s
 void f(void) {}
 // Verify that disabling split debug inlining info is propagated to the debug
 // info metadata.
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -3979,8 +3979,8 @@
       }
     }
 
-  if (T.isOSBinFormatELF() && !SplitDWARFInlining)
-    CmdArgs.push_back("-fno-split-dwarf-inlining");
+  if (T.isOSBinFormatELF() && SplitDWARFInlining)
+    CmdArgs.push_back("-fsplit-dwarf-inlining");
 
   // After we've dealt with all combinations of things that could
   // make DebugInfoKind be other than None or DebugLineTablesOnly,
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -2669,9 +2669,9 @@
   PosFlag<SetTrue, [CC1Option], "Use DWARF base address selection entries in .debug_ranges">,
   NegFlag<SetFalse>>;
 defm split_dwarf_inlining : BoolFOption<"split-dwarf-inlining",
-  CodeGenOpts<"SplitDwarfInlining">, DefaultTrue,
-  NegFlag<SetFalse, [CC1Option]>,
-  PosFlag<SetTrue, [], "Provide minimal debug info in the object/executable"
+  CodeGenOpts<"SplitDwarfInlining">, DefaultFalse,
+  NegFlag<SetFalse, []>,
+  PosFlag<SetTrue, [CC1Option], "Provide minimal debug info in the object/executable"
           " to facilitate online symbolication/stack traces in the absence of"
           " .dwo/.dwp files when using Split DWARF">>;
 def fdebug_default_version: Joined<["-"], "fdebug-default-version=">, Group<f_Group>,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97706.327177.patch
Type: text/x-patch
Size: 3008 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210301/24951712/attachment.bin>


More information about the cfe-commits mailing list