-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang][modules] Reset codegen options. #74006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
//===--- 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). | ||
// | ||
// BENIGN_ variants of the macros are used to describe options that do not | ||
// affect the generated PCM. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
#ifndef DEBUGOPT | ||
#define DEBUGOPT(Name, Bits, Default) \ | ||
CODEGENOPT(Name, Bits, Default) | ||
#endif | ||
|
||
#ifndef VALUE_DEBUGOPT | ||
# define VALUE_DEBUGOPT(Name, Bits, Default) \ | ||
VALUE_CODEGENOPT(Name, Bits, Default) | ||
#endif | ||
|
||
#ifndef ENUM_DEBUGOPT | ||
# define ENUM_DEBUGOPT(Name, Type, Bits, Default) \ | ||
ENUM_CODEGENOPT(Name, Type, Bits, Default) | ||
#endif | ||
|
||
#ifndef BENIGN_DEBUGOPT | ||
#define BENIGN_DEBUGOPT(Name, Bits, Default) \ | ||
DEBUGOPT(Name, Bits, Default) | ||
#endif | ||
|
||
#ifndef BENIGN_VALUE_DEBUGOPT | ||
# define BENIGN_VALUE_DEBUGOPT(Name, Bits, Default) \ | ||
VALUE_DEBUGOPT(Name, Bits, Default) | ||
#endif | ||
|
||
#ifndef BENIGN_ENUM_DEBUGOPT | ||
# define BENIGN_ENUM_DEBUGOPT(Name, Type, Bits, Default) \ | ||
ENUM_DEBUGOPT(Name, Type, Bits, Default) | ||
#endif | ||
|
||
BENIGN_ENUM_DEBUGOPT(CompressDebugSections, llvm::DebugCompressionType, 2, | ||
llvm::DebugCompressionType::None) | ||
DEBUGOPT(Dwarf64, 1, 0) ///< -gdwarf64. | ||
BENIGN_DEBUGOPT(EnableDIPreservationVerify, 1, 0) ///< Enable di preservation | ||
///< verify each (it means | ||
///< check the original debug | ||
///< info metadata | ||
///< preservation). | ||
BENIGN_DEBUGOPT(ForceDwarfFrameSection , 1, 0) ///< Set when -fforce-dwarf-frame | ||
///< is enabled. | ||
|
||
///< Set when -femit-dwarf-unwind is passed. | ||
BENIGN_ENUM_DEBUGOPT(EmitDwarfUnwind, llvm::EmitDwarfUnwindType, 2, | ||
llvm::EmitDwarfUnwindType::Default) | ||
|
||
BENIGN_DEBUGOPT(NoDwarfDirectoryAsm , 1, 0) ///< Set when -fno-dwarf-directory-asm | ||
///< is enabled. | ||
|
||
BENIGN_DEBUGOPT(NoInlineLineTables, 1, 0) ///< Whether debug info should contain | ||
///< inline line tables. | ||
|
||
DEBUGOPT(DebugStrictDwarf, 1, 1) ///< Whether or not to use strict DWARF info. | ||
|
||
/// Control the Assignment Tracking debug info feature. | ||
BENIGN_ENUM_DEBUGOPT(AssignmentTrackingMode, AssignmentTrackingOpts, 2, | ||
AssignmentTrackingOpts::Disabled) | ||
|
||
DEBUGOPT(DebugColumnInfo, 1, 0) ///< Whether or not to use column information | ||
///< in debug info. | ||
|
||
DEBUGOPT(DebugTypeExtRefs, 1, 0) ///< Whether or not debug info should contain | ||
///< external references to a PCH or module. | ||
|
||
DEBUGOPT(DebugExplicitImport, 1, 0) ///< 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) | ||
|
||
DEBUGOPT(SplitDwarfInlining, 1, 1) ///< Whether to include inlining info in the | ||
///< skeleton CU to allow for symbolication | ||
///< of inline stack frames without .dwo files. | ||
DEBUGOPT(DebugFwdTemplateParams, 1, 0) ///< 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) | ||
///< 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) | ||
|
||
/// Whether to generate macro debug info. | ||
DEBUGOPT(MacroDebugInfo, 1, 0) | ||
|
||
/// Tune the debug info for this debugger. | ||
ENUM_DEBUGOPT(DebuggerTuning, llvm::DebuggerKind, 3, | ||
llvm::DebuggerKind::Default) | ||
|
||
/// Dwarf version. Version zero indicates to LLVM that no DWARF should be | ||
/// emitted. | ||
VALUE_DEBUGOPT(DwarfVersion, 3, 0) | ||
|
||
/// Whether we should emit CodeView debug information. It's possible to emit | ||
/// CodeView and DWARF into the same object. | ||
DEBUGOPT(EmitCodeView, 1, 0) | ||
|
||
/// Whether to emit the .debug$H section containing hashes of CodeView types. | ||
DEBUGOPT(CodeViewGHash, 1, 0) | ||
|
||
/// Whether to emit the compiler path and command line into the CodeView debug information. | ||
DEBUGOPT(CodeViewCommandLine, 1, 0) | ||
|
||
/// Whether emit extra debug info for sample pgo profile collection. | ||
DEBUGOPT(DebugInfoForProfiling, 1, 0) | ||
|
||
/// Whether to emit .debug_gnu_pubnames section instead of .debug_pubnames. | ||
DEBUGOPT(DebugNameTable, 2, 0) | ||
|
||
/// Whether to use DWARF base address specifiers in .debug_ranges. | ||
DEBUGOPT(DebugRangesBaseAddress, 1, 0) | ||
|
||
/// Whether to embed source in DWARF debug line section. | ||
DEBUGOPT(EmbedSource, 1, 0) | ||
|
||
#undef DEBUGOPT | ||
#undef ENUM_DEBUGOPT | ||
#undef VALUE_DEBUGOPT | ||
#undef BENIGN_DEBUGOPT | ||
#undef BENIGN_ENUM_DEBUGOPT | ||
#undef BENIGN_VALUE_DEBUGOPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would make sense to eventually treat these as separate top-level
.def
files?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my initial idea, but it ballooned into a lot of code changes. Turns out the debug options are used in a lot of places. It could be done, but it would be a lot of churn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. In that case I suggest leaving a FIXME behind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the FIXME.