[PATCH] Add a UnitKind field to DWARFUnit so that we can discriminate the unit's origin section.

David Blaikie dblaikie at gmail.com
Tue Sep 9 14:40:10 PDT 2014


On Tue, Sep 9, 2014 at 5:53 AM, Frederic Riss <friss at apple.com> wrote:

> Hi dblaikie, samsonov, echristo, aprantl,
>
> There is no simple way to get the origin section of a DWARFUnit. It is
> necessary
> to know from which section a Unit has been extracted to be able to resolve
> cross-unit references (to find the right list to search fo the reference
> target).
>

Would it make more sense to give it the actual section (or some kind of
alias/handle to it) rather than a flag? That way it'd work for fission
(split-dwarf) as well, and type units that may be in comdat sections?


>
> This patch adds a field and an accessor to the DWARFUnit that indicates
> where
> it originated from. This information will be used in a subsequent patch to
> implement a generic version of DWARFContext::getCompilationUnitForOffset()
> that will work with arbitrary unit types.
>
> Note that this is nearly implemented like the start of LLVM-style RTTI for
> the DWARFUnit, but it seems that we don't need separate classes to
> represent
> the DWO variants of Units as only their origin changes. Thus we only
> introduce this discriminant field.
>
> http://reviews.llvm.org/D5264
>
> Files:
>   lib/DebugInfo/DWARFCompileUnit.h
>   lib/DebugInfo/DWARFContext.cpp
>   lib/DebugInfo/DWARFTypeUnit.h
>   lib/DebugInfo/DWARFUnit.cpp
>   lib/DebugInfo/DWARFUnit.h
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140909/19f0a47a/attachment.html>


More information about the llvm-commits mailing list