[PATCH] D42082: Add DWARF for discriminated unions

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 14:36:40 PST 2018


probinson added a comment.

In https://reviews.llvm.org/D42082#980526, @tromey wrote:

> I was thinking perhaps a variant part with a single child but no discriminant.  The case in question here is something like
>
>   enum Univariant { TheSoleVariant(u8) }
>


So, a struct_type with a variant_part with only one variant?  That seems fine.

> If we're concerned about non-Rust-aware debuggers, or the wrath of the Sony person, then a new tag would be a better choice.

If you can construct syntactically valid DWARF with existing tags and it describes the Rust construct sensibly, there's no need for a new tag.  I thought you meant having a variant_part with *no* variants, which would be weird enough to be a potential problem.  Sorry about the misunderstanding!


Repository:
  rL LLVM

https://reviews.llvm.org/D42082





More information about the llvm-commits mailing list