libabigail/tests/data/test-read-write/test17.xml
Dodji Seketeli c243aac0a4 Support method type/decl, variadic functions, class declarations-only
* src/abg-ir.h (function_decl::parameter::parameter): New
	constructor with variadic parameter marker.
	(function_decl::m_type): Make this protected to let method_decl
	inheriting class to access it.
	(function_decl::get_type): Move this out-of-line.
	(class method_type, method_type_hash): New types.
	(enum class_decl::access_specifier): Add no_access new enumerator.
	(class_decl::data_member::data_member): Move this out-of-line.
	(class_decl::data_member::~data_member): Declare virtual
	destructor.
	(class method_decl): New class.
	(class member_function): Make this inherit method_decl, instead of
	function_decl.
	(class_decl::class_decl): New constructors.
	(class_decl::{hashing_started, is_declaration_only,
	set_earlier_declaration, get_earlier_declaration}): New methods.
	* src/abg-ir.cc (add_decl_to_scope): If a decl is already in a
	scope, don't add it to this scope.
	(get_global_scope): Make this work when passed an instance of
	global_scope.
	(dynamic_type_hash::operator()): Add support for method_type.
	(method_type::{method_type, set_class_type, ~method_type, })
	(method_type_hash::operator()): New defintions.
	(function_decl::get_type, class_decl::class_decl): Move these
	out-of-line here.
	(class_decl::method_decl::{method_decl, ~method_decl, get_type}):
	New definitions.
	(class_decl::member_function::member_function): Move this
	out-of-line here.  Support method_decl.
	(class_decl::data_member::data_member): Likewise.
	(class_decl_hash::operator()): Guard this against endless loop.
	* src/abg-reader.cc (write_class_is_declaration_only): New static
	function.
	(write_var_decl): Take a flag to write the mangled name or not.
	(write_function_decl): Take a flag to skip the first parameter.
	(write_cdtor_const_static): Use 'yes' instead of 'true' as value
	of the properties.
	(write_decl, write_function_template_decl): Adjust wrt the new
	signatures of write_var_decl and write_function_decl.
	(write_enum_type_decl): Simplify call to write_location.
	(write_class_decl): Support serializing declaration-only classes.
	* src/abg-writer.cc:
	* tests/data/test-read-write/test17.xml: New test input.
	* tests/test-read-write.cc: De-serialize the above, and serialize it back.
	* tests/data/test-read-write/test10.xml: Update this test.
2013-07-23 23:13:53 +02:00

52 lines
3.2 KiB
XML

<abi-instr version='1.0'>
<type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-1'/>
<type-decl name='char' size-in-bits='8' alignment-in-bits='8' id='type-id-2'/>
<type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='type-id-3'/>
<enum-decl name='E' filepath='../../prtests/test.cc' line='1' column='6' id='type-id-4'>
<underlying-type type-id='type-id-3'/>
<enumerator name='e0' value='0'/>
<enumerator name='e1' value='1'/>
</enum-decl>
<class-decl name='S' visibility='default' is-declaration-only='yes' id='type-id-5'/>
<type-decl name='void' alignment-in-bits='8' id='type-id-6'/>
<pointer-type-def type-id='type-id-5' size-in-bits='64' alignment-in-bits='64' id='type-id-7'/>
<reference-type-def kind='lvalue' type-id='type-id-5' size-in-bits='64' alignment-in-bits='64' id='type-id-8'/>
<class-decl name='S' size-in-bits='96' alignment-in-bits='32' visibility='default' filepath='../../prtests/test.cc' line='3' column='8' id='type-id-9'>
<data-member access='public'>
<var-decl name='m0' type-id='type-id-1' visibility='default' filepath='../../prtests/test.cc' line='5' column='7'/>
</data-member>
<data-member access='public'>
<var-decl name='m1' type-id='type-id-2' visibility='default' filepath='../../prtests/test.cc' line='6' column='8'/>
</data-member>
<data-member access='public'>
<var-decl name='m2' type-id='type-id-4' visibility='default' filepath='../../prtests/test.cc' line='7' column='10'/>
</data-member>
<member-function access='public'>
<function-decl name='S' mangled-name='_ZN1SC1Ev *INTERNAL* ' filepath='../../prtests/test.cc' line='9' column='3' declared-inline='yes' visibility='default' binding='global' size-in-bits='8' alignment-in-bits='8'>
<parameter type-id='type-id-7'/>
<return type-id='type-id-6'/>
</function-decl>
</member-function>
<member-function access='public'>
<function-decl name='__base_ctor ' mangled-name='_ZN1SC2Ev' filepath='../../prtests/test.cc' line='9' 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-6'/>
</function-decl>
</member-function>
<member-function access='public'>
<function-decl name='__comp_ctor ' mangled-name='_ZN1SC1Ev' filepath='../../prtests/test.cc' line='9' 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-6'/>
</function-decl>
</member-function>
<member-function access='public'>
<function-decl name='S' mangled-name='_ZN1SC1ERKS_ *INTERNAL* ' filepath='../../prtests/test.cc' line='15' column='3' declared-inline='yes' visibility='default' binding='global' size-in-bits='8' alignment-in-bits='8'>
<parameter type-id='type-id-7'/>
<parameter type-id='type-id-8'/>
<return type-id='type-id-6'/>
</function-decl>
</member-function>
</class-decl>
<var-decl name='var' type-id='type-id-9' mangled-name='var' visibility='default' binding='global' filepath='../../prtests/test.cc' line='30' column='3'/>
</abi-instr>