libabigail/tests/data/test-read-write/test13.xml
Dodji Seketeli 0c65215330 Support function_type and adapt a function_decl to use it
* src/abg-ir.h (class function_type): Forward decl prior to class
	function_decl.
	(function_decl::parameter): Pass string by const reference.  Add a
	variadic marker member and initialize it.
	(function_decl::parameter::get_type): Add a non-const overload.
	(function_decl::parameter::get_variadic_marker): New getter.
	(function_decl::function_decl) Take a const reference to a vector
	for parameters, type size/alignment.  Add two overloads that takes a
	pointer to function_type.
	(function_decl::get_parameters): Move this out-of-line.
	(function_decl::append_parameter(s)): Renamed
	function_decl::add_parameter(s) into these.  Move it out-of-line.
	Add an overload.
	(function_decl::{get_type, set_type}): New declaration.
	(function_decl::get_return_type): Move this out-of-line.
	(function_decl::is_variadic): New in-line function.
	(function_decl::m_type): New data member.
	(function_decl::{m_parms, m_return_type}): Remove.  This are now
	carried by function_decl::m_type.
	(class function_type, struct function_type_hash): New
	declarations.
	(member_function::member_function): Take a vector of pointers to
	parameters.  Take size/align of the type of the member function.
	Adjust initialization.
	* src/abg-ir.cc (dynamic_type_hash): Hash instance of
	function_type accessed through a pointer.
	(function_type::{operator==, ~function_type})
	(function_type_hash::operaror(), function_decl::{get_return_type,
	}, function_decl::parameter:#️⃣:operator()): New definitions.
	(function_decl::function_decl): The out-of-line definitions of the
	declarations above.
	(function_decl::append_parameter): Moved this out-of-line from
	inline function_decl::add_parameter.  Make this rely on the
	underlying m_type.
	(function_decl::operator==): Adjust for use of vector for the
	parameters.  Also, there is no need anymore to compare the
	parameters or the return types as they are compared by the
	comparison of the function types.
	* src/abg-reader.cc (build_function_decl): Read the new size/alignment
	attributes on the function-decl element.  Build a function_type
	and use it to build the function_decl.  Parameters and return type
	are now hung off of the function_type.
	(handle_function_decl): use build_function_decl.
	* src/abg-writer.cc (write_function_decl): Write the new
	size/alignment properties of the function-decl element.  Adjust
	for the use of vectors for function parameters now.
	* tests/data/test-read-write/test10.xml: Adjust for the presence
	of size/alignment properties in the function-decl element now.
	* tests/data/test-read-write/test11.xml: Likewise.
	* tests/data/test-read-write/test12.xml: Likewise.
	* tests/data/test-read-write/test13.xml: Likewise.
	* tests/data/test-read-write/test14.xml: Likewise.
	* tests/data/test-read-write/test9.xml: Likewise.
2013-07-23 23:13:53 +02:00

32 lines
1.3 KiB
XML

<abi-instr version='1.0'>
<type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-1'/>
<namespace-decl name='ns0'>
<namespace-decl name='ns1'>
<function-template-decl id='fn-tmpl-id-2'>
<template-type-parameter id='type-id-3' name='T'/>
<template-parameter-type-composition>
<pointer-type-def type-id='type-id-3' id='type-id-4'/>
</template-parameter-type-composition>
<template-non-type-parameter type-id='type-id-4' name='U'/>
<function-decl name='foo' binding='global' size-in-bits='8' alignment-in-bits='8'>
<parameter type-id='type-id-3' name='first'/>
<return type-id='type-id-1'/>
</function-decl>
</function-template-decl>
</namespace-decl>
</namespace-decl>
<namespace-decl name='ns2'>
<namespace-decl name='ns3'>
<namespace-decl name='ns4'>
<function-template-decl id='fn-tmpl-id-5'>
<template-type-parameter id='type-id-6' name='T'/>
<function-decl name='bar' binding='global'>
<parameter type-id='type-id-6' name='first'/>
<return type-id='type-id-1'/>
</function-decl>
</function-template-decl>
</namespace-decl>
</namespace-decl>
</namespace-decl>
</abi-instr>