Lines Matching refs:node
88 walk_xml_node_to_map_type_ids(reader& rdr, xmlNodePtr node);
237 /// Getter of the current XML node in the corpus element sub-tree
240 /// @return the current XML node in the corpus element sub-tree that
246 /// Setter of the current XML node in the corpus element sub-tree
249 /// @param node set the current XML node in the corpus element
252 set_corpus_node(xmlNodePtr node)
253 {m_corp_node = node;}
276 map_xml_node_to_decl(xmlNodePtr node,
279 if (node)
280 get_xml_node_decl_map()[node]= decl;
284 get_decl_for_xml_node(xmlNodePtr node) const
287 get_xml_node_decl_map().find(node);
301 xmlNodePtr node)
303 if (!node)
310 read_is_declaration_only(node, is_declaration);
312 i->second = node;
315 get_id_xml_node_map()[id] = node;
328 get_scope_for_node(xmlNodePtr node,
1089 xmlNodePtr node = get_corpus_node();
1090 if (!node)
1092 // The document must start with the abi-corpus node.
1155 node = xmlTextReaderExpand(xml_reader.get());
1156 if (!node)
1175 xml::xml_char_sptr path_str = XML_NODE_GET_ATTRIBUTE(node, "path");
1180 XML_NODE_GET_ATTRIBUTE(node, "architecture");
1186 XML_NODE_GET_ATTRIBUTE(node, "soname");
1191 // If the corpus element node has children nodes, make
1192 // get_corpus_node() returns the first child element node of
1194 if (node->children)
1196 xmlNodePtr n = xmlFirstElementChild(node);
1202 walk_xml_node_to_map_type_ids(*this, node);
1228 read_tracking_non_reachable_types(node, is_tracking_non_reachable_types);
1245 // The call above invalidates the xml node returned by
1252 node = get_corpus_node();
1253 node = xmlNextElementSibling(node);
1254 if (!node)
1256 node = get_corpus_node();
1257 if (node)
1258 node = xmlNextElementSibling(node->parent);
1260 set_corpus_node(node);
1330 xmlNodePtr node);
1340 xmlNodePtr node);
1444 /// Get the IR node representing the scope for a given XML node.
1448 /// @param node the XML for which to return the scope decl. If its
1449 /// parent XML node has no corresponding IR node, that IR node is constructed.
1451 /// @param access the access specifier of the node in its scope, if
1452 /// applicable. If the node doesn't have any access specifier
1455 /// @return the IR node representing the scope of the IR node for the
1456 /// XML node given in argument.
1458 reader::get_scope_for_node(xmlNodePtr node,
1462 if (!node)
1465 xmlNodePtr parent = node->parent;
1502 /// Get the type declaration IR node that matches a given XML type node ID.
1504 /// If no IR node has been built for this ID, this function builds the
1505 /// type declaration IR node and returns it. Subsequent invocation of
1508 /// @param id the XML node ID to consider.
1530 /// already been done. So after that, the IR node for 'n'
1532 /// that case. Otherwise, we'll just build the IR node for
1559 /// Moves the xmlTextReader cursor to the next xml node in the input
1574 /// is the xml node containing the 'id' attribute.
1578 /// @param node the XML sub-tree node to walk. It must be an element
1579 /// node.
1582 xmlNodePtr node)
1584 xmlNodePtr n = node;
1600 read_translation_unit(fe_iface& iface, translation_unit& tu, xmlNodePtr node)
1608 XML_NODE_GET_ATTRIBUTE(node, "address-size");
1615 xml::xml_char_sptr path_str = XML_NODE_GET_ATTRIBUTE(node, "path");
1620 XML_NODE_GET_ATTRIBUTE(node, "comp-dir-path");
1625 xml::xml_char_sptr language_str = XML_NODE_GET_ATTRIBUTE(node, "language");
1634 rdr.map_xml_node_to_decl(node, tu.get_global_scope());
1638 walk_xml_node_to_map_type_ids(rdr, node);
1640 for (xmlNodePtr n = xmlFirstElementChild(node);
1656 /// Read a given xml node representing a tranlsation unit.
1659 /// path of the xml node we need to look at, then return that
1666 /// @param node the XML node to consider.
1670 get_or_read_and_add_translation_unit(reader& rdr, xmlNodePtr node)
1676 xml::xml_char_sptr path_str = XML_NODE_GET_ATTRIBUTE(node, "path");
1694 if (read_translation_unit(rdr, *tu, node))
1701 /// represented by an 'abi-instr' element node, associated to the current
1715 xmlNodePtr node = rdr.get_corpus_node();
1716 if (!node)
1722 // The document must start with the abi-instr node.
1732 node = xmlTextReaderExpand(reader.get());
1733 if (!node)
1738 node = 0;
1745 node = n;
1750 if (node == 0)
1753 tu = get_or_read_and_add_translation_unit(rdr, node);
1757 // We are not in the mode where the current corpus node came
1759 // rdr.get_corpus_node to the next child element node of the
1761 node = xmlNextElementSibling(node);
1762 rdr.set_corpus_node(node);
1815 xmlNodePtr node = xmlTextReaderExpand(reader.get());
1816 if (!node)
1820 fn_symdb = build_elf_symbol_db(rdr, node, true);
1822 var_symdb = build_elf_symbol_db(rdr, node, false);
1851 /// From an "elf-needed" XML_ELEMENT node, build a vector of strings
1855 /// @param node the XML_ELEMENT node of name "elf-needed".
1858 /// vector of dependency names found on the xml node @p node.
1862 build_needed(xmlNode* node, vector<string>& needed)
1864 if (!node || !xmlStrEqual(node->name,BAD_CAST("elf-needed")))
1867 for (xmlNodePtr n = xmlFirstElementChild(node);
1885 /// Move to the next xml element node and expext it to be named
1886 /// "elf-needed". Then read the sub-tree to made of that node and
1902 xmlNodePtr node = 0;
1918 node = xmlTextReaderExpand(reader.get());
1919 if (!node)
1930 node = n;
1936 if (node)
1938 result = build_needed(node, needed);
1939 node = xmlNextElementSibling(node);
1940 rdr.set_corpus_node(node);
2064 /// represented by an 'abi-corpus-group' element node, associated to
2080 // The document must start with the abi-corpus-group node.
2106 xmlNodePtr node = xmlTextReaderExpand(reader.get());
2107 if (!node)
2110 node = xmlFirstElementChild(node);
2111 rdr.set_corpus_node(node);
2124 /// root node is 'abi-corpus-group'.
2144 /// root node is 'abi-corpus-group'.
2228 /// It handles the current xml element node of the reading context.
2230 /// xml node and tied it to the current translation unit.
2236 handle_element_node(reader& rdr, xmlNodePtr node,
2240 if (!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,
2279 read_is_non_reachable_type(node, is_non_reachable_type);
2297 xmlNodePtr node,
2303 if (xml_char_sptr f = xml::build_sptr(xmlGetProp(node, BAD_CAST("filepath"))))
2307 return read_artificial_location(rdr, node, loc);
2309 if (xml_char_sptr l = xml::build_sptr(xmlGetProp(node, BAD_CAST("line"))))
2312 return read_artificial_location(rdr, node, loc);
2314 if (xml_char_sptr c = xml::build_sptr(xmlGetProp(node, BAD_CAST("column"))))
2327 /// as the URI of the node.
2336 xmlNodePtr node,
2339 if (!node)
2345 line = node->line;
2347 if (node->doc)
2348 file_path = reinterpret_cast<const char*>(node->doc->URL);
2361 /// as the URI of the node.
2368 ///@param node the XML node to consider.
2375 xmlNodePtr node,
2381 if (read_artificial_location(rdr, node, l))
2392 /// @param node the xml node to read from.
2398 read_visibility(xmlNodePtr node, decl_base::visibility& vis)
2400 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "visibility"))
2421 /// @param node the xml node to build parse the bind from.
2427 read_binding(xmlNodePtr node, decl_base::binding& bind)
2429 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "binding"))
2447 /// Read the 'access' attribute on the current xml node.
2449 /// @param node the xml node to consider.
2455 read_access(xmlNodePtr node, access_specifier& access)
2457 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "access"))
2480 /// @param node the xml element node to consider.
2484 /// the attribute was present on the xml element node.
2489 /// element node.
2494 read_size_and_alignment(xmlNodePtr node,
2500 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "size-in-bits"))
2506 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "alignment-in-bits"))
2514 /// Parse the 'static' attribute of a given xml element node.
2516 /// @param node the xml element node to consider.
2521 /// @return true if the xml element node has the 'static' attribute
2524 read_static(xmlNodePtr node, bool& is_static)
2526 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "static"))
2535 /// Parse the 'layout-offset-in-bits' attribute of a given xml element node.
2537 /// @param offset_in_bits set to true if the element node contains the
2540 /// @return true iff the xml element node contains the attribute.
2542 read_offset_in_bits(xmlNodePtr node,
2545 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "layout-offset-in-bits"))
2554 /// given xml node.
2557 /// 'constructor' attribute. Is set if the xml node contains the
2561 /// 'destructor' attribute. Is set if the xml node contains the
2565 /// attribute. Is set if the xml node contains the attribute and if
2575 read_cdtor_const(xmlNodePtr node,
2580 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "constructor"))
2591 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "destructor"))
2602 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "const"))
2616 /// Read the "is-declaration-only" attribute of the current xml node.
2618 /// @param node the xml node to consider.
2625 read_is_declaration_only(xmlNodePtr node, bool& is_decl_only)
2627 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "is-declaration-only"))
2639 /// Read the "is-artificial" attribute of the current XML node.
2641 /// @param node the XML node to consider.
2647 /// XML node.
2649 read_is_artificial(xmlNodePtr node, bool& is_artificial)
2651 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "is-artificial"))
2663 /// @param node the current XML element.
2667 /// present on the current XML node and set to 'yes'. In that case,
2671 /// present on the current XML node and set to 'yes'.
2673 read_tracking_non_reachable_types(xmlNodePtr node,
2677 XML_NODE_GET_ATTRIBUTE(node, "tracking-non-reachable-types"))
2691 /// @param node the current XML element.
2700 read_is_non_reachable_type(xmlNodePtr node, bool& is_non_reachable_type)
2703 XML_NODE_GET_ATTRIBUTE(node, "is-non-reachable"))
2715 /// Read the "naming-typedef-id" property from an XML node.
2717 /// @param node the XML node to consider.
2723 /// read from @p node.
2725 read_naming_typedef_id_string(xmlNodePtr node, string& naming_typedef_id)
2727 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "naming-typedef-id"))
2735 /// Read the "is-virtual" attribute of the current xml node.
2737 /// @param node the xml node to read the attribute from
2744 read_is_virtual(xmlNodePtr node, bool& is_virtual)
2746 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "is-virtual"))
2760 /// @param node the xml node to read the attribute from.
2767 read_is_struct(xmlNodePtr node, bool& is_struct)
2769 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "is-struct"))
2783 /// @param node the xml node to read the attribute from.
2790 read_is_anonymous(xmlNodePtr node, bool& is_anonymous)
2792 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "is-anonymous"))
2803 /// @param node the XML node to read the attribute from.
2809 read_elf_symbol_type(xmlNodePtr node, elf_symbol::type& t)
2811 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type"))
2824 /// @param node the XML node to read the attribute from.
2830 read_elf_symbol_binding(xmlNodePtr node, elf_symbol::binding& b)
2832 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "binding"))
2846 /// @param node the XML node to read the attribute from.
2852 read_elf_symbol_visibility(xmlNodePtr node, elf_symbol::visibility& v)
2854 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "visibility"))
2866 /// Read the value of the 'id' attribute from a given XML node.
2868 /// @param node the XML node to consider.
2874 read_type_id_string(xmlNodePtr node, string& type_id)
2876 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
2891 /// @param t the type built from the a type XML node that has a
2922 /// @param t the type built from the a type XML node that has a
2930 xmlNodePtr node)
2941 if (!read_type_id_string(node, type_id) || type_id.empty())
2954 /// @param node the XML node to read from.
2959 xmlNodePtr node,
2963 read_naming_typedef_id_string(node, naming_typedef_id);
2973 /// Build a @ref namespace_decl from an XML element node which name is
2980 /// @param node the XML node to consider. It must constain the
2990 const xmlNodePtr node,
2994 if (!node || !xmlStrEqual(node->name, BAD_CAST("namespace-decl")))
2997 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
3005 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
3009 read_location(rdr, node, loc);
3013 maybe_set_artificial_location(rdr, node, decl);
3015 rdr.map_xml_node_to_decl(node, decl);
3017 for (xmlNodePtr n = xmlFirstElementChild(node);
3027 /// Build an instance of @ref elf_symbol from an XML element node
3032 /// @param node the XML node to read.
3039 build_elf_symbol(reader& rdr, const xmlNodePtr node,
3044 if (!node
3045 || node->type != XML_ELEMENT_NODE
3046 || !xmlStrEqual(node->name, BAD_CAST("elf-symbol")))
3050 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
3054 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "size"))
3058 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "is-defined"))
3069 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "is-common"))
3080 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "version"))
3084 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "is-default-version"))
3093 read_elf_symbol_type(node, type);
3096 read_elf_symbol_binding(node, binding);
3099 read_elf_symbol_visibility(node, visibility);
3115 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "crc"))
3118 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "namespace"))
3135 /// @param node the xml element node to consider.
3142 build_elf_symbol_from_reference(reader& rdr, const xmlNodePtr node)
3146 if (!node)
3149 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "elf-symbol-id"))
3178 /// @param node the XML node to consider.
3185 const xmlNodePtr node,
3191 if (!node)
3195 && !xmlStrEqual(node->name, BAD_CAST("elf-function-symbols")))
3199 && !xmlStrEqual(node->name, BAD_CAST("elf-variable-symbols")))
3202 rdr.set_corpus_node(node);
3209 for (xmlNodePtr n = xmlFirstElementChild(node);
3260 /// Build a function parameter from a 'parameter' xml element node.
3264 /// @param node the xml 'parameter' element node to de-serialize from.
3266 build_function_parameter(reader& rdr, const xmlNodePtr node)
3270 if (!node || !xmlStrEqual(node->name, BAD_CAST("parameter")))
3276 xml::build_sptr(xmlGetProp(node, BAD_CAST("is-variadic"))))
3283 read_is_artificial(node, is_artificial);
3286 if (xml_char_sptr a = xml::build_sptr(xmlGetProp(node, BAD_CAST("type-id"))))
3300 if (xml_char_sptr a = xml::build_sptr(xmlGetProp(node, BAD_CAST("name"))))
3304 read_location(rdr, node, loc);
3313 /// Build a function_decl from a 'function-decl' xml node.
3317 /// @param node the xml node to build the function_decl from.
3320 /// means that the 'function-decl' xml node should be parsed as a
3333 const xmlNodePtr node,
3339 if (!xmlStrEqual(node->name, BAD_CAST("function-decl")))
3343 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
3347 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "mangled-name"))
3351 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "declared-inline"))
3356 read_visibility(node, vis);
3359 read_binding(node, bind);
3362 read_size_and_alignment(node, size, align);
3365 read_location(rdr, node, loc);
3372 for (xmlNodePtr n = xmlFirstElementChild(node);
3413 maybe_set_artificial_location(rdr, node, fn_decl);
3417 elf_symbol_sptr sym = build_elf_symbol_from_reference(rdr, node);
3433 /// Build a function_decl from a 'function-decl' xml node if it's not
3439 /// @param node the xml node to build the function_decl from.
3442 /// it means that the 'function-decl' xml node should be parsed as a
3456 const xmlNodePtr node,
3462 if (function_is_suppressed(rdr, node))
3468 fn = build_function_decl(rdr, node, as_method_decl,
3479 /// @param note the XML node that represents the fucntion.
3483 /// function denoted by the node @p node.
3485 function_is_suppressed(const reader& rdr, xmlNodePtr node)
3488 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
3492 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "mangled-name"))
3508 /// @param note the XML node that represents the type.
3510 /// @return true iff the type designated by @p node is suppressed by
3514 type_is_suppressed(const reader& rdr, xmlNodePtr node)
3517 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
3521 read_location(rdr, node, type_location);
3533 /// Build a @ref var_decl out of a an XML node that describes it iff
3534 /// the variable denoted by the XML node is not suppressed by a
3539 /// @param node the XML node for the variable to consider.
3547 const xmlNodePtr node,
3551 if (!variable_is_suppressed(rdr, node))
3552 var = build_var_decl(rdr, node, add_to_current_scope);
3556 /// Test if a variable denoted by its XML node is suppressed by a
3561 /// @param node the XML node of the variable to consider.
3563 /// @return true iff the variable denoted by @p node is suppressed.
3565 variable_is_suppressed(const reader& rdr, xmlNodePtr node)
3568 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
3572 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "mangled-name"))
3606 /// @param node the xml node to build the var_decl from.
3612 const xmlNodePtr node,
3617 if (!xmlStrEqual(node->name, BAD_CAST("var-decl")))
3621 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
3625 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type-id"))
3632 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "mangled-name"))
3636 read_visibility(node, vis);
3639 read_binding(node, bind);
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);
3671 /// @param node the XML node to build the type_decl from.
3680 const xmlNodePtr node,
3685 if (!xmlStrEqual(node->name, BAD_CAST("type-decl")))
3688 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
3696 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
3700 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
3705 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "size-in-bits"))
3709 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "alignment-in-bits"))
3713 read_is_declaration_only(node, is_decl_only);
3716 read_location(rdr, node, loc);
3719 read_is_anonymous(node, is_anonymous);
3737 maybe_set_artificial_location(rdr, node, decl);
3742 rdr.map_xml_node_to_decl(node, decl);
3749 /// Build a qualified_type_def from a 'qualified-type-def' xml node.
3753 /// @param node the xml node to build the qualified_type_def from.
3762 const xmlNodePtr node,
3766 if (!xmlStrEqual(node->name, BAD_CAST("qualified-type-def")))
3769 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
3778 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE (node, "id"))
3784 read_location(rdr, node, loc);
3788 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "const"))
3793 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "volatile"))
3798 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "restrict"))
3810 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type-id"))
3827 maybe_set_artificial_location(rdr, node, decl);
3832 rdr.map_xml_node_to_decl(node, decl);
3837 /// Build a pointer_type_def from a 'pointer-type-def' xml node.
3841 /// @param node the xml node to build the pointer_type_def from.
3850 const xmlNodePtr node,
3856 if (!xmlStrEqual(node->name, BAD_CAST("pointer-type-def")))
3859 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
3868 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
3880 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type-id"))
3885 read_size_and_alignment(node, size_in_bits, alignment_in_bits);
3887 read_location(rdr, node, loc);
3898 maybe_set_artificial_location(rdr, node, t);
3901 rdr.map_xml_node_to_decl(node, t);
3913 /// xml node.
3917 /// @param node the xml node to build the reference_type_def from.
3926 const xmlNodePtr node,
3931 if (!xmlStrEqual(node->name, BAD_CAST("reference-type-def")))
3934 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
3943 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
3955 read_location(rdr, node, loc);
3957 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "kind"))
3963 read_size_and_alignment(node, size_in_bits, alignment_in_bits);
3966 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type-id"))
3979 maybe_set_artificial_location(rdr, node, t);
3981 rdr.map_xml_node_to_decl(node, t);
3993 /// xml node.
3997 /// @param node the xml node to build the function_type from.
4006 const xmlNodePtr node,
4011 if (!xmlStrEqual(node->name, BAD_CAST("function-type")))
4015 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
4020 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "method-class-id"))
4026 read_size_and_alignment(node, size, align);
4052 for (xmlNodePtr n = xmlFirstElementChild(node);
4079 /// Build a array_type_def::subrange_type from a 'subrange' xml node.
4083 /// @param node the xml node to build the
4091 const xmlNodePtr node)
4095 if (!node || !xmlStrEqual(node->name, BAD_CAST("subrange")))
4098 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4111 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
4123 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
4129 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "length"))
4139 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "lower-bound"))
4142 s = XML_NODE_GET_ATTRIBUTE(node, "upper-bound");
4151 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type-id"))
4162 read_location(rdr, node, loc);
4187 maybe_set_artificial_location(rdr, node, p);
4193 /// Build a array_type_def from a 'array-type-def' xml node.
4197 /// @param node the xml node to build the array_type_def from.
4206 const xmlNodePtr node,
4212 if (!xmlStrEqual(node->name, BAD_CAST("array-type-def")))
4215 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4224 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
4236 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "dimensions"))
4240 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type-id"))
4245 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4257 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "size-in-bits"))
4270 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "alignment-in-bits"))
4278 read_location(rdr, node, loc);
4281 for (xmlNodePtr n = xmlFirstElementChild(node);
4305 maybe_set_artificial_location(rdr, node, ar_type);
4307 rdr.map_xml_node_to_decl(node, ar_type);
4353 /// Build an @ref enum_type_decl from the XML node that represents it,
4359 /// @param node the XML node representing the @ref enum_type_decl to
4369 const xmlNodePtr node,
4373 if (!type_is_suppressed(rdr, node))
4374 enum_type = build_enum_type_decl(rdr, node, add_to_current_scope);
4378 /// Build an enum_type_decl from an 'enum-type-decl' xml node.
4382 /// @param node the xml node to build the enum_type_decl from.
4391 const xmlNodePtr node,
4396 if (!xmlStrEqual(node->name, BAD_CAST("enum-decl")))
4399 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4408 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
4412 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "linkage-name"))
4416 read_location(rdr, node, loc);
4419 read_is_declaration_only(node, is_decl_only);
4422 read_is_anonymous(node, is_anonymous);
4425 read_is_artificial(node, is_artificial);
4428 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
4435 for (xmlNodePtr n = xmlFirstElementChild(node);
4478 maybe_set_artificial_location(rdr, node, t);
4484 maybe_set_naming_typedef(rdr, node, t);
4485 rdr.map_xml_node_to_decl(node, t);
4493 /// Build a typedef_decl from a 'typedef-decl' xml node.
4497 /// @param node the xml node to build the typedef_decl from.
4503 const xmlNodePtr node,
4508 if (!xmlStrEqual(node->name, BAD_CAST("typedef-decl")))
4511 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4519 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
4531 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
4535 read_location(rdr, node, loc);
4538 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type-id"))
4546 maybe_set_artificial_location(rdr, node, t);
4548 rdr.map_xml_node_to_decl(node, t);
4554 /// Build a class from its XML node if it is not suppressed by a
4559 /// @param node the XML node to consider.
4567 const xmlNodePtr node,
4571 if (!type_is_suppressed(rdr, node))
4572 class_type = build_class_decl(rdr, node, add_to_current_scope);
4576 /// Build a @ref union_decl from its XML node if it is not suppressed
4582 /// @param node the XML node to consider.
4590 const xmlNodePtr node,
4594 if (!type_is_suppressed(rdr, node))
4595 union_type = build_union_decl(rdr, node, add_to_current_scope);
4599 /// Build a class_decl from a 'class-decl' xml node.
4603 /// @param node the xml node to build the class_decl from.
4605 /// @param add_to_current_scope if yes, the resulting class node
4613 const xmlNodePtr node,
4618 if (!xmlStrEqual(node->name, BAD_CAST("class-decl")))
4621 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
4629 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
4633 read_size_and_alignment(node, size_in_bits, alignment_in_bits);
4636 read_visibility(node, vis);
4639 read_is_artificial(node, is_artificial);
4642 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
4646 read_location(rdr, node, loc);
4656 read_is_declaration_only(node, is_decl_only);
4659 read_is_struct(node, is_struct);
4662 read_is_anonymous(node, is_anonymous);
4734 maybe_set_artificial_location(rdr, node, decl);
4739 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "def-of-decl-id"))
4791 rdr.map_xml_node_to_decl(node, decl);
4795 maybe_set_naming_typedef(rdr, node, decl);
4797 for (xmlNodePtr n = xmlFirstElementChild(node);
5027 /// Build a union_decl from a 'union-decl' xml node.
5031 /// @param node the xml node to build the union_decl from.
5033 /// @param add_to_current_scope if yes, the resulting union node
5041 const xmlNodePtr node,
5046 if (!xmlStrEqual(node->name, BAD_CAST("union-decl")))
5049 if (decl_base_sptr d = rdr.get_decl_for_xml_node(node))
5057 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
5061 read_size_and_alignment(node, size_in_bits, alignment_in_bits);
5064 read_visibility(node, vis);
5067 read_is_artificial(node, is_artificial);
5070 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
5074 read_location(rdr, node, loc);
5083 read_is_declaration_only(node, is_decl_only);
5086 read_is_anonymous(node, is_anonymous);
5146 maybe_set_artificial_location(rdr, node, decl);
5151 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "def-of-decl-id"))
5204 rdr.map_xml_node_to_decl(node, decl);
5207 maybe_set_naming_typedef(rdr, node, decl);
5209 for (xmlNodePtr n = xmlFirstElementChild(node);
5375 /// 'function-template-decl' xml element node.
5379 /// @param node the xml node to parse from.
5388 const xmlNodePtr node,
5393 if (!xmlStrEqual(node->name, BAD_CAST("function-template-decl")))
5397 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
5403 read_location(rdr, node, loc);
5406 read_visibility(node, vis);
5409 read_binding(node, bind);
5414 maybe_set_artificial_location(rdr, node, fn_tmpl_decl);
5419 for (xmlNodePtr n = xmlFirstElementChild(node);
5441 /// 'class-template-decl' xml element node.
5445 /// @param node the xml node to parse from.
5454 const xmlNodePtr node,
5459 if (!xmlStrEqual(node->name, BAD_CAST("class-template-decl")))
5463 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
5469 read_location(rdr, node, loc);
5472 read_visibility(node, vis);
5477 maybe_set_artificial_location(rdr, node, class_tmpl);
5482 for (xmlNodePtr n = xmlFirstElementChild(node);
5508 /// xml element node.
5512 /// @param node the xml node to parse from.
5524 const xmlNodePtr node,
5530 if (!xmlStrEqual(node->name, BAD_CAST("template-type-parameter")))
5534 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
5540 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type-id"))
5548 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
5552 read_location(rdr, node,loc);
5555 maybe_set_artificial_location(rdr, node, result);
5569 /// "template-parameter-type-composition" xml element node.
5573 /// @param node the xml node to parse from.
5584 const xmlNodePtr node,
5590 if (!xmlStrEqual(node->name, BAD_CAST("template-parameter-type-composition")))
5598 for (xmlNodePtr n = xmlFirstElementChild(node);
5626 /// 'template-non-type-parameter' xml element node.
5630 /// @param node the xml node to parse from.
5642 const xmlNodePtr node,
5648 if (!xmlStrEqual(node->name, BAD_CAST("template-non-type-parameter")))
5652 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type-id"))
5660 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
5664 read_location(rdr, node,loc);
5667 maybe_set_artificial_location(rdr, node, r);
5675 /// 'template-template-parameter' xml element node.
5679 /// @param node the xml node to parse from.
5690 const xmlNodePtr node,
5696 if (!xmlStrEqual(node->name, BAD_CAST("template-template-parameter")))
5700 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
5706 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type-id"))
5715 if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "name"))
5719 read_location(rdr, node, loc);
5723 maybe_set_artificial_location(rdr, node, result);
5728 for (xmlNodePtr n = xmlFirstElementChild(node);
5752 /// @param node the xml element node to parse from.
5764 const xmlNodePtr node,
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)));
5777 /// Build a type from an xml node.
5781 /// @param node the xml node to build the type_base from.
5787 const xmlNodePtr node,
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,
5811 read_is_non_reachable_type(node, is_non_reachable_type);
5816 MAYBE_MAP_TYPE_WITH_TYPE_ID(t, node);
5830 xmlNodePtr node,
5833 type_decl_sptr decl = build_type_decl(rdr, node, add_to_current_scope);
5834 MAYBE_MAP_TYPE_WITH_TYPE_ID(decl, node);
5847 xmlNodePtr node,
5850 namespace_decl_sptr d = build_namespace_decl(rdr, node,
5862 xmlNodePtr node,
5866 build_qualified_type_decl(rdr, node,
5868 MAYBE_MAP_TYPE_WITH_TYPE_ID(decl, node);
5881 xmlNodePtr node,
5884 pointer_type_def_sptr decl = build_pointer_type_def(rdr, node,
5886 MAYBE_MAP_TYPE_WITH_TYPE_ID(decl, node);
5899 xmlNodePtr node,
5902 reference_type_def_sptr decl = build_reference_type_def(rdr, node,
5904 MAYBE_MAP_TYPE_WITH_TYPE_ID(decl, node);
5917 xmlNodePtr node,
5920 function_type_sptr type = build_function_type(rdr, node,
5922 MAYBE_MAP_TYPE_WITH_TYPE_ID(type, node);
5934 xmlNodePtr node,
5937 array_type_def_sptr decl = build_array_type_def(rdr, node,
5939 MAYBE_MAP_TYPE_WITH_TYPE_ID(decl, node);
5949 xmlNodePtr node,
5953 build_enum_type_decl_if_not_suppressed(rdr, node,
5955 MAYBE_MAP_TYPE_WITH_TYPE_ID(decl, node);
5966 xmlNodePtr node,
5969 typedef_decl_sptr decl = build_typedef_decl(rdr, node,
5971 MAYBE_MAP_TYPE_WITH_TYPE_ID(decl, node);
5981 /// @param node the node to read & parse from.
5987 xmlNodePtr node,
5990 decl_base_sptr decl = build_var_decl_if_not_suppressed(rdr, node,
6004 xmlNodePtr node,
6007 return build_function_decl_if_not_suppressed(rdr, node, class_decl_sptr(),
6019 xmlNodePtr node,
6023 build_class_decl_if_not_suppressed(rdr, node, add_to_current_scope);
6024 MAYBE_MAP_TYPE_WITH_TYPE_ID(is_type(decl), node);
6038 xmlNodePtr node,
6042 build_union_decl_if_not_suppressed(rdr, node, add_to_current_scope);
6043 MAYBE_MAP_TYPE_WITH_TYPE_ID(is_type(decl), node);
6057 xmlNodePtr node,
6060 function_tdecl_sptr d = build_function_tdecl(rdr, node,
6072 xmlNodePtr node,
6075 class_tdecl_sptr decl = build_class_tdecl(rdr, node,
6151 /// node is 'abi-corpus'.
6172 /// node is 'abi-corpus'.
6223 xmlNodePtr node = xmlDocGetRootElement(doc);
6224 if (!node)
6246 if (xmlStrcmp(node->name, (xmlChar*) "abixml-types-check"))
6249 for (node = xmlFirstElementChild(node);
6250 node;
6251 node = xmlNextElementSibling(node))
6253 if (xmlStrcmp(node->name, (xmlChar*) "type"))
6257 xmlNodePtr data = xmlFirstElementChild(node);