This is an archive of the discontinued LLVM Phabricator instance.

[CodeView] Add function to get size in bytes for a TypeIndex.
ClosedPublic

Authored by CarlosAlbertoEnciso on Jul 15 2022, 4:43 AM.

Details

Summary

Given a TypeIndex return its size in bytes. Basically is the
inverse to 'CodeViewDebug::lowerTypeBasic', that returns a
TypeIndex based in a size.

This work is required for https://reviews.llvm.org/D125784

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2022, 4:43 AM
CarlosAlbertoEnciso requested review of this revision.Jul 15 2022, 4:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2022, 4:43 AM
djtodoro accepted this revision.Jul 26 2022, 3:01 AM
djtodoro added inline comments.
llvm/lib/DebugInfo/CodeView/TypeRecordHelpers.cpp
85

Please format the comment (and all the rest of them bellow).

This revision is now accepted and ready to land.Jul 26 2022, 3:01 AM
rnk added inline comments.Jul 26 2022, 9:32 AM
llvm/lib/DebugInfo/CodeView/TypeRecordHelpers.cpp
54

These two methods have the same name but appear to do different things: The TypeIndex version returns sizeof(T), and the CVType version returns the size of the CVType record. Should they be named differently?

llvm/lib/DebugInfo/CodeView/TypeRecordHelpers.cpp
54

Good point.

Suggested names:

  • The TypeIndex version --> getSizeInBytesForTypeIndex
  • The CVType version --> getSizeInBytesForTypeRecord
llvm/lib/DebugInfo/CodeView/TypeRecordHelpers.cpp
85

Thanks. Added the missing full stop to the comments.

Address feedback from reviewers.

  • Rename functions.
  • Format comments.
This revision was landed with ongoing or failed builds.Aug 8 2022, 12:50 AM
This revision was automatically updated to reflect the committed changes.