[lldb] [clang] [llvm] [clang] Split out DebugOptions.def into its own top-level options group. (PR #75530)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 13:10:49 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Juergen Ributzka (ributzka)

<details>
<summary>Changes</summary>

This change moves all debug options out of the CodeGenOptions and creates a
dedicated top-level DebugOptions data struture. All uses of the debug options
are updated to reference the new location. No functional changes are intented
with this change.


---

Patch is 179.17 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/75530.diff


50 Files Affected:

- (modified) clang/include/clang/Basic/CodeGenOptions.def (-3) 
- (modified) clang/include/clang/Basic/CodeGenOptions.h (+1-50) 
- (modified) clang/include/clang/Basic/DebugOptions.def (+7-8) 
- (added) clang/include/clang/Basic/DebugOptions.h (+111) 
- (modified) clang/include/clang/Basic/TargetInfo.h (-2) 
- (modified) clang/include/clang/CodeGen/BackendUtil.h (+4-2) 
- (modified) clang/include/clang/CodeGen/ModuleBuilder.h (+2-1) 
- (modified) clang/include/clang/Driver/Options.td (+35-33) 
- (modified) clang/include/clang/Driver/ToolChain.h (+3-3) 
- (modified) clang/include/clang/Frontend/CompilerInstance.h (+9-6) 
- (modified) clang/include/clang/Frontend/CompilerInvocation.h (+30-11) 
- (modified) clang/lib/Basic/CMakeLists.txt (+1) 
- (modified) clang/lib/Basic/CodeGenOptions.cpp (+2-35) 
- (added) clang/lib/Basic/DebugOptions.cpp (+40) 
- (modified) clang/lib/CodeGen/BackendConsumer.h (+8-5) 
- (modified) clang/lib/CodeGen/BackendUtil.cpp (+56-47) 
- (modified) clang/lib/CodeGen/CGBlocks.cpp (+3-2) 
- (modified) clang/lib/CodeGen/CGDebugInfo.cpp (+108-112) 
- (modified) clang/lib/CodeGen/CGDebugInfo.h (+2-2) 
- (modified) clang/lib/CodeGen/CGDecl.cpp (+4-3) 
- (modified) clang/lib/CodeGen/CGHLSLRuntime.cpp (+3-2) 
- (modified) clang/lib/CodeGen/CGOpenMPRuntime.cpp (+10-12) 
- (modified) clang/lib/CodeGen/CGStmt.cpp (+3-2) 
- (modified) clang/lib/CodeGen/CGStmtOpenMP.cpp (+4-3) 
- (modified) clang/lib/CodeGen/CGVTables.cpp (+14-14) 
- (modified) clang/lib/CodeGen/CodeGenAction.cpp (+54-55) 
- (modified) clang/lib/CodeGen/CodeGenFunction.cpp (+3-2) 
- (modified) clang/lib/CodeGen/CodeGenModule.cpp (+16-15) 
- (modified) clang/lib/CodeGen/CodeGenModule.h (+5-1) 
- (modified) clang/lib/CodeGen/ModuleBuilder.cpp (+10-8) 
- (modified) clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp (+15-14) 
- (modified) clang/lib/Driver/ToolChains/Clang.cpp (+35-35) 
- (modified) clang/lib/Driver/ToolChains/CommonArgs.cpp (+13-13) 
- (modified) clang/lib/Driver/ToolChains/CommonArgs.h (+2-3) 
- (modified) clang/lib/Driver/ToolChains/Cuda.cpp (+3-3) 
- (modified) clang/lib/Driver/ToolChains/Cuda.h (+1-1) 
- (modified) clang/lib/Driver/ToolChains/Flang.cpp (+3-3) 
- (modified) clang/lib/Driver/ToolChains/HIPSPV.cpp (+2-2) 
- (modified) clang/lib/Driver/ToolChains/HIPSPV.h (+1-1) 
- (modified) clang/lib/Driver/ToolChains/MSVC.h (+3-4) 
- (modified) clang/lib/Frontend/CompilerInstance.cpp (+9-11) 
- (modified) clang/lib/Frontend/CompilerInvocation.cpp (+113-89) 
- (modified) clang/lib/Frontend/Rewrite/FrontendActions.cpp (+2-2) 
- (modified) clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp (+2-2) 
- (modified) clang/tools/clang-import-test/clang-import-test.cpp (+2-2) 
- (modified) clang/unittests/CodeGen/TestCompiler.h (+2-1) 
- (modified) clang/unittests/Frontend/CodeGenActionTest.cpp (+1-1) 
- (modified) clang/unittests/Frontend/CompilerInvocationTest.cpp (+9-9) 
- (modified) lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp (+1-1) 
- (modified) llvm/include/llvm/Frontend/Debug/Options.h (+2-2) 


``````````diff
diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def
index 0acb5ae134ea24..7508163458c42b 100644
--- a/clang/include/clang/Basic/CodeGenOptions.def
+++ b/clang/include/clang/Basic/CodeGenOptions.def
@@ -430,9 +430,6 @@ ENUM_CODEGENOPT(ZeroCallUsedRegs, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind,
 /// non-deleting destructors. (No effect on Microsoft ABI.)
 CODEGENOPT(CtorDtorReturnThis, 1, 0)
 
-/// FIXME: Make DebugOptions its own top-level .def file.
-#include "DebugOptions.def"
-
 #undef CODEGENOPT
 #undef ENUM_CODEGENOPT
 #undef VALUE_CODEGENOPT
diff --git a/clang/include/clang/Basic/CodeGenOptions.h b/clang/include/clang/Basic/CodeGenOptions.h
index 6952b48e898a81..6db8c73a66b18a 100644
--- a/clang/include/clang/Basic/CodeGenOptions.h
+++ b/clang/include/clang/Basic/CodeGenOptions.h
@@ -15,15 +15,11 @@
 
 #include "clang/Basic/Sanitizers.h"
 #include "clang/Basic/XRayInstr.h"
-#include "llvm/ADT/FloatingPointMode.h"
-#include "llvm/Frontend/Debug/Options.h"
 #include "llvm/Frontend/Driver/CodeGenOptions.h"
 #include "llvm/Support/CodeGen.h"
 #include "llvm/Support/Regex.h"
 #include "llvm/Target/TargetOptions.h"
 #include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
-#include <map>
-#include <memory>
 #include <string>
 #include <vector>
 
@@ -98,12 +94,6 @@ class CodeGenOptions : public CodeGenOptionsBase {
     IAD_Intel,
   };
 
-  enum DebugSrcHashKind {
-    DSH_MD5,
-    DSH_SHA1,
-    DSH_SHA256,
-  };
-
   // This field stores one of the allowed values for the option
   // -fbasic-block-sections=.  The allowed values with this option are:
   // {"labels", "all", "list=<file>", "none"}.
@@ -158,12 +148,6 @@ class CodeGenOptions : public CodeGenOptionsBase {
     Never,    // No loop is assumed to be finite.
   };
 
-  enum AssignmentTrackingOpts {
-    Disabled,
-    Enabled,
-    Forced,
-  };
-
   /// The code model to use (-mcmodel).
   std::string CodeModel;
 
@@ -191,22 +175,13 @@ class CodeGenOptions : public CodeGenOptionsBase {
   /// Enable additional debugging information.
   std::string DebugPass;
 
-  /// The string to embed in debug information as the current working directory.
-  std::string DebugCompilationDir;
-
   /// The string to embed in coverage mapping as the current working directory.
   std::string CoverageCompilationDir;
 
-  /// The string to embed in the debug information for the compile unit, if
-  /// non-empty.
-  std::string DwarfDebugFlags;
-
   /// The string containing the commandline for the llvm.commandline metadata,
   /// if non-empty.
   std::string RecordCommandLine;
 
-  llvm::SmallVector<std::pair<std::string, std::string>, 0> DebugPrefixMap;
-
   /// Prefix replacement map for source-based code coverage to remap source
   /// file paths in coverage mapping.
   llvm::SmallVector<std::pair<std::string, std::string>, 0> CoveragePrefixMap;
@@ -214,10 +189,6 @@ class CodeGenOptions : public CodeGenOptionsBase {
   /// The ABI to use for passing floating point arguments.
   std::string FloatABI;
 
-  /// The file to use for dumping bug report by `Debugify` for original
-  /// debug info.
-  std::string DIBugsReportFilePath;
-
   /// The floating-point denormal mode to use.
   llvm::DenormalMode FPDenormalMode = llvm::DenormalMode::getIEEE();
 
@@ -248,16 +219,6 @@ class CodeGenOptions : public CodeGenOptionsBase {
   /// file, for example with -save-temps.
   std::string MainFileName;
 
-  /// The name for the split debug info file used for the DW_AT_[GNU_]dwo_name
-  /// attribute in the skeleton CU.
-  std::string SplitDwarfFile;
-
-  /// Output filename for the split debug info, not used in the skeleton CU.
-  std::string SplitDwarfOutput;
-
-  /// Output filename used in the COFF debug information.
-  std::string ObjectFilenameForDebug;
-
   /// The name of the relocation model to use.
   llvm::Reloc::Model RelocationModel;
 
@@ -508,16 +469,6 @@ class CodeGenOptions : public CodeGenOptionsBase {
   /// Check if CSIR profile use is on.
   bool hasProfileCSIRUse() const { return getProfileUse() == ProfileCSIRInstr; }
 
-  /// Check if type and variable info should be emitted.
-  bool hasReducedDebugInfo() const {
-    return getDebugInfo() >= llvm::codegenoptions::DebugInfoConstructor;
-  }
-
-  /// Check if maybe unused type info should be emitted.
-  bool hasMaybeUnusedDebugInfo() const {
-    return getDebugInfo() >= llvm::codegenoptions::UnusedTypeInfo;
-  }
-
   // Check if any one of SanitizeCoverage* is enabled.
   bool hasSanitizeCoverage() const {
     return SanitizeCoverageType || SanitizeCoverageIndirectCalls ||
@@ -533,7 +484,7 @@ class CodeGenOptions : public CodeGenOptionsBase {
 
   /// Reset all of the options that are not considered when building a
   /// module.
-  void resetNonModularOptions(StringRef ModuleFormat);
+  void resetNonModularOptions();
 };
 
 }  // end namespace clang
diff --git a/clang/include/clang/Basic/DebugOptions.def b/clang/include/clang/Basic/DebugOptions.def
index 7cd3edf08a17ea..7bcbad36873c68 100644
--- a/clang/include/clang/Basic/DebugOptions.def
+++ b/clang/include/clang/Basic/DebugOptions.def
@@ -17,18 +17,17 @@
 //
 //===----------------------------------------------------------------------===//
 #ifndef DEBUGOPT
-#define DEBUGOPT(Name, Bits, Default) \
-CODEGENOPT(Name, Bits, Default)
+#   error Define the DEBUGOPT macro to handle debug options
 #endif
 
 #ifndef VALUE_DEBUGOPT
 #  define VALUE_DEBUGOPT(Name, Bits, Default) \
-VALUE_CODEGENOPT(Name, Bits, Default)
+DEBUGOPT(Name, Bits, Default)
 #endif
 
 #ifndef ENUM_DEBUGOPT
 #  define ENUM_DEBUGOPT(Name, Type, Bits, Default) \
-ENUM_CODEGENOPT(Name, Type, Bits, Default)
+DEBUGOPT(Name, Bits, Default)
 #endif
 
 #ifndef BENIGN_DEBUGOPT
@@ -94,16 +93,16 @@ DEBUGOPT(DebugFwdTemplateParams, 1, 0) ///< Whether to emit complete
                                        ///< forward declarations (versus just
                                        ///< including them in the name).
 ENUM_DEBUGOPT(DebugSimpleTemplateNames,
-              llvm::codegenoptions::DebugTemplateNamesKind, 2,
-              llvm::codegenoptions::DebugTemplateNamesKind::Full)
+              llvm::debugoptions::DebugTemplateNamesKind, 2,
+              llvm::debugoptions::DebugTemplateNamesKind::Full)
               ///< Whether to emit template parameters in the textual names of
               ///< template specializations.
 			  ///< Implies DebugFwdTemplateNames to allow decorated names to be
 			  ///< reconstructed when needed.
 
 /// The kind of generated debug info.
-ENUM_DEBUGOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4,
-              llvm::codegenoptions::NoDebugInfo)
+ENUM_DEBUGOPT(DebugInfo, llvm::debugoptions::DebugInfoKind, 4,
+              llvm::debugoptions::NoDebugInfo)
 
 /// Whether to generate macro debug info.
 DEBUGOPT(MacroDebugInfo, 1, 0)
diff --git a/clang/include/clang/Basic/DebugOptions.h b/clang/include/clang/Basic/DebugOptions.h
new file mode 100644
index 00000000000000..f89e43c862349b
--- /dev/null
+++ b/clang/include/clang/Basic/DebugOptions.h
@@ -0,0 +1,111 @@
+//===--- DebugOptions.h -----------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+//  This file defines the DebugOptions interface.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_BASIC_DEBUGOPTIONS_H
+#define LLVM_CLANG_BASIC_DEBUGOPTIONS_H
+
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/Frontend/Debug/Options.h"
+#include "llvm/MC/MCTargetOptions.h"
+#include "llvm/Support/Compression.h"
+#include "llvm/Target/TargetOptions.h"
+#include <string>
+
+namespace clang {
+
+/// Bitfields of DebugOptions, split out from DebugOptions to ensure
+/// that this large collection of bitfields is a trivial class type.
+class DebugOptionsBase {
+  friend class CompilerInvocation;
+  friend class CompilerInvocationBase;
+
+public:
+#define DEBUGOPT(Name, Bits, Default) unsigned Name : Bits;
+#define ENUM_DEBUGOPT(Name, Type, Bits, Default)
+#include "clang/Basic/DebugOptions.def"
+
+protected:
+#define DEBUGOPT(Name, Bits, Default)
+#define ENUM_DEBUGOPT(Name, Type, Bits, Default) unsigned Name : Bits;
+#include "clang/Basic/DebugOptions.def"
+};
+
+/// DebugOptions - Track various options which control how the debug information
+/// is generated for the backend.
+class DebugOptions : public DebugOptionsBase {
+public:
+  enum DebugSrcHashKind {
+    DSH_MD5,
+    DSH_SHA1,
+    DSH_SHA256,
+  };
+
+  /// Enable additional debugging information.
+  std::string DebugPass;
+
+  /// The string to embed in debug information as the current working directory.
+  std::string DebugCompilationDir;
+
+  /// The string to embed in the debug information for the compile unit, if
+  /// non-empty.
+  std::string DwarfDebugFlags;
+
+  enum AssignmentTrackingOpts {
+    Disabled,
+    Enabled,
+    Forced,
+  };
+
+  llvm::SmallVector<std::pair<std::string, std::string>, 0> DebugPrefixMap;
+
+  /// The file to use for dumping bug report by `Debugify` for original
+  /// debug info.
+  std::string DIBugsReportFilePath;
+
+  /// The name for the split debug info file used for the DW_AT_[GNU_]dwo_name
+  /// attribute in the skeleton CU.
+  std::string SplitDwarfFile;
+
+  /// Output filename for the split debug info, not used in the skeleton CU.
+  std::string SplitDwarfOutput;
+
+  /// Output filename used in the COFF debug information.
+  std::string ObjectFilenameForDebug;
+
+public:
+  // Define accessors/mutators for code generation options of enumeration type.
+#define DEBUGOPT(Name, Bits, Default)
+#define ENUM_DEBUGOPT(Name, Type, Bits, Default)                               \
+  Type get##Name() const { return static_cast<Type>(Name); }                   \
+  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
+#include "clang/Basic/DebugOptions.def"
+
+  DebugOptions();
+
+  /// Check if type and variable info should be emitted.
+  bool hasReducedDebugInfo() const {
+    return getDebugInfo() >= llvm::debugoptions::DebugInfoConstructor;
+  }
+
+  /// Check if maybe unused type info should be emitted.
+  bool hasMaybeUnusedDebugInfo() const {
+    return getDebugInfo() >= llvm::debugoptions::UnusedTypeInfo;
+  }
+
+  /// Reset all of the options that are not considered when building a
+  /// module.
+  void resetNonModularOptions(llvm::StringRef ModuleFormat);
+};
+
+} // end namespace clang
+
+#endif
diff --git a/clang/include/clang/Basic/TargetInfo.h b/clang/include/clang/Basic/TargetInfo.h
index ec0189627dfbd2..e9661ee660cf06 100644
--- a/clang/include/clang/Basic/TargetInfo.h
+++ b/clang/include/clang/Basic/TargetInfo.h
@@ -16,7 +16,6 @@
 
 #include "clang/Basic/AddressSpaces.h"
 #include "clang/Basic/BitmaskEnum.h"
-#include "clang/Basic/CodeGenOptions.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/Specifiers.h"
@@ -48,7 +47,6 @@ struct fltSemantics;
 namespace clang {
 class DiagnosticsEngine;
 class LangOptions;
-class CodeGenOptions;
 class MacroBuilder;
 
 /// Contains information gathered from parsing the contents of TargetAttr.
diff --git a/clang/include/clang/CodeGen/BackendUtil.h b/clang/include/clang/CodeGen/BackendUtil.h
index fc8ed4f011f922..9f3fd0b96399a4 100644
--- a/clang/include/clang/CodeGen/BackendUtil.h
+++ b/clang/include/clang/CodeGen/BackendUtil.h
@@ -28,6 +28,7 @@ namespace clang {
   class DiagnosticsEngine;
   class HeaderSearchOptions;
   class CodeGenOptions;
+  class DebugOptions;
   class TargetOptions;
   class LangOptions;
   class BackendConsumer;
@@ -43,8 +44,9 @@ namespace clang {
 
   void EmitBackendOutput(DiagnosticsEngine &Diags, const HeaderSearchOptions &,
                          const CodeGenOptions &CGOpts,
-                         const TargetOptions &TOpts, const LangOptions &LOpts,
-                         StringRef TDesc, llvm::Module *M, BackendAction Action,
+                         const DebugOptions &DOpts, const TargetOptions &TOpts,
+                         const LangOptions &LOpts, StringRef TDesc,
+                         llvm::Module *M, BackendAction Action,
                          llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
                          std::unique_ptr<raw_pwrite_stream> OS,
                          BackendConsumer *BC = nullptr);
diff --git a/clang/include/clang/CodeGen/ModuleBuilder.h b/clang/include/clang/CodeGen/ModuleBuilder.h
index edacd82bf899db..10ce2ecd9bb29b 100644
--- a/clang/include/clang/CodeGen/ModuleBuilder.h
+++ b/clang/include/clang/CodeGen/ModuleBuilder.h
@@ -29,6 +29,7 @@ namespace llvm {
 
 namespace clang {
   class CodeGenOptions;
+  class DebugOptions;
   class CoverageSourceInfo;
   class Decl;
   class DiagnosticsEngine;
@@ -107,7 +108,7 @@ CodeGenerator *CreateLLVMCodeGen(DiagnosticsEngine &Diags,
                                  const HeaderSearchOptions &HeaderSearchOpts,
                                  const PreprocessorOptions &PreprocessorOpts,
                                  const CodeGenOptions &CGO,
-                                 llvm::LLVMContext &C,
+                                 const DebugOptions &DO, llvm::LLVMContext &C,
                                  CoverageSourceInfo *CoverageInfo = nullptr);
 
 } // end namespace clang
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 1b02087425b751..647cb873ec8101 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -299,6 +299,8 @@ class DependencyOutputOpts<string base>
   : KeyPathAndMacro<"DependencyOutputOpts.", base, "DEPENDENCY_OUTPUT_"> {}
 class CodeGenOpts<string base>
   : KeyPathAndMacro<"CodeGenOpts.", base, "CODEGEN_"> {}
+class DebugOpts<string base>
+  : KeyPathAndMacro<"DebugOpts.", base, "DEBUG_"> {}
 class HeaderSearchOpts<string base>
   : KeyPathAndMacro<"HeaderSearchOpts->", base, "HEADER_SEARCH_"> {}
 class PreprocessorOpts<string base>
@@ -1656,7 +1658,7 @@ def fdebug_compilation_dir_EQ : Joined<["-"], "fdebug-compilation-dir=">,
     Group<f_Group>,
     Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
     HelpText<"The compilation directory to embed in the debug info">,
-    MarshallingInfoString<CodeGenOpts<"DebugCompilationDir">>;
+    MarshallingInfoString<DebugOpts<"DebugCompilationDir">>;
 def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">,
     Group<f_Group>,
     Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
@@ -1669,7 +1671,7 @@ def ffile_compilation_dir_EQ : Joined<["-"], "ffile-compilation-dir=">, Group<f_
     Visibility<[ClangOption, CLOption, DXCOption]>,
     HelpText<"The compilation directory to embed in the debug info and coverage mapping.">;
 defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling",
-  CodeGenOpts<"DebugInfoForProfiling">, DefaultFalse,
+  DebugOpts<"DebugInfoForProfiling">, DefaultFalse,
   PosFlag<SetTrue, [], [ClangOption, CC1Option],
           "Emit extra debug info to make sample profile more accurate">,
   NegFlag<SetFalse>>;
@@ -2005,7 +2007,7 @@ defm dollars_in_identifiers : BoolFOption<"dollars-in-identifiers",
 def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
 def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
 defm dwarf_directory_asm : BoolFOption<"dwarf-directory-asm",
-  CodeGenOpts<"NoDwarfDirectoryAsm">, DefaultFalse,
+  DebugOpts<"NoDwarfDirectoryAsm">, DefaultFalse,
   NegFlag<SetTrue, [], [ClangOption, CC1Option]>,
   PosFlag<SetFalse>>;
 defm elide_constructors : BoolFOption<"elide-constructors",
@@ -4024,12 +4026,12 @@ def fdebug_types_section: Flag <["-"], "fdebug-types-section">, Group<f_Group>,
   HelpText<"Place debug types in their own section (ELF Only)">;
 def fno_debug_types_section: Flag<["-"], "fno-debug-types-section">, Group<f_Group>;
 defm debug_ranges_base_address : BoolFOption<"debug-ranges-base-address",
-  CodeGenOpts<"DebugRangesBaseAddress">, DefaultFalse,
+  DebugOpts<"DebugRangesBaseAddress">, DefaultFalse,
   PosFlag<SetTrue, [], [ClangOption, CC1Option],
           "Use DWARF base address selection entries in .debug_ranges">,
   NegFlag<SetFalse>>;
 defm split_dwarf_inlining : BoolFOption<"split-dwarf-inlining",
-  CodeGenOpts<"SplitDwarfInlining">, DefaultFalse,
+  DebugOpts<"SplitDwarfInlining">, DefaultFalse,
   NegFlag<SetFalse, [], [ClangOption]>,
   PosFlag<SetTrue, [], [ClangOption, CC1Option],
           "Provide minimal debug info in the object/executable"
@@ -4057,7 +4059,7 @@ def fmacro_prefix_map_EQ
     HelpText<"remap file source paths in predefined preprocessor macros and "
              "__builtin_FILE(). Implies -ffile-reproducible.">;
 defm force_dwarf_frame : BoolFOption<"force-dwarf-frame",
-  CodeGenOpts<"ForceDwarfFrameSection">, DefaultFalse,
+  DebugOpts<"ForceDwarfFrameSection">, DefaultFalse,
   PosFlag<SetTrue, [], [ClangOption, CC1Option],
           "Always emit a debug frame section">,
   NegFlag<SetFalse>>;
@@ -4067,7 +4069,7 @@ def femit_dwarf_unwind_EQ : Joined<["-"], "femit-dwarf-unwind=">,
   Values<"always,no-compact-unwind,default">,
   NormalizedValues<["Always", "NoCompactUnwind", "Default"]>,
   NormalizedValuesScope<"llvm::EmitDwarfUnwindType">,
-  MarshallingInfoEnum<CodeGenOpts<"EmitDwarfUnwind">, "Default">;
+  MarshallingInfoEnum<DebugOpts<"EmitDwarfUnwind">, "Default">;
 defm emit_compact_unwind_non_canonical : BoolFOption<"emit-compact-unwind-non-canonical",
   CodeGenOpts<"EmitCompactUnwindNonCanonical">, DefaultFalse,
   PosFlag<SetTrue, [], [ClangOption, CC1Option, CC1AsOption],
@@ -4111,7 +4113,7 @@ def gdwarf_5 : Flag<["-"], "gdwarf-5">, Group<g_Group>,
 def gdwarf64 : Flag<["-"], "gdwarf64">, Group<g_Group>,
   Visibility<[ClangOption, CC1Option, CC1AsOption]>,
   HelpText<"Enables DWARF64 format for ELF binaries, if debug information emission is enabled.">,
-  MarshallingInfoFlag<CodeGenOpts<"Dwarf64">>;
+  MarshallingInfoFlag<DebugOpts<"Dwarf64">>;
 def gdwarf32 : Flag<["-"], "gdwarf32">, Group<g_Group>,
   Visibility<[ClangOption, CC1Option, CC1AsOption]>,
   HelpText<"Enables DWARF32 format for ELF binaries, if debug information emission is enabled.">;
@@ -4119,19 +4121,19 @@ def gdwarf32 : Flag<["-"], "gdwarf32">, Group<g_Group>,
 def gcodeview : Flag<["-"], "gcodeview">,
   HelpText<"Generate CodeView debug information">,
   Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
-  MarshallingInfoFlag<CodeGenOpts<"EmitCodeView">>;
+  MarshallingInfoFlag<DebugOpts<"EmitCodeView">>;
 defm codeview_ghash : BoolOption<"g", "codeview-ghash",
-  CodeGenOpts<"CodeViewGHash">, DefaultFalse,
+  DebugOpts<"CodeViewGHash">, DefaultFalse,
   PosFlag<SetTrue, [], [ClangOption, CC1Option],
           "Emit type record hashes in a .debug$H section">,
   NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
 defm codeview_command_line : BoolOption<"g", "codeview-command-line",
-  CodeGenOpts<"CodeViewCommandLine">, DefaultTrue,
+  DebugOpts<"CodeViewCommandLine">, DefaultTrue,
   PosFlag<SetTrue, [], [ClangOption], "Emit compiler path and command line into CodeView debug information">,
   NegFlag<SetFalse, [], [ClangOption], "Don't emit compiler path and command line into CodeView debug information">,
   BothFlags<[], [ClangOption, CLOption, DXCOption, CC1Option]>>;
 defm inline_line_tables : BoolGOption<"inline-line-tables",
-  CodeGenOpts<"NoInlineLineTables">, DefaultFalse,
+  DebugOpts<"NoInlineLineTables">, DefaultFalse,
   NegFlag<SetTrue, [], [ClangOption, CC1Option],
           "Don't emit inline line tables.">,
   PosFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
@@ -4150,14 +4152,14 @@ def gno_record_command_line : Flag<["-"], "gno-record-command-line">,
 def : Flag<["-"], "grecord-gcc-switches">, Alias<grecord_command_line>;
 def : Flag<["-"], "gno-record-gcc-switches">, Alias<gno_record_command_line>;
 defm strict_dwarf : BoolOption<"g", "strict-dwarf",
-  CodeGenOpts<"DebugStrictDwarf">, DefaultFalse,
+  DebugOpts<"DebugStrictDwarf">, DefaultFalse,
   PosFlag<Set...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/75530


More information about the llvm-commits mailing list