mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-29 21:32:08 +00:00
d3b188f859
* include/abg-ir.h (template_parameter_sptr, template_decl_sptr) (template_decl_wptr): Declare new typedefs. (class template_decl): Make this virtually inherit decl_base and pimpl-ify it. (class template_parameter): Pimpl-ify this. Make the constructor take the enclosing template parameter. (struct template_decl::hash): Declare this here, rather than in src/abg-hash.cc (class type_tparameter, non_type_tparameter, template_tparameter) (class type_composition, function_tdecl, class_tdecl): Pimpl-ify this. * src/abg-hash.cc (template_parameter:#️⃣:operator()): Hash the enclosing template parameter. Avoid infinite recursion due to the loop hash parameter -> hash template -> hash parameter. (template_decl:#️⃣:operator()) Define this here, now that it's declared in abg-ir.h. Also, avoid infinite recursion here; this is complementary to what is done in the hashing for template_parameter. ({type_tparameter, template_tparameter, }:#️⃣:operator()): Cache the calculated hash just as what is done for other types hashed. (template_decl::priv): Define this new type. (template_decl::{add_template_parameter, get_template_parameters, ~template_decl}): Define these here to pimpl-ify template_decl. (template_parameter::priv): Define this new type. (template_parameter::template_parameter): Define this here to pimpl-ify template_parameter. Note also that this now takes the enclosing template decl. (template_parameter::{get_index, get_enclosing_template_decl, get_hashing_has_started, set_hashing_has_started, operator::==}): Define these here to pimpl-ify template_parameter. (type_tparameter::priv): Define this new type. (type_tparameter::type_tparameter): Define this here to pimpl-ify type_tparameter. Also, not that this constructor now takes the enclosing template decl. (class non_type_tparameter::priv): Define new type. (non_type_tparameter::{non_type_tparameter, get_type}): Define these here to pimpl-ify non_type_tparameter. The constructor now takes the enclosing template. (template_tparameter::priv): Define new type. (template_tparameter::template_tparameter): Define this here to pimpl-ify template_tparameter. This constructor now takes the enclosing template. (class type_composition::priv): New type. (type_composition::{type_composition, get_composed_type, set_composed_type}): Define these here to pimpl-ify type_composition. The constructor now takes the enclosing template decl. (class function_tdecl::priv): Define new type. (function_tdecl::{function_tdecl, set_pattern, get_pattern, get_binding}): Define this here to pimpl-ify function_tdecl. (class class_tdecl::priv): Define this new type. (class_tdecl::class_tdecl): Define this here to pimpl-ify class_tdecl. (class_tdecl::set_pattern): Adjust to pimpl-ify. (class_tdecl::get_pattern): Define new pimpl-ified getter. * src/abg-reader.cc (build_function_tdecl, build_class_tdecl): Cleanup. Pass the enclosing template to the template parameters that are built. (build_type_tparameter, build_type_composition) (build_non_type_tparameter, build_template_tparameter) (build_template_parameter): Take the enclosing template declaration and pass it to the template parameter being created. * tests/data/test-read-write/test12.xml: Fix and Adjust. * tests/data/test-read-write/test13.xml: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
32 lines
1.3 KiB
XML
32 lines
1.3 KiB
XML
<abi-instr version='1.0' path='data/test-read-write/test13.xml'>
|
|
<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>
|