[PATCH] D42082: Add DWARF for discriminated unions

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 14:29:03 PST 2018


Any difficulty with modelling this more generally - having a
DW_TAG_enum_type (DICompositeType) with a member that's a
DW_TAG_variant_part (probably another DICompositeType?) with the members -
so it doesn't matter whether there's a discriminator on the enum_type, but
there can be when needed.

On Thu, Jan 18, 2018 at 2:26 PM Tom Tromey via Phabricator <
reviews at reviews.llvm.org> wrote:

> tromey added a comment.
>
> Having the DIE shape conform to DWARF seems easy in this patch -- just a
> reordering in `DwarfUnit::constructDiscriminatorDIE`.  However I don't see
> how to nicely support univariant Rust enums; the variant part is triggered
> by having a discriminator, but these objects don't have enumerators.
>
> Maybe one idea would be to have `DIBuilder::createDiscriminatedUnionType`
> use `DW_TAG_variant_part` as its tag, then fix things up when emitting the
> DIEs in DwarfUnit.cpp.  Is that too gross?
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D42082
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180118/9afe817a/attachment.html>


More information about the llvm-commits mailing list