[PATCH] D49742: [DebugInfo/DWARF] [2/4] De-segregate type units and compile units. NFC

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 24 10:14:47 PDT 2018


probinson created this revision.
probinson added reviewers: dblaikie, aprantl.
probinson added a project: debug-info.
Herald added subscribers: llvm-commits, JDevlieghere, hiraditya.

This is Patch 2 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.


Repository:
  rL LLVM

https://reviews.llvm.org/D49742

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
  llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
  llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
  llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
  llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49742.157070.patch
Type: text/x-patch
Size: 15880 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180724/c3687f19/attachment.bin>


More information about the llvm-commits mailing list