libabigail/tests/data/test-read-write/test20.xml
Dodji Seketeli 9b99a77d8a Support offsets and virtual attribute in base class specifiers
* src/abg-ir.h (class_decl::base_spec::base_spec): Take an offset
	and a is_virtual flag.
	(class_decl::base_spec::{get_is_virtual, get_offset_in_bits}): New
	methods.
	(class_decl::has_no_base_nor_member): New method declaration..
	* src/abg-ir.cc (class_decl::base_spec::base_spec): Take an offset
	and a is_virtual flag
	(class_decl::has_no_base_nor_member): Define it.
	* src/abg-reader.cc (read_offset_in_bits): Renamed
	read_var_offset_in_bits into this.
	(read_is_virtual): New static function.
	(build_class_decl): Read the 'layout-offset-in-bits' and the
	'is-virtual' of the base class specifier.  Adjust for the
	read_var_offset_in_bits -> read_offset_in_bits rename.
	* src/abg-writer.cc (write_layout_offset): New overload for the
	base class specifiers.
	(write_class_decl): If the class has no member or base class, make
	it a proper empty xml element.  Write the offset and the
	is-virtual attribute.
	* tests/data/test-read-write/test20.xml: New test input data.
	* tests/test-read-write.cc: De-serialize the test above, serialize
	it back and compare that both versions are the same.
2013-07-23 23:13:53 +02:00

89 lines
6.6 KiB
XML

<abi-instr version='1.0'>
<type-decl name='void' alignment-in-bits='8' id='type-id-1'/>
<function-decl name='foo' mangled-name='_Z3foov' filepath='../../prtests/test9.cc' line='78' column='1' visibility='default' binding='global' size-in-bits='8' alignment-in-bits='8'>
<return type-id='type-id-1'/>
</function-decl>
<type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-2'/>
<class-decl name='B0' visibility='default' is-declaration-only='yes' id='type-id-3'/>
<pointer-type-def type-id='type-id-3' size-in-bits='64' alignment-in-bits='64' id='type-id-4'/>
<class-decl name='B0' size-in-bits='32' alignment-in-bits='32' visibility='default' filepath='../../prtests/test9.cc' line='1' column='7' def-of-decl-id='type-id-3' id='type-id-5'>
<data-member access='private' layout-offset-in-bits='0'>
<var-decl name='m0' type-id='type-id-2' visibility='default' filepath='../../prtests/test9.cc' line='3' column='7'/>
</data-member>
<member-function access='public'>
<function-decl name='__base_ctor ' mangled-name='_ZN2B0C2Ev' filepath='../../prtests/test9.cc' line='7' column='3' declared-inline='yes' visibility='default' binding='weak' size-in-bits='8' alignment-in-bits='8'>
<parameter type-id='type-id-4'/>
<return type-id='type-id-1'/>
</function-decl>
</member-function>
<member-function access='public'>
<function-decl name='__comp_ctor ' mangled-name='_ZN2B0C1Ev' filepath='../../prtests/test9.cc' line='7' column='3' declared-inline='yes' visibility='default' binding='weak' size-in-bits='8' alignment-in-bits='8'>
<parameter type-id='type-id-4'/>
<return type-id='type-id-1'/>
</function-decl>
</member-function>
</class-decl>
<class-decl name='B1' visibility='default' is-declaration-only='yes' id='type-id-6'/>
<pointer-type-def type-id='type-id-6' size-in-bits='64' alignment-in-bits='64' id='type-id-7'/>
<class-decl name='B1' size-in-bits='32' alignment-in-bits='32' visibility='default' filepath='../../prtests/test9.cc' line='20' column='7' def-of-decl-id='type-id-6' id='type-id-8'>
<data-member access='private' layout-offset-in-bits='0'>
<var-decl name='m0' type-id='type-id-2' visibility='default' filepath='../../prtests/test9.cc' line='22' column='7'/>
</data-member>
<member-function access='public'>
<function-decl name='__base_ctor ' mangled-name='_ZN2B1C2Ev' filepath='../../prtests/test9.cc' line='26' column='3' declared-inline='yes' visibility='default' binding='weak' size-in-bits='8' alignment-in-bits='8'>
<parameter type-id='type-id-7'/>
<return type-id='type-id-1'/>
</function-decl>
</member-function>
<member-function access='public'>
<function-decl name='__comp_ctor ' mangled-name='_ZN2B1C1Ev' filepath='../../prtests/test9.cc' line='26' column='3' declared-inline='yes' visibility='default' binding='weak' size-in-bits='8' alignment-in-bits='8'>
<parameter type-id='type-id-7'/>
<return type-id='type-id-1'/>
</function-decl>
</member-function>
</class-decl>
<class-decl name='B2' visibility='default' is-declaration-only='yes' id='type-id-9'/>
<pointer-type-def type-id='type-id-9' size-in-bits='64' alignment-in-bits='64' id='type-id-10'/>
<class-decl name='B2' size-in-bits='32' alignment-in-bits='32' visibility='default' filepath='../../prtests/test9.cc' line='39' column='7' def-of-decl-id='type-id-9' id='type-id-11'>
<data-member access='private' layout-offset-in-bits='0'>
<var-decl name='m0' type-id='type-id-2' visibility='default' filepath='../../prtests/test9.cc' line='41' column='7'/>
</data-member>
<member-function access='public'>
<function-decl name='__base_ctor ' mangled-name='_ZN2B2C2Ev' filepath='../../prtests/test9.cc' line='45' column='3' declared-inline='yes' visibility='default' binding='weak' size-in-bits='8' alignment-in-bits='8'>
<parameter type-id='type-id-10'/>
<return type-id='type-id-1'/>
</function-decl>
</member-function>
<member-function access='public'>
<function-decl name='__comp_ctor ' mangled-name='_ZN2B2C1Ev' filepath='../../prtests/test9.cc' line='45' column='3' declared-inline='yes' visibility='default' binding='weak' size-in-bits='8' alignment-in-bits='8'>
<parameter type-id='type-id-10'/>
<return type-id='type-id-1'/>
</function-decl>
</member-function>
</class-decl>
<class-decl name='S' visibility='default' is-declaration-only='yes' id='type-id-12'/>
<pointer-type-def type-id='type-id-12' size-in-bits='64' alignment-in-bits='64' id='type-id-13'/>
<class-decl name='S' size-in-bits='192' alignment-in-bits='64' visibility='default' filepath='../../prtests/test9.cc' line='58' column='7' id='type-id-14'>
<base-class access='public' layout-offset-in-bits='64' type-id='type-id-5'/>
<base-class access='public' layout-offset-in-bits='96' type-id='type-id-8'/>
<base-class access='private' layout-offset-in-bits='160' is-virtual='yes' type-id='type-id-11'/>
<data-member access='private' layout-offset-in-bits='128'>
<var-decl name='m0' type-id='type-id-2' visibility='default' filepath='../../prtests/test9.cc' line='60' column='7'/>
</data-member>
<member-function access='public'>
<function-decl name='__comp_ctor ' mangled-name='_ZN1SC1Ev' filepath='../../prtests/test9.cc' line='64' column='3' declared-inline='yes' visibility='default' binding='weak' size-in-bits='8' alignment-in-bits='8'>
<parameter type-id='type-id-13'/>
<return type-id='type-id-1'/>
</function-decl>
</member-function>
</class-decl>
<class-decl name='__class_type_info_pseudo' size-in-bits='128' alignment-in-bits='64' visibility='default' id='type-id-15'/>
<qualified-type-def type-id='type-id-15' const='yes' id='type-id-16'/>
<var-decl name='_ZTI2B0' type-id='type-id-16' mangled-name='_ZTI2B0' visibility='default' binding='weak' filepath='../../prtests/test9.cc' line='81' column='1'/>
<var-decl name='_ZTI2B2' type-id='type-id-16' mangled-name='_ZTI2B2' visibility='default' binding='weak' filepath='../../prtests/test9.cc' line='81' column='1'/>
<var-decl name='_ZTI2B1' type-id='type-id-16' mangled-name='_ZTI2B1' visibility='default' binding='weak' filepath='../../prtests/test9.cc' line='81' column='1'/>
<class-decl name='__vmi_class_type_info_pseudo3' size-in-bits='576' alignment-in-bits='64' visibility='default' id='type-id-17'/>
<qualified-type-def type-id='type-id-17' const='yes' id='type-id-18'/>
<var-decl name='_ZTI1S' type-id='type-id-18' mangled-name='_ZTI1S' visibility='default' binding='weak' filepath='../../prtests/test9.cc' line='58' column='7'/>
</abi-instr>