Skip to content

[RemoveDIs] Do not load into new debug info format from bitcode by default #86268

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 3 commits into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions llvm/tools/verify-uselistorder/verify-uselistorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ static cl::opt<unsigned>
cl::desc("Number of times to shuffle and verify use-lists"),
cl::init(1), cl::cat(Cat));

extern cl::opt<cl::boolOrDefault> LoadBitcodeIntoNewDbgInforFormat;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Probably better to keep a blank line after this


namespace {

struct TempFile {
Expand Down Expand Up @@ -169,8 +171,7 @@ std::unique_ptr<Module> TempFile::readBitcode(LLVMContext &Context) const {

// verify-uselistoder currently only supports old-style debug info mode.
// FIXME: Update mapping code for RemoveDIs.
assert(!ModuleOr.get()->IsNewDbgInfoFormat &&
"Unexpectedly in new debug info mode");
ModuleOr.get()->setIsNewDbgInfoFormat(false);
return std::move(ModuleOr.get());
}

Expand All @@ -182,7 +183,7 @@ std::unique_ptr<Module> TempFile::readAssembly(LLVMContext &Context) const {
Err.print("verify-uselistorder", errs());
// verify-uselistoder currently only supports old-style debug info mode.
// FIXME: Update mapping code for RemoveDIs.
assert(!M->IsNewDbgInfoFormat && "Unexpectedly in new debug info mode");
M->setIsNewDbgInfoFormat(false);
return M;
}

Expand Down Expand Up @@ -544,14 +545,18 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv,
"llvm tool to verify use-list order\n");

// Do not load bitcode into the new debug info format by default.
if (LoadBitcodeIntoNewDbgInforFormat == cl::boolOrDefault::BOU_UNSET)
LoadBitcodeIntoNewDbgInforFormat = cl::boolOrDefault::BOU_FALSE;

LLVMContext Context;
SMDiagnostic Err;

// Load the input module...
std::unique_ptr<Module> M = parseIRFile(InputFilename, Err, Context);
// verify-uselistoder currently only supports old-style debug info mode.
// FIXME: Update mapping code for RemoveDIs.
assert(!M->IsNewDbgInfoFormat && "Unexpectedly in new debug info mode");
M->setIsNewDbgInfoFormat(false);

if (!M.get()) {
Err.print(argv[0], errs());
Expand Down