[PATCH] Make getUnitForOffset a DWARFUnit method instead of a DWARFContext method.

Frederic Riss friss at apple.com
Thu Sep 11 05:07:29 PDT 2014


Hi dblaikie, samsonov, echristo, aprantl,

This commit moves the Unit lookup code from the DWARFContext into
a static member of the DWARFUnit. Using a CRTP, each Unit embeds
a reference to the vector of all Units extracted from the same
section. This vector is qureried in getUnitForOffset in order to
be able to extract DIEs referenced from a foreign Unit (this happens
with LTO type uniquing for example). This works whatever the Unit's
origin: .debug_info, .debug_types or their dwo variants.

The DWARFContext API is left untouched by forwarding it lookup code
to the DWARFUnit static member.

This code will be exercised/tested in a followup patch that makes
dwarfdump emit the name for DW_AT_abstract_origin and DW_AT_specification
attributes.

Note that this commit contains a fixed version of the unit lookup code
that hasn't been approved yet.

http://reviews.llvm.org/D5310

Files:
  lib/DebugInfo/DWARFCompileUnit.h
  lib/DebugInfo/DWARFContext.cpp
  lib/DebugInfo/DWARFTypeUnit.h
  lib/DebugInfo/DWARFUnit.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5310.13582.patch
Type: text/x-patch
Size: 7623 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140911/04c56f9c/attachment.bin>


More information about the llvm-commits mailing list