//===--- DebugOptions.def - Debug option database ----------------- 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 debug-specific codegen options. Users of this file
// must define the CODEGENOPT macro to make use of this information.
// Optionally, the user may also define DEBUGOPT (for flags), ENUM_DEBUGOPT (for
// options that have enumeration type), and VALUE_DEBUGOPT (is a debug option
// that describes a value rather than a flag).
//
//===----------------------------------------------------------------------===//
#ifndef DEBUGOPT
#define DEBUGOPT(Name, Bits, Default, Compatibility) \
CODEGENOPT(Name, Bits, Default, Compatibility)
#endif

#ifndef VALUE_DEBUGOPT
#  define VALUE_DEBUGOPT(Name, Bits, Default, Compatibility) \
VALUE_CODEGENOPT(Name, Bits, Default, Compatibility)
#endif

#ifndef ENUM_DEBUGOPT
#  define ENUM_DEBUGOPT(Name, Type, Bits, Default, Compatibility) \
ENUM_CODEGENOPT(Name, Type, Bits, Default, Compatibility)
#endif

ENUM_DEBUGOPT(CompressDebugSections, llvm::DebugCompressionType, 2,
                     llvm::DebugCompressionType::None, Benign)
DEBUGOPT(Dwarf64, 1, 0, Affecting) ///< -gdwarf64.
DEBUGOPT(EnableDIPreservationVerify, 1, 0, Benign) ///< Enable di preservation
                                                   ///< verify each (it means
                                                   ///< check the original debug
                                                   ///< info metadata
                                                   ///< preservation).
DEBUGOPT(ForceDwarfFrameSection , 1, 0, Benign) ///< Set when -fforce-dwarf-frame
                                                ///< is enabled.

///< Set when -femit-dwarf-unwind is passed.
ENUM_DEBUGOPT(EmitDwarfUnwind, llvm::EmitDwarfUnwindType, 2,
              llvm::EmitDwarfUnwindType::Default, Benign)

DEBUGOPT(NoDwarfDirectoryAsm , 1, 0, Benign) ///< Set when -fno-dwarf-directory-asm
                                             ///< is enabled.

DEBUGOPT(NoInlineLineTables, 1, 0, Benign) ///< Whether debug info should contain
                                           ///< inline line tables.

DEBUGOPT(DebugStrictDwarf, 1, 1, Affecting) ///< Whether or not to use strict DWARF info.
DEBUGOPT(DebugOmitUnreferencedMethods, 1, 0, Affecting) ///< Omit unreferenced member
                                                        ///< functions in type debug info.

/// Control the Assignment Tracking debug info feature.
ENUM_DEBUGOPT(AssignmentTrackingMode, AssignmentTrackingOpts, 2,
              AssignmentTrackingOpts::Disabled, Benign)

/// Whether or not to use Key Instructions to determine breakpoint locations.
DEBUGOPT(DebugKeyInstructions, 1, 0, Benign)

DEBUGOPT(DebugColumnInfo, 1, 0, Affecting) ///< Whether or not to use column information
                                           ///< in debug info.

DEBUGOPT(DebugTypeExtRefs, 1, 0, Affecting) ///< Whether or not debug info should contain
                                            ///< external references to a PCH or module.

DEBUGOPT(DebugExplicitImport, 1, 0, Affecting)  ///< Whether or not debug info should
                                                ///< contain explicit imports for
                                                ///< anonymous namespaces

/// Set debug info source file hashing algorithm.
ENUM_DEBUGOPT(DebugSrcHash, DebugSrcHashKind, 2, DSH_MD5, Affecting)

DEBUGOPT(SplitDwarfInlining, 1, 1, Affecting) ///< Whether to include inlining info in the
                                              ///< skeleton CU to allow for symbolication
                                              ///< of inline stack frames without .dwo files.
DEBUGOPT(DebugFwdTemplateParams, 1, 0, Affecting) ///< Whether to emit complete
                                                  ///< template parameter descriptions in
                                                  ///< forward declarations (versus just
                                                  ///< including them in the name).
ENUM_DEBUGOPT(DebugSimpleTemplateNames,
              llvm::codegenoptions::DebugTemplateNamesKind, 2,
              llvm::codegenoptions::DebugTemplateNamesKind::Full, Affecting)
              ///< 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, Affecting)

/// Whether to generate macro debug info.
DEBUGOPT(MacroDebugInfo, 1, 0, Affecting)

/// Tune the debug info for this debugger.
ENUM_DEBUGOPT(DebuggerTuning, llvm::DebuggerKind, 3,
              llvm::DebuggerKind::Default, Affecting)

/// Dwarf version. Version zero indicates to LLVM that no DWARF should be
/// emitted.
VALUE_DEBUGOPT(DwarfVersion, 3, 0, Affecting)

/// Whether we should emit CodeView debug information. It's possible to emit
/// CodeView and DWARF into the same object.
DEBUGOPT(EmitCodeView, 1, 0, Affecting)

/// Whether to emit the .debug$H section containing hashes of CodeView types.
DEBUGOPT(CodeViewGHash, 1, 0, Affecting)

/// Whether to emit the compiler path and command line into the CodeView debug information.
DEBUGOPT(CodeViewCommandLine, 1, 0, Affecting)

/// Whether emit extra debug info for sample pgo profile collection.
DEBUGOPT(DebugInfoForProfiling, 1, 0, Affecting)

/// Whether to emit DW_TAG_template_alias for template aliases.
DEBUGOPT(DebugTemplateAlias, 1, 0, Affecting)

/// Whether to emit .debug_gnu_pubnames section instead of .debug_pubnames.
DEBUGOPT(DebugNameTable, 2, 0, Affecting)

/// Whether to use DWARF base address specifiers in .debug_ranges.
DEBUGOPT(DebugRangesBaseAddress, 1, 0, Affecting)

/// Whether to embed source in DWARF debug line section.
DEBUGOPT(EmbedSource, 1, 0, Affecting)

#undef DEBUGOPT
#undef ENUM_DEBUGOPT
#undef VALUE_DEBUGOPT
