1//===--- DebugOptions.def - Debug option database ----------------- C++ -*-===// 2// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6// 7//===----------------------------------------------------------------------===// 8// 9// This file defines debug-specific codegen options. Users of this file 10// must define the CODEGENOPT macro to make use of this information. 11// Optionally, the user may also define DEBUGOPT (for flags), ENUM_DEBUGOPT (for 12// options that have enumeration type), and VALUE_DEBUGOPT (is a debug option 13// that describes a value rather than a flag). 14// 15// BENIGN_ variants of the macros are used to describe options that do not 16// affect the generated PCM. 17// 18//===----------------------------------------------------------------------===// 19#ifndef DEBUGOPT 20#define DEBUGOPT(Name, Bits, Default) \ 21CODEGENOPT(Name, Bits, Default) 22#endif 23 24#ifndef VALUE_DEBUGOPT 25# define VALUE_DEBUGOPT(Name, Bits, Default) \ 26VALUE_CODEGENOPT(Name, Bits, Default) 27#endif 28 29#ifndef ENUM_DEBUGOPT 30# define ENUM_DEBUGOPT(Name, Type, Bits, Default) \ 31ENUM_CODEGENOPT(Name, Type, Bits, Default) 32#endif 33 34#ifndef BENIGN_DEBUGOPT 35#define BENIGN_DEBUGOPT(Name, Bits, Default) \ 36DEBUGOPT(Name, Bits, Default) 37#endif 38 39#ifndef BENIGN_VALUE_DEBUGOPT 40# define BENIGN_VALUE_DEBUGOPT(Name, Bits, Default) \ 41VALUE_DEBUGOPT(Name, Bits, Default) 42#endif 43 44#ifndef BENIGN_ENUM_DEBUGOPT 45# define BENIGN_ENUM_DEBUGOPT(Name, Type, Bits, Default) \ 46ENUM_DEBUGOPT(Name, Type, Bits, Default) 47#endif 48 49BENIGN_ENUM_DEBUGOPT(CompressDebugSections, llvm::DebugCompressionType, 2, 50 llvm::DebugCompressionType::None) 51DEBUGOPT(Dwarf64, 1, 0) ///< -gdwarf64. 52BENIGN_DEBUGOPT(EnableDIPreservationVerify, 1, 0) ///< Enable di preservation 53 ///< verify each (it means 54 ///< check the original debug 55 ///< info metadata 56 ///< preservation). 57BENIGN_DEBUGOPT(ForceDwarfFrameSection , 1, 0) ///< Set when -fforce-dwarf-frame 58 ///< is enabled. 59 60///< Set when -femit-dwarf-unwind is passed. 61BENIGN_ENUM_DEBUGOPT(EmitDwarfUnwind, llvm::EmitDwarfUnwindType, 2, 62 llvm::EmitDwarfUnwindType::Default) 63 64BENIGN_DEBUGOPT(NoDwarfDirectoryAsm , 1, 0) ///< Set when -fno-dwarf-directory-asm 65 ///< is enabled. 66 67BENIGN_DEBUGOPT(NoInlineLineTables, 1, 0) ///< Whether debug info should contain 68 ///< inline line tables. 69 70DEBUGOPT(DebugStrictDwarf, 1, 1) ///< Whether or not to use strict DWARF info. 71DEBUGOPT(DebugOmitUnreferencedMethods, 1, 0) ///< Omit unreferenced member 72 ///< functions in type debug info. 73 74/// Control the Assignment Tracking debug info feature. 75BENIGN_ENUM_DEBUGOPT(AssignmentTrackingMode, AssignmentTrackingOpts, 2, 76 AssignmentTrackingOpts::Disabled) 77 78DEBUGOPT(DebugColumnInfo, 1, 0) ///< Whether or not to use column information 79 ///< in debug info. 80 81DEBUGOPT(DebugTypeExtRefs, 1, 0) ///< Whether or not debug info should contain 82 ///< external references to a PCH or module. 83 84DEBUGOPT(DebugExplicitImport, 1, 0) ///< Whether or not debug info should 85 ///< contain explicit imports for 86 ///< anonymous namespaces 87 88/// Set debug info source file hashing algorithm. 89ENUM_DEBUGOPT(DebugSrcHash, DebugSrcHashKind, 2, DSH_MD5) 90 91DEBUGOPT(SplitDwarfInlining, 1, 1) ///< Whether to include inlining info in the 92 ///< skeleton CU to allow for symbolication 93 ///< of inline stack frames without .dwo files. 94DEBUGOPT(DebugFwdTemplateParams, 1, 0) ///< Whether to emit complete 95 ///< template parameter descriptions in 96 ///< forward declarations (versus just 97 ///< including them in the name). 98ENUM_DEBUGOPT(DebugSimpleTemplateNames, 99 llvm::codegenoptions::DebugTemplateNamesKind, 2, 100 llvm::codegenoptions::DebugTemplateNamesKind::Full) 101 ///< Whether to emit template parameters in the textual names of 102 ///< template specializations. 103 ///< Implies DebugFwdTemplateNames to allow decorated names to be 104 ///< reconstructed when needed. 105 106/// The kind of generated debug info. 107ENUM_DEBUGOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4, 108 llvm::codegenoptions::NoDebugInfo) 109 110/// Whether to generate macro debug info. 111DEBUGOPT(MacroDebugInfo, 1, 0) 112 113/// Tune the debug info for this debugger. 114ENUM_DEBUGOPT(DebuggerTuning, llvm::DebuggerKind, 3, 115 llvm::DebuggerKind::Default) 116 117/// Dwarf version. Version zero indicates to LLVM that no DWARF should be 118/// emitted. 119VALUE_DEBUGOPT(DwarfVersion, 3, 0) 120 121/// Whether we should emit CodeView debug information. It's possible to emit 122/// CodeView and DWARF into the same object. 123DEBUGOPT(EmitCodeView, 1, 0) 124 125/// Whether to emit the .debug$H section containing hashes of CodeView types. 126DEBUGOPT(CodeViewGHash, 1, 0) 127 128/// Whether to emit the compiler path and command line into the CodeView debug information. 129DEBUGOPT(CodeViewCommandLine, 1, 0) 130 131/// Whether emit extra debug info for sample pgo profile collection. 132DEBUGOPT(DebugInfoForProfiling, 1, 0) 133 134/// Whether to emit DW_TAG_template_alias for template aliases. 135DEBUGOPT(DebugTemplateAlias, 1, 0) 136 137/// Whether to emit .debug_gnu_pubnames section instead of .debug_pubnames. 138DEBUGOPT(DebugNameTable, 2, 0) 139 140/// Whether to use DWARF base address specifiers in .debug_ranges. 141DEBUGOPT(DebugRangesBaseAddress, 1, 0) 142 143/// Whether to embed source in DWARF debug line section. 144DEBUGOPT(EmbedSource, 1, 0) 145 146#undef DEBUGOPT 147#undef ENUM_DEBUGOPT 148#undef VALUE_DEBUGOPT 149#undef BENIGN_DEBUGOPT 150#undef BENIGN_ENUM_DEBUGOPT 151#undef BENIGN_VALUE_DEBUGOPT 152