This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Keep the DWARF64 flag in the module metadata
ClosedPublic

Authored by ikudrin on Feb 12 2021, 5:50 AM.

Details

Summary

This allows the option to affect the LTO output. Module::Max helps to generate debug info for all modules in the same format.

Diff Detail

Event Timeline

ikudrin created this revision.Feb 12 2021, 5:50 AM
ikudrin requested review of this revision.Feb 12 2021, 5:50 AM
dblaikie accepted this revision.Feb 12 2021, 12:01 PM
dblaikie added a subscriber: aprantl.

@aprantl - mind having a look at this/signing off as well, if you're OK with it? Since it's a core metadata change, wouldn't mind some extra eyes on it.

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
396

Once this patch is accepted, it's probably worth going back and removing the MCOption? (I don't think we have MCOptions for other debug related module metadata, like the DWARF version?)

This revision is now accepted and ready to land.Feb 12 2021, 12:01 PM

Thank you, @dblaikie!

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
396

Exactly for the DWARF version, there is a similar option, please take a look at line 388.
As for the DWARF64 option here, it only simplifies testing with tools like llc, opt, etc. Originally, MCTargetOptions::Dwarf64 was aimed to adjust generating in the assembler, but the corresponding command-line flag is visible in other tools, too. Do you think it is worth it to move the command line option from the common library code to specific tools?

dblaikie added inline comments.Feb 16 2021, 11:11 AM
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
396

Oh, nah, that's fine to keep around like the DWARF version for LLVM testing purposes (easier to write a test with a single .ll file and different RUN lines to test both 32 and 64 behavior, without having to have two IR Files, or rewrite the IR file to switch its format, etc)

This revision was automatically updated to reflect the committed changes.