diff options
author | Matthias Maennich <maennich@google.com> | 2021-12-03 11:46:23 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@redhat.com> | 2022-01-19 11:34:55 +0100 |
commit | e5bed8512fb34f12ded5b0aac73d837e02d7f404 (patch) | |
tree | 4b669a13cad3d6aae86ead51519964cf95af781b | |
parent | XML writer: map type ids by bare pointer (diff) | |
download | libabigail-e5bed8512fb34f12ded5b0aac73d837e02d7f404.tar.gz libabigail-e5bed8512fb34f12ded5b0aac73d837e02d7f404.tar.bz2 libabigail-e5bed8512fb34f12ded5b0aac73d837e02d7f404.tar.xz |
XML writer: resolve declaration-only enum definitions
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>
-rw-r--r-- | src/abg-writer.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/abg-writer.cc b/src/abg-writer.cc index 7ed8327a..24a1fd56 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc | |||
@@ -3008,14 +3008,16 @@ write_array_type_def(const array_type_def_sptr& decl, | |||
3008 | /// | 3008 | /// |
3009 | /// @return true upon succesful completion, false otherwise. | 3009 | /// @return true upon succesful completion, false otherwise. |
3010 | static bool | 3010 | static bool |
3011 | write_enum_type_decl(const enum_type_decl_sptr& decl, | 3011 | write_enum_type_decl(const enum_type_decl_sptr& d, |
3012 | const string& id, | 3012 | const string& id, |
3013 | write_context& ctxt, | 3013 | write_context& ctxt, |
3014 | unsigned indent) | 3014 | unsigned indent) |
3015 | { | 3015 | { |
3016 | if (!decl) | 3016 | if (!d) |
3017 | return false; | 3017 | return false; |
3018 | 3018 | ||
3019 | enum_type_decl_sptr decl = is_enum_type(look_through_decl_only_enum(d)); | ||
3020 | |||
3019 | annotate(decl->get_canonical_type(), ctxt, indent); | 3021 | annotate(decl->get_canonical_type(), ctxt, indent); |
3020 | 3022 | ||
3021 | ostream& o = ctxt.get_ostream(); | 3023 | ostream& o = ctxt.get_ostream(); |