-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[RemoveDIs] Add flag to control loading into new debug mode from bitcode #85649
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
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,15 @@ static cl::opt<bool> ExpandConstantExprs( | |
cl::desc( | ||
"Expand constant expressions to instructions for testing purposes")); | ||
|
||
/// Load bitcode directly into RemoveDIs format (use debug records instead | ||
/// of debug intrinsics). UNSET is treated as FALSE, so the default action | ||
/// is to do nothing. Individual tools can override this to incrementally add | ||
/// support for the RemoveDIs format. | ||
cl::opt<cl::boolOrDefault> LoadBitcodeIntoNewDbgInforFormat( | ||
"load-bitcode-into-experimental-debuginfo-iterators", cl::Hidden, | ||
cl::desc("Load bitcode directly into the new debug info format (regardless " | ||
"of input format)")); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be to keep consistency with the previous options, include There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
namespace { | ||
|
||
enum { | ||
|
@@ -4276,9 +4285,11 @@ Error BitcodeReader::parseGlobalIndirectSymbolRecord( | |
Error BitcodeReader::parseModule(uint64_t ResumeBit, | ||
bool ShouldLazyLoadMetadata, | ||
ParserCallbacks Callbacks) { | ||
// Force the debug-info mode into the old format for now. | ||
// FIXME: Remove this once all tools support RemoveDIs. | ||
TheModule->IsNewDbgInfoFormat = false; | ||
// Load directly into RemoveDIs format if LoadBitcodeIntoNewDbgInforFormat | ||
// has been set to true (default action: load into the old debug format). | ||
TheModule->IsNewDbgInfoFormat = | ||
UseNewDbgInfoFormat && | ||
LoadBitcodeIntoNewDbgInforFormat == cl::boolOrDefault::BOU_TRUE; | ||
OCHyams marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
this->ValueTypeCallback = std::move(Callbacks.ValueType); | ||
if (ResumeBit) { | ||
|
@@ -6762,9 +6773,9 @@ Error BitcodeReader::materialize(GlobalValue *GV) { | |
if (Error JumpFailed = Stream.JumpToBit(DFII->second)) | ||
return JumpFailed; | ||
|
||
// Set the debug info mode to "new", forcing a mismatch between | ||
// Set the debug info mode to "new", possibly creating a mismatch between | ||
// module and function debug modes. This is okay because we'll convert | ||
// everything back to the old mode after parsing. | ||
// everything back to the old mode after parsing if needed. | ||
// FIXME: Remove this once all tools support RemoveDIs. | ||
F->IsNewDbgInfoFormat = true; | ||
|
||
|
@@ -6774,7 +6785,8 @@ Error BitcodeReader::materialize(GlobalValue *GV) { | |
|
||
// Convert new debug info records into intrinsics. | ||
// FIXME: Remove this once all tools support RemoveDIs. | ||
F->convertFromNewDbgValues(); | ||
if (!F->getParent()->IsNewDbgInfoFormat) | ||
F->convertFromNewDbgValues(); | ||
|
||
if (StripDebugInfo) | ||
stripDebugInfo(*F); | ||
|
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
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.
Uh oh!
There was an error while loading. Please reload this page.