This is an archive of the discontinued LLVM Phabricator instance.

[DWARF] Adjust return type of DWARFUnit::getLength().
ClosedPublic

Authored by ikudrin on Aug 20 2019, 6:03 AM.

Details

Summary

DWARFUnitHeader::getLength() returns uint64_t, so DWARFUnit::getLength() should do the same.

Diff Detail

Repository
rL LLVM

Event Timeline

ikudrin created this revision.Aug 20 2019, 6:03 AM
MaskRay accepted this revision.Aug 20 2019, 7:11 AM

DWARFUnitHeader::getLenght()

Typo: getLength. Otherwise LGTM.

This revision is now accepted and ready to land.Aug 20 2019, 7:11 AM
probinson accepted this revision.Aug 20 2019, 7:12 AM

Is DWARFCompileUnit::dump() really the only consumer of this API? I would have thought maybe somewhere in dsymutil would be using it.

I expect it's impractical to test this sort of thing so LGTM.

ikudrin edited the summary of this revision. (Show Details)Aug 20 2019, 7:30 AM

Thanks! All other places I found already use the length as uint64_t. I noticed only one suspicious place in lld which I investigate deeper a bit later.

For the record, there are only a few places where DWARFUnit::getLength() is used:

  • DWARFCompileUnit::dump() -- fixed
  • DWARFTypeUnit::dump() -- fixed
  • dumpDebugInfo() in tools/obj2yaml/dwarf2yaml.cpp -- already accepts uint64_t; looks like already supports DWARF64 but worth reviewing.
  • readCuList() in lld/ELF/SyntheticSections.cpp -- already accepts uint64_t; probably supports only DWARF32 for now.
This revision was automatically updated to reflect the committed changes.