Lines Matching defs:rdr
77 static void maybe_set_naming_typedef(reader& rdr,
82 static int advance_cursor(reader& rdr);
88 walk_xml_node_to_map_type_ids(reader& rdr, xmlNodePtr node);
91 read_elf_needed_from_input(reader& rdr, vector<string>& needed);
94 read_symbol_db_from_input(reader& rdr,
99 read_translation_unit_from_input(fe_iface& rdr);
136 get_artifact_used_by_relation_map(reader& rdr);
1329 function_is_suppressed(const reader& rdr,
1339 variable_is_suppressed(const reader& rdr,
1432 #define RECORD_ARTIFACT_AS_USED_BY(rdr, used, user) \
1433 rdr.record_artifact_as_used_by(used,user)
1434 #define RECORD_ARTIFACTS_AS_USED_IN_FN_DECL(rdr, fn) \
1435 rdr.record_artifacts_as_used_in_fn_decl(fn)
1436 #define RECORD_ARTIFACTS_AS_USED_IN_FN_TYPE(rdr, fn_type)\
1437 rdr.record_artifacts_as_used_in_fn_type(fn_type)
1439 #define RECORD_ARTIFACT_AS_USED_BY(rdr, used, user)
1440 #define RECORD_ARTIFACTS_AS_USED_IN_FN_DECL(rdr, fn)
1441 #define RECORD_ARTIFACTS_AS_USED_IN_FN_TYPE(rdr, fn_type)
1563 /// @param rdr the ABIXML reader
1566 advance_cursor(reader& rdr)
1568 xml::reader_sptr reader = rdr.get_libxml_reader();
1576 /// @param rdr the context of the reader.
1581 walk_xml_node_to_map_type_ids(reader& rdr,
1592 rdr.map_id_and_node(id, n);
1596 walk_xml_node_to_map_type_ids(rdr, n);
1602 abixml::reader& rdr = dynamic_cast<abixml::reader&>(iface);
1604 if (!rdr.corpus()->is_empty())
1605 tu.set_corpus(rdr.corpus().get());
1633 rdr.push_decl(tu.get_global_scope());
1634 rdr.map_xml_node_to_decl(node, tu.get_global_scope());
1636 if (rdr.get_id_xml_node_map().empty()
1637 || !rdr.corpus())
1638 walk_xml_node_to_map_type_ids(rdr, node);
1643 handle_element_node(rdr, n, /*add_decl_to_scope=*/true);
1645 rdr.pop_scope_or_abort(tu.get_global_scope());
1647 xml::reader_sptr reader = rdr.get_libxml_reader();
1651 rdr.clear_per_translation_unit_data();
1664 /// @param rdr the ABIXML reader.
1670 get_or_read_and_add_translation_unit(reader& rdr, xmlNodePtr node)
1672 corpus_sptr corp = rdr.corpus();
1690 tu.reset(new translation_unit(rdr.get_environment(), tu_path));
1694 if (read_translation_unit(rdr, *tu, node))
1704 /// @param rdr the current input context
1713 abixml::reader& rdr = dynamic_cast<abixml::reader&>(iface);
1715 xmlNodePtr node = rdr.get_corpus_node();
1718 xml::reader_sptr reader = rdr.get_libxml_reader();
1726 status = advance_cursor (rdr);
1739 for (xmlNodePtr n = rdr.get_corpus_node();
1753 tu = get_or_read_and_add_translation_unit(rdr, node);
1755 if (rdr.get_corpus_node())
1759 // rdr.get_corpus_node to the next child element node of the
1762 rdr.set_corpus_node(node);
1776 /// @param rdr the reader to use for the parsing.
1786 read_symbol_db_from_input(reader& rdr,
1790 xml::reader_sptr reader = rdr.get_libxml_reader();
1794 if (!rdr.get_corpus_node())
1800 status = advance_cursor (rdr);
1820 fn_symdb = build_elf_symbol_db(rdr, node, true);
1822 var_symdb = build_elf_symbol_db(rdr, node, false);
1827 for (xmlNodePtr n = rdr.get_corpus_node(); n; n = xmlNextElementSibling(n))
1836 rdr.set_corpus_node(n);
1841 fn_symdb = build_elf_symbol_db(rdr, n, true);
1843 var_symdb = build_elf_symbol_db(rdr, n, false);
1889 /// @param rdr the ABIXML reader used to the xml reading.
1895 read_elf_needed_from_input(reader& rdr,
1898 xml::reader_sptr reader = rdr.get_libxml_reader();
1904 if (rdr.get_corpus_node() == 0)
1909 status = advance_cursor (rdr);
1924 for (xmlNodePtr n = rdr.get_corpus_node();
1940 rdr.set_corpus_node(node);
1965 /// @param rdr the context that is going to be used by functions that
1972 add_reader_suppressions(reader& rdr,
1979 rdr.suppressions().push_back(*i);
1986 /// @param rdr the @reader to consider.
1994 abixml::reader& rdr = dynamic_cast<abixml::reader&>(iface);
1995 rdr.tracking_non_reachable_types(flag);
2004 /// @param rdr the abixml text reader context to use.
2010 xml_reader::reader& rdr = dynamic_cast<xml_reader::reader&>(iface);
2011 auto it = rdr.m_types_map.find(type_id);
2012 if (it == rdr.m_types_map.end())
2022 /// @param rdr the abixml text reader context to use.
2026 xml_reader::reader& rdr = dynamic_cast<xml_reader::reader&>(iface);
2027 return &rdr.m_artifact_used_by_map;
2067 /// @param rdr the current input context.
2075 abixml::reader& rdr = dynamic_cast<abixml::reader&>(iface);
2076 xml::reader_sptr reader = rdr.get_libxml_reader();
2084 status = advance_cursor (rdr);
2090 if (!rdr.corpus_group())
2092 corpus_group_sptr g(new corpus_group(rdr.get_environment(),
2093 rdr.get_path()));
2095 rdr.corpus_group(g);
2098 corpus_group_sptr group = rdr.corpus_group();
2111 rdr.set_corpus_node(node);
2115 while ((corp = rdr.read_corpus(sts)))
2116 rdr.corpus_group()->add_corpus(corp);
2120 return rdr.corpus_group();
2139 fe_iface_sptr rdr = create_reader(in, env);
2140 return read_corpus_group_from_input(*rdr);
2161 fe_iface_sptr rdr = create_reader(path, env);
2162 corpus_group_sptr group = read_corpus_group_from_input(*rdr);
2179 reader rdr(xml::new_reader_from_file(input_file), env);
2180 translation_unit_sptr tu = read_translation_unit_from_input(rdr);
2182 rdr.perform_late_type_canonicalizing();
2201 reader rdr(xml::new_reader_from_buffer(buffer), env);
2202 translation_unit_sptr tu = read_translation_unit_from_input(rdr);
2204 rdr.perform_late_type_canonicalizing();
2212 /// @param rdr the @ref reader to consider.
2219 abixml::reader& rdr = dynamic_cast<abixml::reader&>(iface);
2220 translation_unit_sptr tu = read_translation_unit_from_input(rdr);
2221 rdr.options().env.canonicalization_is_done(false);
2222 rdr.perform_late_type_canonicalizing();
2223 rdr.options().env.canonicalization_is_done(true);
2232 /// @param rdr the current parsing context.
2236 handle_element_node(reader& rdr, xmlNodePtr node,
2243 ((decl = handle_namespace_decl(rdr, node, add_to_current_scope))
2244 ||(decl = handle_type_decl(rdr, node, add_to_current_scope))
2245 ||(decl = handle_qualified_type_decl(rdr, node,
2247 ||(decl = handle_pointer_type_def(rdr, node,
2249 || (decl = handle_reference_type_def(rdr, node, add_to_current_scope))
2250 || (decl = handle_function_type(rdr, node, add_to_current_scope))
2251 || (decl = handle_array_type_def(rdr, node, add_to_current_scope))
2252 || (decl = handle_enum_type_decl(rdr, node,
2254 || (decl = handle_typedef_decl(rdr, node,
2256 || (decl = handle_var_decl(rdr, node,
2258 || (decl = handle_function_decl(rdr, node,
2260 || (decl = handle_class_decl(rdr, node,
2262 || (decl = handle_union_decl(rdr, node,
2264 || (decl = handle_function_tdecl(rdr, node,
2266 || (decl = handle_class_tdecl(rdr, node,
2272 if (rdr.tracking_non_reachable_types())
2276 corpus_sptr abi = rdr.corpus();
2290 ///@param rdr the current parsing context
2296 read_location(const reader& rdr,
2307 return read_artificial_location(rdr, node, loc);
2312 return read_artificial_location(rdr, node, loc);
2317 reader& c = const_cast<reader&>(rdr);
2329 ///@param rdr the current parsing context
2335 read_artificial_location(const reader& rdr,
2350 reader& c = const_cast<reader&>(rdr);
2366 ///@param rdr the current parsing context
2374 maybe_set_artificial_location(const reader& rdr,
2381 if (read_artificial_location(rdr, node, l))
2952 /// @param rdr the current ABIXML reader.
2958 maybe_set_naming_typedef(reader& rdr,
2967 is_typedef(rdr.build_or_get_type_decl(naming_typedef_id, true));
2978 /// @param rdr the ABIXML reader to use.
2989 build_namespace_decl(reader& rdr,
2997 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
3009 read_location(rdr, node, loc);
3011 const environment& env = rdr.get_environment();
3013 maybe_set_artificial_location(rdr, node, decl);
3014 rdr.push_decl_to_current_scope(decl, add_to_current_scope);
3015 rdr.map_xml_node_to_decl(node, decl);
3020 handle_element_node(rdr, n, /*add_to_current_scope=*/true);
3022 rdr.pop_scope_or_abort(decl);
3030 /// @param rdr the context used for reading the XML input.
3039 build_elf_symbol(reader& rdr, const xmlNodePtr node,
3103 const bool is_suppressed = suppr::is_elf_symbol_suppressed(rdr, name, type);
3107 const environment& env = rdr.get_environment();
3133 /// @param rdr the current context to consider.
3142 build_elf_symbol_from_reference(reader& rdr, const xmlNodePtr node)
3162 rdr.corpus()->get_symtab()->lookup_symbol(name);
3176 /// @param rdr the context to take in account.
3184 build_elf_symbol_db(reader& rdr,
3202 rdr.set_corpus_node(node);
3212 if ((sym = build_elf_symbol(rdr, n, /*drop_if_suppress=*/false)))
3262 /// @param rdr the contexte of the xml parsing.
3266 build_function_parameter(reader& rdr, const xmlNodePtr node)
3291 type = rdr.get_environment().get_variadic_parameter_type();
3295 type = rdr.build_or_get_type_decl(type_id, true);
3304 read_location(rdr, node, loc);
3315 /// @param rdr the context of the parsing.
3332 build_function_decl(reader& rdr,
3361 size_t size = rdr.get_translation_unit()->get_address_size(), align = 0;
3365 read_location(rdr, node, loc);
3367 const environment& env = rdr.get_environment();
3379 build_function_parameter(rdr, n))
3389 return_type = rdr.build_or_get_type_decl(type_id, true);
3413 maybe_set_artificial_location(rdr, node, fn_decl);
3414 rdr.push_decl_to_current_scope(fn_decl, add_to_current_scope);
3415 RECORD_ARTIFACTS_AS_USED_IN_FN_DECL(rdr, fn_decl);
3417 elf_symbol_sptr sym = build_elf_symbol_from_reference(rdr, node);
3424 rdr.get_translation_unit()->bind_function_type_life_time(fn_type);
3426 rdr.maybe_canonicalize_type(fn_type, !add_to_current_scope);
3428 rdr.maybe_add_fn_to_exported_decls(fn_decl.get());
3437 /// @param rdr the context of the parsing.
3455 build_function_decl_if_not_suppressed(reader& rdr,
3462 if (function_is_suppressed(rdr, node))
3468 fn = build_function_decl(rdr, node, as_method_decl,
3477 /// @param rdr the native xml reading context of interest.
3485 function_is_suppressed(const reader& rdr, xmlNodePtr node)
3495 scope_decl* scope = rdr.get_cur_scope();
3499 return suppr::is_function_suppressed(rdr, qualified_name, flinkage_name);
3506 /// @param rdr the ABIXML reader to consider.
3514 type_is_suppressed(const reader& rdr, xmlNodePtr node)
3521 read_location(rdr, node, type_location);
3523 scope_decl* scope = rdr.get_cur_scope();
3528 return suppr::is_type_suppressed(rdr, qualified_name, type_location,
3537 /// @param rdr the ABIXML reader to use.
3546 build_var_decl_if_not_suppressed(reader& rdr,
3551 if (!variable_is_suppressed(rdr, node))
3552 var = build_var_decl(rdr, node, add_to_current_scope);
3559 /// @param rdr the ABIXML reader to consider.
3565 variable_is_suppressed(const reader& rdr, xmlNodePtr node)
3575 scope_decl* scope = rdr.get_cur_scope();
3579 return suppr::is_variable_suppressed(rdr, qualified_name, linkage_name);
3585 /// @parm rdr the ABIXML reader to consider.
3593 variable_is_suppressed(const reader& rdr,
3598 return suppr::is_variable_suppressed(rdr, qualified_name,
3604 /// @param rdr the context of the parsing.
3611 build_var_decl(reader& rdr,
3627 type_base_sptr underlying_type = rdr.build_or_get_type_decl(type_id,
3642 read_location(rdr, node, locus);
3647 maybe_set_artificial_location(rdr, node, decl);
3649 elf_symbol_sptr sym = build_elf_symbol_from_reference(rdr, node);
3653 rdr.push_decl_to_current_scope(decl, add_to_current_scope);
3658 RECORD_ARTIFACT_AS_USED_BY(rdr, underlying_type, decl);
3669 /// @param rdr the context of the parsing.
3679 build_type_decl(reader& rdr,
3688 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
3716 read_location(rdr, node, loc);
3721 if (type_base_sptr d = rdr.get_type_decl(id))
3734 const environment& env = rdr.get_environment();
3737 maybe_set_artificial_location(rdr, node, decl);
3740 if (rdr.push_and_key_type_decl(decl, id, add_to_current_scope))
3742 rdr.map_xml_node_to_decl(node, decl);
3751 /// @param rdr the context of the parsing.
3761 build_qualified_type_decl(reader& rdr,
3769 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
3784 read_location(rdr, node, loc);
3815 rdr.build_or_get_type_decl(type_id, true);
3819 if (type_base_sptr t = rdr.get_type_decl(id))
3827 maybe_set_artificial_location(rdr, node, decl);
3828 rdr.push_and_key_type_decl(decl, id, add_to_current_scope);
3829 RECORD_ARTIFACT_AS_USED_BY(rdr, underlying_type, decl);
3832 rdr.map_xml_node_to_decl(node, decl);
3839 /// @param rdr the context of the parsing.
3849 build_pointer_type_def(reader& rdr,
3859 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
3872 if (type_base_sptr t = rdr.get_type_decl(id))
3883 size_t size_in_bits = rdr.get_translation_unit()->get_address_size();
3887 read_location(rdr, node, loc);
3890 // creation, the type is 'keyed' using rdr.push_and_key_type_decl.
3894 pointer_type_def_sptr t(new pointer_type_def(rdr.get_environment(),
3898 maybe_set_artificial_location(rdr, node, t);
3900 if (rdr.push_and_key_type_decl(t, id, add_to_current_scope))
3901 rdr.map_xml_node_to_decl(node, t);
3904 rdr.build_or_get_type_decl(type_id, true);
3908 RECORD_ARTIFACT_AS_USED_BY(rdr, pointed_to_type, t);
3915 /// @param rdr the context of the parsing.
3925 build_reference_type_def(reader& rdr,
3934 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
3947 if (type_base_sptr d = rdr.get_type_decl(id))
3955 read_location(rdr, node, loc);
3961 size_t size_in_bits = rdr.get_translation_unit()->get_address_size();
3972 // rdr.push_and_key_type_decl. This means that the type can be
3976 reference_type_def_sptr t(new reference_type_def(rdr.get_environment(),
3979 maybe_set_artificial_location(rdr, node, t);
3980 if (rdr.push_and_key_type_decl(t, id, add_to_current_scope))
3981 rdr.map_xml_node_to_decl(node, t);
3984 rdr.build_or_get_type_decl(type_id,/*add_to_current_scope=*/ true);
3987 RECORD_ARTIFACT_AS_USED_BY(rdr, pointed_to_type, t);
3995 /// @param rdr the context of the parsing.
4005 build_function_type(reader& rdr,
4025 size_t size = rdr.get_translation_unit()->get_address_size(), align = 0;
4028 const environment& env = rdr.get_environment();
4036 is_class_or_union_type(rdr.build_or_get_type_decl(method_class_id,
4048 rdr.get_translation_unit()->bind_function_type_life_time(fn_type);
4049 rdr.key_type_decl(fn_type, id);
4050 RECORD_ARTIFACTS_AS_USED_IN_FN_TYPE(rdr, fn_type);
4059 build_function_parameter(rdr, n))
4069 fn_type->set_return_type(rdr.build_or_get_type_decl
4081 /// @param rdr the context of the parsing.
4090 build_subrange_type(reader& rdr,
4098 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4115 if (type_base_sptr d = rdr.get_type_decl(id))
4157 underlying_type = rdr.build_or_get_type_decl(underlying_type_id, true);
4162 read_location(rdr, node, loc);
4184 (new array_type_def::subrange_type(rdr.get_environment(),
4187 maybe_set_artificial_location(rdr, node, p);
4195 /// @param rdr the context of the parsing.
4205 build_array_type_def(reader& rdr,
4215 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4228 if (type_base_sptr d = rdr.get_type_decl(id))
4245 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4278 read_location(rdr, node, loc);
4287 build_subrange_type(rdr, n))
4292 add_decl_to_scope(s, rdr.get_cur_scope());
4293 rdr.maybe_canonicalize_type(s);
4301 rdr.build_or_get_type_decl(type_id, true);
4305 maybe_set_artificial_location(rdr, node, ar_type);
4306 if (rdr.push_and_key_type_decl(ar_type, id, add_to_current_scope))
4307 rdr.map_xml_node_to_decl(node, ar_type);
4308 RECORD_ARTIFACT_AS_USED_BY(rdr, type, ar_type);
4357 /// @param rdr the reader to take into account.
4368 build_enum_type_decl_if_not_suppressed(reader& rdr,
4373 if (!type_is_suppressed(rdr, node))
4374 enum_type = build_enum_type_decl(rdr, node, add_to_current_scope);
4380 /// @param rdr the context of the parsing.
4390 build_enum_type_decl(reader& rdr,
4399 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4416 read_location(rdr, node, loc);
4472 rdr.build_or_get_type_decl(base_type_id, true);
4478 maybe_set_artificial_location(rdr, node, t);
4482 if (rdr.push_and_key_type_decl(t, id, add_to_current_scope))
4484 maybe_set_naming_typedef(rdr, node, t);
4485 rdr.map_xml_node_to_decl(node, t);
4486 RECORD_ARTIFACT_AS_USED_BY(rdr, underlying_type, t);
4495 /// @param rdr the context of the parsing.
4502 build_typedef_decl(reader& rdr,
4511 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4523 if (type_base_sptr t = rdr.get_type_decl(id))
4535 read_location(rdr, node, loc);
4542 type_base_sptr underlying_type(rdr.build_or_get_type_decl(type_id, true));
4546 maybe_set_artificial_location(rdr, node, t);
4547 rdr.push_and_key_type_decl(t, id, add_to_current_scope);
4548 rdr.map_xml_node_to_decl(node, t);
4549 RECORD_ARTIFACT_AS_USED_BY(rdr, underlying_type, t);
4557 /// @param rdr the ABIXML reader to consider.
4566 build_class_decl_if_not_suppressed(reader& rdr,
4571 if (!type_is_suppressed(rdr, node))
4572 class_type = build_class_decl(rdr, node, add_to_current_scope);
4580 /// @param rdr the ABIXML reader to consider.
4589 build_union_decl_if_not_suppressed(reader& rdr,
4594 if (!type_is_suppressed(rdr, node))
4595 union_type = build_union_decl(rdr, node, add_to_current_scope);
4601 /// @param rdr the context of the parsing.
4612 build_class_decl(reader& rdr,
4621 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4646 read_location(rdr, node, loc);
4668 if (type_base_sptr t = rdr.get_type_decl(id))
4676 types_ptr = rdr.get_all_type_decls(id);
4708 const environment& env = rdr.get_environment();
4734 maybe_set_artificial_location(rdr, node, decl);
4744 decl_base_sptr d = is_decl(rdr.get_type_decl(def_id));
4789 rdr.push_decl_to_current_scope(decl, add_to_current_scope);
4791 rdr.map_xml_node_to_decl(node, decl);
4792 rdr.key_type_decl(decl, id);
4795 maybe_set_naming_typedef(rdr, node, decl);
4814 (rdr.build_or_get_type_decl(type_id, true));
4845 rdr.map_xml_node_to_decl(n, decl);
4852 build_type(rdr, p, /*add_to_current_scope=*/true))
4857 rdr.maybe_canonicalize_type(t, !add_to_current_scope);
4861 rdr.key_type_decl(t, id);
4862 rdr.map_xml_node_to_decl(p, td);
4868 rdr.map_xml_node_to_decl(n, decl);
4889 build_var_decl(rdr, p, /*add_to_cur_scope=*/false))
4899 decl_base_sptr d = rdr.pop_decl();
4904 if (!variable_is_suppressed(rdr, decl.get(), *v))
4911 rdr.maybe_add_var_to_exported_decls(v.get());
4921 RECORD_ARTIFACT_AS_USED_BY(rdr, v->get_type(), decl);
4924 RECORD_ARTIFACT_AS_USED_BY(rdr, v->get_type(), v);
4925 RECORD_ARTIFACT_AS_USED_BY(rdr, v, decl);
4933 rdr.map_xml_node_to_decl(n, decl);
4961 build_function_decl_if_not_suppressed(rdr, p, decl,
4980 rdr.map_xml_node_to_decl(n, decl);
4999 build_function_tdecl(rdr, p,
5009 build_class_tdecl(rdr, p,
5022 rdr.pop_scope_or_abort(decl);
5029 /// @param rdr the context of the parsing.
5040 build_union_decl(reader& rdr,
5049 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
5074 read_location(rdr, node, loc);
5092 types_ptr = rdr.get_all_type_decls(id);
5124 const environment& env = rdr.get_environment();
5146 maybe_set_artificial_location(rdr, node, decl);
5157 dynamic_pointer_cast<class_decl>(rdr.get_type_decl(def_id));
5202 rdr.push_decl_to_current_scope(decl, add_to_current_scope);
5204 rdr.map_xml_node_to_decl(node, decl);
5205 rdr.key_type_decl(decl, id);
5207 maybe_set_naming_typedef(rdr, node, decl);
5218 rdr.map_xml_node_to_decl(n, decl);
5225 build_type(rdr, p, /*add_to_current_scope=*/true))
5230 rdr.maybe_canonicalize_type(t, !add_to_current_scope);
5234 rdr.key_type_decl(t, id);
5235 rdr.map_xml_node_to_decl(p, td);
5241 rdr.map_xml_node_to_decl(n, decl);
5256 build_var_decl(rdr, p, /*add_to_cur_scope=*/false))
5266 decl_base_sptr d = rdr.pop_decl();
5271 || !variable_is_suppressed(rdr, decl.get(), *v))
5286 RECORD_ARTIFACT_AS_USED_BY(rdr, v->get_type(), decl);
5289 RECORD_ARTIFACT_AS_USED_BY(rdr, v->get_type(), v);
5290 RECORD_ARTIFACT_AS_USED_BY(rdr, v, decl);
5298 rdr.map_xml_node_to_decl(n, decl);
5314 build_function_decl_if_not_suppressed(rdr, p, decl,
5330 rdr.map_xml_node_to_decl(n, decl);
5346 build_function_tdecl(rdr, p,
5356 build_class_tdecl(rdr, p,
5369 rdr.pop_scope_or_abort(decl);
5377 /// @param rdr the context of the parsing.
5387 build_function_tdecl(reader& rdr,
5399 if (id.empty() || rdr.get_fn_tmpl_decl(id))
5403 read_location(rdr, node, loc);
5411 const environment& env = rdr.get_environment();
5414 maybe_set_artificial_location(rdr, node, fn_tmpl_decl);
5416 rdr.push_decl_to_current_scope(fn_tmpl_decl, add_to_current_scope);
5424 build_template_parameter(rdr, n, parm_index, fn_tmpl_decl))
5430 build_function_decl_if_not_suppressed(rdr, n, class_decl_sptr(),
5435 rdr.key_fn_tmpl_decl(fn_tmpl_decl, id);
5443 /// @param rdr the context of the parsing.
5453 build_class_tdecl(reader& rdr,
5465 if (id.empty() || rdr.get_class_tmpl_decl(id))
5469 read_location(rdr, node, loc);
5474 const environment& env = rdr.get_environment();
5477 maybe_set_artificial_location(rdr, node, class_tmpl);
5479 rdr.push_decl_to_current_scope(class_tmpl, add_to_current_scope);
5487 build_template_parameter(rdr, n, parm_index, class_tmpl))
5493 build_class_decl_if_not_suppressed(rdr, n,
5497 rdr.maybe_canonicalize_type(c, /*force_delay=*/false);
5502 rdr.key_class_tmpl_decl(class_tmpl, id);
5510 /// @param rdr the context of the parsing.
5523 build_type_tparameter(reader& rdr,
5537 ABG_ASSERT(!rdr.get_type_decl(id));
5544 (rdr.build_or_get_type_decl(type_id, true))))
5552 read_location(rdr, node,loc);
5555 maybe_set_artificial_location(rdr, node, result);
5558 rdr.push_decl_to_current_scope(dynamic_pointer_cast<decl_base>(result),
5561 rdr.push_and_key_type_decl(result, id, /*add_to_current_scope=*/true);
5563 rdr.maybe_canonicalize_type(result, /*force_delay=*/false);
5571 /// @param rdr the context of the parsing.
5583 build_type_composition(reader& rdr,
5595 rdr.push_decl_to_current_scope(dynamic_pointer_cast<decl_base>(result),
5603 build_pointer_type_def(rdr, n,
5606 build_reference_type_def(rdr, n,
5609 build_array_type_def(rdr, n,
5612 build_qualified_type_decl(rdr, n,
5615 rdr.maybe_canonicalize_type(composed_type,
5628 /// @param rdr the context of the parsing.
5641 build_non_type_tparameter(reader& rdr,
5656 || !(type = rdr.build_or_get_type_decl(type_id, true)))
5664 read_location(rdr, node,loc);
5667 maybe_set_artificial_location(rdr, node, r);
5668 rdr.push_decl_to_current_scope(dynamic_pointer_cast<decl_base>(r),
5677 /// @param rdr the context of the parsing.
5689 build_template_tparameter(reader& rdr,
5711 (rdr.build_or_get_type_decl(type_id, true))))
5719 read_location(rdr, node, loc);
5723 maybe_set_artificial_location(rdr, node, result);
5724 rdr.push_decl_to_current_scope(result, /*add_to_current_scope=*/true);
5732 build_template_parameter(rdr, n, parm_index, result))
5740 rdr.key_type_decl(result, id);
5741 rdr.maybe_canonicalize_type(result, /*force_delay=*/false);
5750 /// @param rdr the context of the parsing.
5763 build_template_parameter(reader& rdr,
5769 ((r = build_type_tparameter(rdr, node, index, tdecl))
5770 || (r = build_non_type_tparameter(rdr, node, index, tdecl))
5771 || (r = build_template_tparameter(rdr, node, index, tdecl))
5772 || (r = build_type_composition(rdr, node, index, tdecl)));
5779 /// @param rdr the context of the parsing.
5786 build_type(reader& rdr,
5792 ((t = build_type_decl(rdr, node, add_to_current_scope))
5793 || (t = build_qualified_type_decl(rdr, node, add_to_current_scope))
5794 || (t = build_pointer_type_def(rdr, node, add_to_current_scope))
5795 || (t = build_reference_type_def(rdr, node , add_to_current_scope))
5796 || (t = build_function_type(rdr, node, add_to_current_scope))
5797 || (t = build_array_type_def(rdr, node, add_to_current_scope))
5798 || (t = build_enum_type_decl_if_not_suppressed(rdr, node,
5800 || (t = build_typedef_decl(rdr, node, add_to_current_scope))
5801 || (t = build_class_decl_if_not_suppressed(rdr, node,
5803 || (t = build_union_decl_if_not_suppressed(rdr, node,
5806 if (rdr.tracking_non_reachable_types() && t)
5808 corpus_sptr abi = rdr.corpus();
5819 rdr.maybe_canonicalize_type(t,/*force_delay=*/false );
5825 /// @param rdr the parsing context.
5829 handle_type_decl(reader& rdr,
5833 type_decl_sptr decl = build_type_decl(rdr, node, add_to_current_scope);
5836 rdr.maybe_canonicalize_type(decl, /*force_delay=*/false);
5842 /// @param rdr the parsing context.
5846 handle_namespace_decl(reader& rdr,
5850 namespace_decl_sptr d = build_namespace_decl(rdr, node,
5857 /// @param rdr the parsing context.
5861 handle_qualified_type_decl(reader& rdr,
5866 build_qualified_type_decl(rdr, node,
5870 rdr.maybe_canonicalize_type(decl, /*force_delay=*/false);
5876 /// @param rdr the context of the parsing.
5880 handle_pointer_type_def(reader& rdr,
5884 pointer_type_def_sptr decl = build_pointer_type_def(rdr, node,
5888 rdr.maybe_canonicalize_type(decl, /*force_delay=*/false);
5894 /// @param rdr the context of the parsing.
5898 handle_reference_type_def(reader& rdr,
5902 reference_type_def_sptr decl = build_reference_type_def(rdr, node,
5906 rdr.maybe_canonicalize_type(decl, /*force_delay=*/false);
5912 /// @param rdr the context of the parsing.
5916 handle_function_type(reader& rdr,
5920 function_type_sptr type = build_function_type(rdr, node,
5923 rdr.maybe_canonicalize_type(type, /*force_delay=*/true);
5929 /// @param rdr the context of the parsing.
5933 handle_array_type_def(reader& rdr,
5937 array_type_def_sptr decl = build_array_type_def(rdr, node,
5940 rdr.maybe_canonicalize_type(decl, /*force_delay=*/false);
5946 /// @param rdr the context of the parsing.
5948 handle_enum_type_decl(reader& rdr,
5953 build_enum_type_decl_if_not_suppressed(rdr, node,
5957 rdr.maybe_canonicalize_type(decl, /*force_delay=*/false);
5963 /// @param rdr the context of the parsing.
5965 handle_typedef_decl(reader& rdr,
5969 typedef_decl_sptr decl = build_typedef_decl(rdr, node,
5973 rdr.maybe_canonicalize_type(decl, /*force_delay=*/false);
5979 /// @param rdr the context of the parsing.
5986 handle_var_decl(reader& rdr,
5990 decl_base_sptr decl = build_var_decl_if_not_suppressed(rdr, node,
5992 rdr.maybe_add_var_to_exported_decls(is_var_decl(decl).get());
5998 /// @param rdr the context of the parsing
6003 handle_function_decl(reader& rdr,
6007 return build_function_decl_if_not_suppressed(rdr, node, class_decl_sptr(),
6013 /// @param rdr the context of the parsing.
6018 handle_class_decl(reader& rdr,
6023 build_class_decl_if_not_suppressed(rdr, node, add_to_current_scope);
6026 rdr.maybe_canonicalize_type(decl, /*force_delay=*/false);
6032 /// @param rdr the context of the parsing.
6037 handle_union_decl(reader& rdr,
6042 build_union_decl_if_not_suppressed(rdr, node, add_to_current_scope);
6045 rdr.maybe_canonicalize_type(decl, /*force_delay=*/false);
6051 /// @param rdr the parsing context.
6056 handle_function_tdecl(reader& rdr,
6060 function_tdecl_sptr d = build_function_tdecl(rdr, node,
6067 /// @param rdr the context of the parsing.
6071 handle_class_tdecl(reader& rdr,
6075 class_tdecl_sptr decl = build_class_tdecl(rdr, node,
6166 fe_iface_sptr rdr = create_reader(in, env);
6168 return rdr->read_corpus(sts);
6188 fe_iface_sptr rdr = create_reader(path, env);
6190 corpus_sptr corp = rdr->read_corpus(sts);
6208 /// @param rdr the ABIXML reader to use.
6217 xml_reader::reader& rdr = dynamic_cast<xml_reader::reader&>(iface)
6276 rdr.get_environment()->get_type_id_canonical_type_map()[id] = v;