[applied] dwarf-reader: properly set artificial-ness in opaque types
Commit Message
Hello,
get_opaque_version_of_type forgets to set the "is-artificial" property
according to the initial type the opaque type is derived from. This
can lead to some instability in the abixml output.
Fixed thus.
* src/abg-dwarf-reader.cc (get_opaque_version_of_type): Propagate
the artificial-ness of the original type here.
* tests/data/test-read-dwarf/PR27700/test-PR27700.abi: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
src/abg-dwarf-reader.cc | 2 ++
tests/data/test-read-dwarf/PR27700/test-PR27700.abi | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
@@ -14041,6 +14041,7 @@ get_opaque_version_of_type(read_context &ctxt,
type_location,
decl_base::VISIBILITY_DEFAULT));
klass->set_is_declaration_only(true);
+ klass->set_is_artificial(die_is_artificial(type_die));
add_decl_to_scope(klass, scope);
ctxt.associate_die_to_type(type_die, klass, where_offset);
ctxt.maybe_schedule_declaration_only_class_for_resolution(klass);
@@ -14069,6 +14070,7 @@ get_opaque_version_of_type(read_context &ctxt,
underlying_type,
enumeratorz,
linkage_name));
+ enum_type->set_is_artificial(die_is_artificial(type_die));
add_decl_to_scope(enum_type, scope);
result = enum_type;
}
@@ -5,7 +5,7 @@
<abi-instr address-size='64' path='test-PR27700.c' comp-dir-path='/home/dodji/git/libabigail/PR27700/tests/data/test-read-dwarf/PR27700' language='LANG_C11'>
<type-decl name='unnamed-enum-underlying-type-32' is-anonymous='yes' size-in-bits='32' alignment-in-bits='32' id='9cac1fee'/>
<type-decl name='void' id='48b5725f'/>
- <enum-decl name='foo' is-artificial='yes' filepath='include-dir/priv.h' line='1' column='1' id='022218d8'>
+ <enum-decl name='foo' filepath='include-dir/priv.h' line='1' column='1' id='022218d8'>
<underlying-type type-id='9cac1fee'/>
</enum-decl>
<pointer-type-def type-id='022218d8' size-in-bits='64' id='8750e847'/>