Initial support for variant parts
authorTom Tromey <tom@tromey.com>
Fri, 9 Feb 2018 20:31:42 +0000 (13:31 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 26 Feb 2018 16:21:08 +0000 (09:21 -0700)
commit7c22600aabfd10e190e98fff0b7c2d69cd191325
treefe62912bb7071c2d73027cd20f5c0b3c7fb8bf04
parent15ce8941e7d2807a3396a6874c528b24c387660a
Initial support for variant parts

This adds some initial support for variant parts to gdbtypes.h.  A
variant part is represented as a union.  The union has a flag
indicating that it has a discriminant, and information about the
discriminant is attached using the dynamic property system.

2018-02-26  Tom Tromey  <tom@tromey.com>

* value.h (value_union_variant): Declare.
* valops.c (value_union_variant): New function.
* gdbtypes.h (TYPE_FLAG_DISCRIMINATED_UNION): New macro.
(struct discriminant_info): New.
(enum dynamic_prop_node_kind) <DYN_PROP_DISCRIMINATED>: New
enumerator.
(struct main_type) <flag_discriminated_union>: New field.
gdb/ChangeLog
gdb/gdbtypes.h
gdb/valops.c
gdb/value.h