This is an archive of the discontinued LLVM Phabricator instance.

Rely on a single DWARF version instead of having two copies
ClosedPublic

Authored by clayborg on Nov 22 2016, 7:39 PM.

Details

Summary

This patch makes AsmPrinter less reliant on DwarfDebug by relying on the DWARF version in the AsmPrinter's MCStreamer's MCContext. This allows us to remove the redundant DWARF version from DwarfDebug. It also lets us change code that used to access the AsmPrinter's DwarfDebug just to get to the DWARF version by changing the DWARF version accessor on AsmPrinter so that it grabs the version from its MCStreamer's MCContext.

Diff Detail

Event Timeline

clayborg updated this revision to Diff 79017.Nov 22 2016, 7:39 PM
clayborg retitled this revision from to Rely on a single DWARF version instead of having two copies.
clayborg updated this object.

Added some clarifying comment.

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
259

Look at all of the code to see how this local DwarfVersion already was being stored into the MCStreamer's MCContext.

dblaikie accepted this revision.Nov 23 2016, 2:49 PM
dblaikie edited edge metadata.

Thanks!

(for posterity/others: No idea if AsmPrinter having any knowledge of DwarfDebug/DwarfVersion is the right layering - but this change seems no worse & handy for other DWARF generation code in llvm-dsymutil, unit testing, etc)

This revision is now accepted and ready to land.Nov 23 2016, 2:49 PM
This revision was automatically updated to reflect the committed changes.