This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo/DWARF] [3/4] De-segregate type units and compile units. NFC
ClosedPublic

Authored by probinson on Jul 24 2018, 10:15 AM.

Details

Summary

This is Patch 3 of 4 NFC refactorings to handle type units and compile
units more consistently and with less concern about the object-file
section that they came from.

Patch 1 replaces the templated DWARFUnitSection with a non-templated
version. That is, instead of being a SmallVector of pointers to a
specific unit kind, it is now a SmallVector of pointers to the base
class for both type and compile units. Virtual methods are magic.

Patch 2 takes the existing std::deque<DWARFUnitSection> for type units
and makes it a simple DWARFUnitSection, simplifying the handling of
type units and making it more consistent with compile units.

Patch 3 simply renames DWARFUnitSection to DWARFUnitVector, as the
object-file section of a unit is nearly irrelevant now.

Patch 4 combines separate DWARFUnitVectors for compile and type units
into a single DWARFUnitVector that contains both. For now the
implementation distinguishes compile units from type units by putting
all compile units at the front of the vector, reflecting the DWARF v4
distinction between .debug_info and .debug_types sections. A future
patch will change this to allow the free mixing of unit kinds, as is
specified by DWARF v5.

Diff Detail

Repository
rL LLVM

Event Timeline

probinson created this revision.Jul 24 2018, 10:15 AM
aprantl accepted this revision.Jul 30 2018, 7:50 AM
This revision is now accepted and ready to land.Jul 30 2018, 7:50 AM
This revision was automatically updated to reflect the committed changes.