]> granicus.if.org Git - clang/commitdiff
[Clang] Remove unused -split-dwarf and obsolete -enable-split-dwarf
authorAaron Puchert <aaron.puchert@sap.com>
Wed, 26 Jun 2019 21:36:35 +0000 (21:36 +0000)
committerAaron Puchert <aaron.puchert@sap.com>
Wed, 26 Jun 2019 21:36:35 +0000 (21:36 +0000)
Summary:
The changes in D59673 made the choice redundant, since we can achieve
single-file split DWARF just by not setting an output file name.
Like llc we can also derive whether to enable Split DWARF from whether
-split-dwarf-file is set, so we don't need the flag at all anymore.

The test CodeGen/split-debug-filename.c distinguished between having set
or not set -enable-split-dwarf with -split-dwarf-file, but we can
probably just always emit the metadata into the IR.

The flag -split-dwarf wasn't used at all anymore.

Reviewers: dblaikie, echristo

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D63167

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364479 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/CodeGenOptions.def
include/clang/Basic/CodeGenOptions.h
include/clang/Driver/CC1Options.td
lib/CodeGen/BackendUtil.cpp
lib/CodeGen/CGDebugInfo.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Frontend/CompilerInvocation.cpp
test/CodeGen/split-debug-filename.c
test/CodeGen/split-debug-output.c
test/CodeGen/split-debug-single-file.c
test/Driver/split-debug.c

index f08828d596e4b81c2de0e57f4814c2e14bdbdb44..cd7a84548765c362b84110ec8b6fdd6b1320658c 100644 (file)
@@ -261,8 +261,6 @@ CODEGENOPT(DebugExplicitImport, 1, 0)  ///< Whether or not debug info should
                                        ///< contain explicit imports for
                                        ///< anonymous namespaces
 
-ENUM_CODEGENOPT(SplitDwarfMode, DwarfFissionKind, 2, NoFission) ///< DWARF fission mode to use.
-
 CODEGENOPT(SplitDwarfInlining, 1, 1) ///< Whether to include inlining info in the
                                      ///< skeleton CU to allow for symbolication
                                      ///< of inline stack frames without .dwo files.
index 2ece9e7f146f53d20bb063de89d40b20efe9f93e..4e9025d2fea9d7e84e1e16eb2eac83c8c16f3988 100644 (file)
@@ -71,8 +71,6 @@ public:
     LocalExecTLSModel
   };
 
-  enum DwarfFissionKind { NoFission, SplitFileFission, SingleFileFission };
-
   /// Clang versions with different platform ABI conformance.
   enum class ClangABI {
     /// Attempt to be ABI-compatible with code generated by Clang 3.8.x
index 10b377e228d2d3beb47c50ea61a8e984927ebff8..8862a015827bda3b9c4088d722d5f17aeeccd07e 100644 (file)
@@ -230,8 +230,6 @@ def disable_red_zone : Flag<["-"], "disable-red-zone">,
   HelpText<"Do not emit code that uses the red zone.">;
 def dwarf_column_info : Flag<["-"], "dwarf-column-info">,
   HelpText<"Turn on column location information.">;
-def split_dwarf : Flag<["-"], "split-dwarf">,
-  HelpText<"Split out the dwarf .dwo sections">;
 def dwarf_ext_refs : Flag<["-"], "dwarf-ext-refs">,
   HelpText<"Generate debug info with external references to clang modules"
            " or precompiled headers">;
@@ -694,10 +692,6 @@ def fblocks_runtime_optional : Flag<["-"], "fblocks-runtime-optional">,
   HelpText<"Weakly link in the blocks runtime">;
 def fexternc_nounwind : Flag<["-"], "fexternc-nounwind">,
   HelpText<"Assume all functions with C linkage do not unwind">;
-def enable_split_dwarf : Flag<["-"], "enable-split-dwarf">,
-  HelpText<"Use DWARF fission in 'split' mode">;
-def enable_split_dwarf_EQ : Joined<["-"], "enable-split-dwarf=">,
-  HelpText<"Set DWARF fission mode to either 'split' or 'single'">, Values<"split,single">;
 def split_dwarf_file : Separate<["-"], "split-dwarf-file">,
   HelpText<"Name of the split dwarf debug info file to encode in the object file">;
 def fno_wchar : Flag<["-"], "fno-wchar">,
index 5fe4f145dadfb38c6fd392f5ee038e027f8cc9b4..5d66473e7b9a247950a415f678a03917e8beca08 100644 (file)
@@ -473,8 +473,7 @@ static void initTargetOptions(llvm::TargetOptions &Options,
   Options.EmitAddrsig = CodeGenOpts.Addrsig;
   Options.EnableDebugEntryValues = CodeGenOpts.EnableDebugEntryValues;
 
-  if (CodeGenOpts.getSplitDwarfMode() != CodeGenOptions::NoFission)
-    Options.MCOptions.SplitDwarfFile = CodeGenOpts.SplitDwarfFile;
+  Options.MCOptions.SplitDwarfFile = CodeGenOpts.SplitDwarfFile;
   Options.MCOptions.MCRelaxAll = CodeGenOpts.RelaxAll;
   Options.MCOptions.MCSaveTempLabels = CodeGenOpts.SaveTempLabels;
   Options.MCOptions.MCUseDwarfDirectory = !CodeGenOpts.NoDwarfDirectoryAsm;
@@ -864,8 +863,7 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
     break;
 
   default:
-    if (!CodeGenOpts.SplitDwarfOutput.empty() &&
-        (CodeGenOpts.getSplitDwarfMode() == CodeGenOptions::SplitFileFission)) {
+    if (!CodeGenOpts.SplitDwarfOutput.empty()) {
       DwoOS = openOutputFile(CodeGenOpts.SplitDwarfOutput);
       if (!DwoOS)
         return;
@@ -1282,8 +1280,7 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
     NeedCodeGen = true;
     CodeGenPasses.add(
         createTargetTransformInfoWrapperPass(getTargetIRAnalysis()));
-    if (!CodeGenOpts.SplitDwarfOutput.empty() &&
-        CodeGenOpts.getSplitDwarfMode() == CodeGenOptions::SplitFileFission) {
+    if (!CodeGenOpts.SplitDwarfOutput.empty()) {
       DwoOS = openOutputFile(CodeGenOpts.SplitDwarfOutput);
       if (!DwoOS)
         return;
index e8a6762d2b830e05d67062b5a465e58e83e15d13..eb0034e70833505cf11a5fc015ccedcf16052699 100644 (file)
@@ -615,9 +615,7 @@ void CGDebugInfo::CreateCompileUnit() {
       LangTag, CUFile, CGOpts.EmitVersionIdentMetadata ? Producer : "",
       LO.Optimize || CGOpts.PrepareForLTO || CGOpts.PrepareForThinLTO,
       CGOpts.DwarfDebugFlags, RuntimeVers,
-      (CGOpts.getSplitDwarfMode() != CodeGenOptions::NoFission)
-          ? ""
-          : CGOpts.SplitDwarfFile,
+      CGOpts.SplitDwarfFile,
       EmissionKind, DwoId, CGOpts.SplitDwarfInlining,
       CGOpts.DebugInfoForProfiling,
       CGM.getTarget().getTriple().isNVPTX()
index 3e7158ae80b56df2fb2ae6f0e43a3bc104247884..f292944a2eff6167ab95fbd359ba2b196cbaddaf 100644 (file)
@@ -3292,18 +3292,8 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
       }
     }
 
-  // -gsplit-dwarf enables the backend dwarf splitting and extraction.
-  if (T.isOSBinFormatELF()) {
-    if (!SplitDWARFInlining)
-      CmdArgs.push_back("-fno-split-dwarf-inlining");
-
-    if (DwarfFission != DwarfFissionKind::None) {
-      if (DwarfFission == DwarfFissionKind::Single)
-        CmdArgs.push_back("-enable-split-dwarf=single");
-      else
-        CmdArgs.push_back("-enable-split-dwarf");
-    }
-  }
+  if (T.isOSBinFormatELF() && !SplitDWARFInlining)
+    CmdArgs.push_back("-fno-split-dwarf-inlining");
 
   // After we've dealt with all combinations of things that could
   // make DebugInfoKind be other than None or DebugLineTablesOnly,
index cdb6d735364a6156e891bd52935e10e8b4e0de2b..ddaf13ff0d378092bc1307fbd55721fc0bba88e8 100644 (file)
@@ -729,23 +729,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
   Opts.SplitDwarfFile = Args.getLastArgValue(OPT_split_dwarf_file);
   Opts.SplitDwarfOutput = Args.getLastArgValue(OPT_split_dwarf_output);
   Opts.SplitDwarfInlining = !Args.hasArg(OPT_fno_split_dwarf_inlining);
-
-  if (Arg *A =
-          Args.getLastArg(OPT_enable_split_dwarf, OPT_enable_split_dwarf_EQ)) {
-    if (A->getOption().matches(options::OPT_enable_split_dwarf)) {
-      Opts.setSplitDwarfMode(CodeGenOptions::SplitFileFission);
-    } else {
-      StringRef Name = A->getValue();
-      if (Name == "single")
-        Opts.setSplitDwarfMode(CodeGenOptions::SingleFileFission);
-      else if (Name == "split")
-        Opts.setSplitDwarfMode(CodeGenOptions::SplitFileFission);
-      else
-        Diags.Report(diag::err_drv_invalid_value)
-            << A->getAsString(Args) << Name;
-    }
-  }
-
   Opts.DebugTypeExtRefs = Args.hasArg(OPT_dwarf_ext_refs);
   Opts.DebugExplicitImport = Args.hasArg(OPT_dwarf_explicit_import);
   Opts.DebugFwdTemplateParams = Args.hasArg(OPT_debug_forward_template_params);
index ff45ad61791313a7876487d300bc608defd7c5ec..5a0562c8456b4079f80200ff26e36bdd4a1e2b5a 100644 (file)
@@ -1,7 +1,6 @@
 // REQUIRES: x86-registered-target
 // RUN: %clang_cc1 -debug-info-kind=limited -split-dwarf-file foo.dwo -S -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -debug-info-kind=limited -enable-split-dwarf -split-dwarf-file foo.dwo -S -emit-llvm -o - %s | FileCheck --check-prefix=VANILLA %s
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -enable-split-dwarf -split-dwarf-file %t.dwo -split-dwarf-output %t.dwo -emit-obj -o - %s | llvm-readobj -S - | FileCheck --check-prefix=O %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -split-dwarf-file %t.dwo -split-dwarf-output %t.dwo -emit-obj -o - %s | llvm-readobj -S - | FileCheck --check-prefix=O %s
 // RUN: llvm-readobj -S %t.dwo | FileCheck --check-prefix=DWO %s
 
 int main (void) {
@@ -11,9 +10,5 @@ int main (void) {
 // Testing to ensure that the dwo name gets output into the compile unit.
 // CHECK: !DICompileUnit({{.*}}, splitDebugFilename: "foo.dwo"
 
-// Testing to ensure that the dwo name is not output into the compile unit if
-// it's for vanilla split-dwarf rather than split-dwarf for implicit modules.
-// VANILLA-NOT: splitDebugFilename
-
 // O-NOT: .dwo
 // DWO: .dwo
index e312dd9cc845a0d847a0887827de595706334983..1507edd248492fbe75738053018d04c3d86629ca 100644 (file)
@@ -1,5 +1,5 @@
 // REQUIRES: x86-registered-target
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -enable-split-dwarf -split-dwarf-file foo.dwo -split-dwarf-output %t -emit-obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -split-dwarf-file foo.dwo -split-dwarf-output %t -emit-obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck %s
 // RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
 
 int f() { return 0; }
index a963ef577ac358936bdd78cad852d014d5ce6193..384e62cb50a598ba80ebd50dc2cd122982c9bf5a 100644 (file)
@@ -1,20 +1,21 @@
 // REQUIRES: x86-registered-target
 
-// Testing to ensure -enable-split-dwarf=single allows to place .dwo sections into regular output object.
+// Testing to ensure that setting only -split-dwarf-file allows to place .dwo sections into regular output object.
 //  RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
-//  RUN:   -enable-split-dwarf=single -split-dwarf-file %t.o -emit-obj -o %t.o %s -fno-experimental-new-pass-manager
+//  RUN:   -split-dwarf-file %t.o -emit-obj -o %t.o %s -fno-experimental-new-pass-manager
 //  RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SINGLE %s
 //  RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
-//  RUN:   -enable-split-dwarf=single -split-dwarf-file %t.o -emit-obj -o %t.o %s -fexperimental-new-pass-manager
+//  RUN:   -split-dwarf-file %t.o -emit-obj -o %t.o %s -fexperimental-new-pass-manager
 //  RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SINGLE %s
 //  MODE-SINGLE: .dwo
 
-// Testing to ensure -enable-split-dwarf=split does not place .dwo sections into regular output object.
+// Testing to ensure that setting both -split-dwarf-file and -split-dwarf-output
+// does not place .dwo sections into regular output object.
 //  RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
-//  RUN:   -enable-split-dwarf=split -split-dwarf-file %t.dwo -split-dwarf-output %t.dwo -emit-obj -o %t.o %s -fno-experimental-new-pass-manager
+//  RUN:   -split-dwarf-file %t.dwo -split-dwarf-output %t.dwo -emit-obj -o %t.o %s -fno-experimental-new-pass-manager
 //  RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SPLIT %s
 //  RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
-//  RUN:   -enable-split-dwarf=split -split-dwarf-file %t.dwo -split-dwarf-output %t.dwo -emit-obj -o %t.o %s -fexperimental-new-pass-manager
+//  RUN:   -split-dwarf-file %t.dwo -split-dwarf-output %t.dwo -emit-obj -o %t.o %s -fexperimental-new-pass-manager
 //  RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SPLIT %s
 //  MODE-SPLIT-NOT: .dwo
 
index 05861ea280d3e50484ad6ee681486908e1d62dce..860aebb526fc4c8687a5d09022e9ee219c0878b2 100644 (file)
@@ -13,7 +13,6 @@
 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### %s 2> %t
 // RUN: FileCheck -check-prefix=CHECK-ACTIONS-SINGLE-SPLIT < %t %s
 //
-// CHECK-ACTIONS-SINGLE-SPLIT: "-enable-split-dwarf=single"
 // CHECK-ACTIONS-SINGLE-SPLIT: "-split-dwarf-file" "split-debug.o"
 // CHECK-ACTIONS-SINGLE-SPLIT-NOT: "-split-dwarf-output"
 
@@ -58,7 +57,6 @@
 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -fno-split-dwarf-inlining -S -### %s 2> %t
 // RUN: FileCheck -check-prefix=CHECK-GMLT-WITH-SPLIT < %t %s
 //
-// CHECK-GMLT-WITH-SPLIT: "-enable-split-dwarf"
 // CHECK-GMLT-WITH-SPLIT: "-debug-info-kind=line-tables-only"
 // CHECK-GMLT-WITH-SPLIT: "-split-dwarf-file"
 // CHECK-GMLT-WITH-SPLIT: "-split-dwarf-output"
 // RUN: %clang -target x86_64-unknown-linux-gnu -g -fno-split-dwarf-inlining -S -### %s 2> %t
 // RUN: FileCheck -check-prefix=CHECK-NOINLINE-WITHOUT-SPLIT < %t %s
 //
-// CHECK-NOINLINE-WITHOUT-SPLIT-NOT: "-enable-split-dwarf"
 // CHECK-NOINLINE-WITHOUT-SPLIT: "-fno-split-dwarf-inlining"
 // CHECK-NOINLINE-WITHOUT-SPLIT: "-debug-info-kind=limited"
 
 // RUN: %clang -target x86_64-unknown-linux-gnu -gmlt -gsplit-dwarf -fno-split-dwarf-inlining -S -### %s 2> %t
 // RUN: FileCheck -check-prefix=CHECK-SPLIT-WITH-GMLT < %t %s
 //
-// CHECK-SPLIT-WITH-GMLT: "-enable-split-dwarf"
 // CHECK-SPLIT-WITH-GMLT: "-debug-info-kind=limited"
 // CHECK-SPLIT-WITH-GMLT: "-split-dwarf-output"
 
 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -fno-split-dwarf-inlining -S -### %s 2> %t
 // RUN: FileCheck -check-prefix=CHECK-SPLIT-WITH-NOINL < %t %s
 //
-// CHECK-SPLIT-WITH-NOINL: "-enable-split-dwarf"
 // CHECK-SPLIT-WITH-NOINL: "-debug-info-kind=limited"
 // CHECK-SPLIT-WITH-NOINL: "-split-dwarf-output"
 
 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -S -### %s 2> %t
 // RUN: FileCheck -check-prefix=CHECK-GMLT-OVER-SPLIT < %t %s
 //
-// CHECK-GMLT-OVER-SPLIT-NOT: "-enable-split-dwarf"
 // CHECK-GMLT-OVER-SPLIT: "-debug-info-kind=line-tables-only"
 // CHECK-GMLT-OVER-SPLIT-NOT: "-split-dwarf-file"
 // CHECK-GMLT-OVER-SPLIT-NOT: "-split-dwarf-output"
 // RUN: %clang -target x86_64-unknown-linux-gnu -gmlt -gsplit-dwarf -S -### %s 2> %t
 // RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-GMLT < %t %s
 //
-// CHECK-SPLIT-OVER-GMLT: "-enable-split-dwarf" "-debug-info-kind=limited"
+// CHECK-SPLIT-OVER-GMLT: "-debug-info-kind=limited"
 // CHECK-SPLIT-OVER-GMLT: "-split-dwarf-file"
 // CHECK-SPLIT-OVER-GMLT: "-split-dwarf-output"
 
 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -g0 -fno-split-dwarf-inlining -S -### %s 2> %t
 // RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
 //
-// CHECK-G0-OVER-SPLIT-NOT: "-enable-split-dwarf"
 // CHECK-G0-OVER-SPLIT-NOT: "-debug-info-kind
 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-file"
 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-output"
 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -g0 -S -### %s 2> %t
 // RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
 //
-// CHECK-G0-OVER-SPLIT-NOT: "-enable-split-dwarf"
 // CHECK-G0-OVER-SPLIT-NOT: "-debug-info-kind
 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-file"
 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-output"
 // RUN: %clang -target x86_64-unknown-linux-gnu -g0 -gsplit-dwarf=split -S -### %s 2> %t
 // RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-G0 < %t %s
 //
-// CHECK-SPLIT-OVER-G0: "-enable-split-dwarf" "-debug-info-kind=limited"
+// CHECK-SPLIT-OVER-G0: "-debug-info-kind=limited"
 // CHECK-SPLIT-OVER-G0: "-split-dwarf-file"
 // CHECK-SPLIT-OVER-G0: "-split-dwarf-output"