This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Fix DebugLine::Prologue::getLength
ClosedPublic

Authored by jhenderson on Jan 29 2020, 6:50 AM.

Details

Summary

The function a) returned 32-bits when in DWARF64, the PrologueLength field is 64-bits in size, and b) didn't work for DWARF version 5.

Also deleted some related dead code. With this deletion, getLength is itself dead, but another change is about to make use of it.

Diff Detail

Event Timeline

jhenderson created this revision.Jan 29 2020, 6:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2020, 6:50 AM
probinson added inline comments.Jan 29 2020, 7:46 AM
llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
306

I'd just use += 2 here, with a comment. sizeof(getAddressSize()) took a second to parse, and assumes the getter returns a type that is the same size as the field.

llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
246

// + 10 for sizes of DWARF-32 unit length, version, prologue length.

253

// Unit length grows by 8, prologue length by 4.

jhenderson marked 3 inline comments as done.

Address review comments.

This revision is now accepted and ready to land.Jan 29 2020, 10:31 AM
This revision was automatically updated to reflect the committed changes.