[5/5] XML writer: resolve declaration-only enum definitions
Commit Message
Let the writer look through declaration-only enums for definitions.
This matches what get_preferred_type, write_class_decl and
write_union_decl do. No current test cases are affected.
* src/abg-writer.cc (write_enum_type_decl): Look through
declaration-only types the same as for structs and unions.
Reviewed-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
---
src/abg-writer.cc | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
Comments
Matthias Maennich <maennich@google.com> a écrit:
> Let the writer look through declaration-only enums for definitions.
>
> This matches what get_preferred_type, write_class_decl and
> write_union_decl do. No current test cases are affected.
>
> * src/abg-writer.cc (write_enum_type_decl): Look through
> declaration-only types the same as for structs and unions.
>
> Reviewed-by: Giuliano Procida <gprocida@google.com>
> Signed-off-by: Matthias Maennich <maennich@google.com>
Applied to master, thanks!
[...]
Cheers,
@@ -3020,14 +3020,16 @@ write_array_type_def(const array_type_def_sptr& decl,
///
/// @return true upon succesful completion, false otherwise.
static bool
-write_enum_type_decl(const enum_type_decl_sptr& decl,
- const string& id,
- write_context& ctxt,
- unsigned indent)
+write_enum_type_decl(const enum_type_decl_sptr& d,
+ const string& id,
+ write_context& ctxt,
+ unsigned indent)
{
- if (!decl)
+ if (!d)
return false;
+ enum_type_decl_sptr decl = is_enum_type(look_through_decl_only_enum(d));
+
annotate(decl->get_canonical_type(), ctxt, indent);
ostream& o = ctxt.get_ostream();