This is an archive of the discontinued LLVM Phabricator instance.

[Debug-Info] [NFC] move emitDwarfUnitLength to MCStreamer class
ClosedPublic

Authored by shchenz on Feb 3 2021, 2:17 AM.

Details

Summary

We may need to do some customization for DWARF unit length in DWARF section headers for some code generation path.
For example in D95518, for XCOFF in assembly path, AIX assembler does not require the debug section containing its debug unit length in the header.

Thanks to @ikudrin comments, moving the emitDwarfUnitLength to class MCStreamer can make us avoid the streamer type check in general code.

This is the NFC part to make D95518 easy to review.
Override of emitDwarfUnitLength in MCAsmStreamer class will be added in D95518.

Diff Detail

Event Timeline

shchenz created this revision.Feb 3 2021, 2:17 AM
shchenz requested review of this revision.Feb 3 2021, 2:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2021, 2:17 AM
ikudrin added inline comments.Feb 3 2021, 10:31 PM
llvm/unittests/CodeGen/AsmPrinterDwarfTest.cpp
296–297

This test file is for methods of AsmPrinter; other classes should be tested elsewhere. As the patch removes AsmPrinter::maybeEmitDwarf64Mark(), the corresponding tests can also be removed. That will not degrade the test coverage because MCStreamer::maybeEmitDwarf64Mark() is tested, although indirectly, in other tests.

shchenz updated this revision to Diff 321317.Feb 3 2021, 10:43 PM

update:
1: delete unittest for maybeEmitDwarf64Mark in AsmPrinter class as now maybeEmitDwarf64Mark is not a member function of AsmPrinter

llvm/unittests/CodeGen/AsmPrinterDwarfTest.cpp
296–297

Make sense. Updated. Thanks.

ikudrin added inline comments.Feb 3 2021, 11:33 PM
llvm/unittests/CodeGen/AsmPrinterDwarfTest.cpp
296–297

The fixture class should also be removed as it now contains no tests.

shchenz updated this revision to Diff 321341.Feb 4 2021, 1:12 AM

update:
1: remove the fixture class as well

llvm/unittests/CodeGen/AsmPrinterDwarfTest.cpp
296–297

opps, updated.

ikudrin accepted this revision.Feb 4 2021, 2:53 AM

LGTM but please postpone committing it until the whole set of patches is completed so we can have a full image of the changes.

This revision is now accepted and ready to land.Feb 4 2021, 2:53 AM

LGTM but please postpone committing it until the whole set of patches is completed so we can have a full image of the changes.

Thanks for your review @ikudrin. I will hold.

This revision was landed with ongoing or failed builds.Feb 23 2021, 6:29 PM
This revision was automatically updated to reflect the committed changes.

@ikudrin Hi, I start to commit these NFC changes as now all of them are approved. Welcome your post-commit comment if there is any. Thank you again for your review!