Lines Matching refs:diff
34 ///@par diff nodes
37 /// a graph of @ref instances of @ref diff node. We refer to these
38 /// just as <em>diff nodes</em>. A diff node represents a change
41 /// compared are called the <em>subjects of the diff</em>.
45 ///@par comparing diff nodes
47 /// Comparing two instances of @ref diff nodes amounts to comparing
48 /// the subject of the diff. In other words, two @ref diff nodes are
50 /// diff nodes can have different memory addresses and yet be equal.
52 ///@par diff reporting and context
54 /// A diff node can be serialized to an output stream to express, in
57 /// diff::report() method. That reporting is controlled by several
58 /// parameters that are conceptually part of the context of the diff.
63 /// is boreader than just controlling the reporting of @ref diff
64 /// nodes. Basically, a @ref diff node itself is created following
66 /// diff_context. A diff node is created in a particular diff
73 ///@defgroup CanonicalDiff Canonical diff tree nodes
76 /// @brief How equivalent diff nodes are quickly spotted.
78 /// @par Equivalence of diff nodes.
80 /// Each @ref diff node has a property named <em>Canonical Diff
81 /// Node</em>. If \c D is a diff node, the canonical diff node of @c
82 /// D, noted @c C(D) is a particular diff node that is equal to @c D.
83 /// Thus, a fast way to compare two @ref diff node is to perform a
84 /// pointer comparison of their canonical diff nodes.
86 /// A set of equivalent @ref diff nodes is a set of diff nodes that
90 /// A canonical node is registereded for a given diff node by invoking
95 /// canonical diff objects is the same as the life time of the @ref
377 /// Sort a map ofg string -> @ref diff* into a vector of @ref
556 /// Tests if a given diff node is to represent the changes between two
559 /// @param d the diff node to consider.
564 is_diff_of_global_decls(const diff* d)
609 /// Test if a diff node is about differences between types.
611 /// @param diff the diff node to test.
613 /// @return a pointer to the actual type_diff_base* that @p diff
616 is_type_diff(const diff* diff)
617 {return dynamic_cast<const type_diff_base*>(diff);}
619 /// Test if a diff node is about differences between declarations.
621 /// @param diff the diff node to test.
623 /// @return a pointer to the actual decl_diff_base @p diff extends,
626 is_decl_diff(const diff* diff)
627 {return dynamic_cast<const decl_diff_base*>(diff);}
629 /// Test if a diff node is a @ref class_diff node.
631 /// @param diff the diff node to consider.
633 /// @return a non-nil pointer to a @ref class_diff iff @p diff is a
636 is_class_diff(const diff* diff)
637 {return dynamic_cast<const class_diff*>(diff);}
639 /// Test if a diff node is a @ref enum_diff node.
641 /// @param diff the diff node to consider.
643 /// @return a non-nil pointer to ad @ref enum_diff node iff @p diff is
646 is_enum_diff(const diff *diff)
647 {return dynamic_cast<const enum_diff*>(diff);}
649 /// Test if a diff node is a @ref union_diff node.
651 /// @param diff the diff node to consider.
653 /// @return a non-nil pointer to a @ref union_diff iff @p diff is a
656 is_union_diff(const diff* diff)
657 {return dynamic_cast<const union_diff*>(diff);}
659 /// Test if a diff node is a @ref class_or_union_diff node.
661 /// @param d the diff node to consider.
666 is_class_or_union_diff(const diff* d)
669 /// Test if a diff node is a @ref class_or_union_diff between two
672 /// @param d the diff node to consider.
676 /// diff.
678 is_anonymous_class_or_union_diff(const diff* d)
686 /// Test if a diff node is a @ref typedef_diff node.
688 /// @param diff the diff node to consider.
690 /// @return a non-nil pointer to a @ref typedef_diff iff @p diff is a
693 is_typedef_diff(const diff *diff)
694 {return dynamic_cast<const typedef_diff*>(diff);}
696 /// Test if a diff node is a @ref array_diff node.
698 /// @param diff the diff node to consider.
700 /// @return a non-nil pointer to a @ref array_diff iff @p diff is a
703 is_array_diff(const diff* diff)
704 {return dynamic_cast<const array_diff*>(diff);}
706 /// Test if a diff node is a @ref function_type_diff node.
708 /// @param diff the diff node to consider.
710 /// @return a non-nil pointer to a @ref function_type_diff iff @p diff is a
713 is_function_type_diff(const diff* diff)
714 {return dynamic_cast<const function_type_diff*>(diff);}
716 /// Test if a given diff node carries a function type change with
719 /// @param diff the diff node to consider.
721 /// @return a non-nil pointer to a @ref function_type_diff iff @p diff
724 is_function_type_diff_with_local_changes(const diff* diff)
726 if (const function_type_diff* d = is_function_type_diff(diff))
733 /// Test if a diff node is about differences between variables.
735 /// @param diff the diff node to test.
737 /// @return a pointer to the actual var_diff that @p diff is a type
740 is_var_diff(const diff* diff)
742 const var_diff* d = dynamic_cast<const var_diff*>(diff);
744 ABG_ASSERT(is_decl_diff(diff));
748 /// Test if a diff node is about differences between functions.
750 /// @param diff the diff node to test.
752 /// @return a pointer to the actual var_diff that @p diff is a type
755 is_function_decl_diff(const diff* diff)
757 const function_decl_diff *d = dynamic_cast<const function_decl_diff*>(diff);
759 ABG_ASSERT(is_decl_diff(diff));
763 /// Test if a diff node is about differences between two pointers.
765 /// @param diff the diff node to consider.
767 /// @return the @p diff converted into an instance of @ref
768 /// pointer_diff iff @p diff is about differences between two
771 is_pointer_diff(const diff* diff)
772 {return dynamic_cast<const pointer_diff*>(diff);}
774 /// Test if a diff node is about differences between two references.
776 /// @param diff the diff node to consider.
778 /// @return the @p diff converted into an instance of @ref
779 /// reference_diff iff @p diff is about differences between two
782 is_reference_diff(const diff* diff)
783 {return dynamic_cast<const reference_diff*>(diff);}
785 /// Test if a diff node is about differences between two qualified
788 /// @param diff the diff node to consider.
790 /// @return @p diff converted into an instance of @ref
791 /// qualified_type_diff iff @p diff is about differences between two
794 is_qualified_type_diff(const diff* diff)
795 {return dynamic_cast<const qualified_type_diff*>(diff);}
797 /// Test if a diff node is a reference or pointer diff node to a
803 /// @param diff the diff node to consider.
805 /// @return true iff @p diff is a eference or pointer diff node to a
808 is_reference_or_ptr_diff_to_non_basic_nor_distinct_types(const diff* diff)
810 diff = peel_typedef_diff(diff);
811 if (const reference_diff* d = is_reference_diff(diff))
813 diff = peel_reference_diff(d);
814 if (is_diff_of_basic_type(diff) || is_distinct_diff(diff))
818 else if (const pointer_diff *d = is_pointer_diff(diff))
820 diff = peel_pointer_diff(d);
821 if (is_diff_of_basic_type(diff) || is_distinct_diff(diff))
829 /// Test if a diff node is about differences between two function
832 /// @param diff the diff node to consider.
834 /// @return the @p diff converted into an instance of @ref
835 /// reference_diff iff @p diff is about differences between two
838 is_fn_parm_diff(const diff* diff)
839 {return dynamic_cast<const fn_parm_diff*>(diff);}
841 /// Test if a diff node is about differences between two base class
844 /// @param diff the diff node to consider.
846 /// @return the @p diff converted into an instance of @ref base_diff
847 /// iff @p diff is about differences between two base class
850 is_base_diff(const diff* diff)
851 {return dynamic_cast<const base_diff*>(diff);}
853 /// Test if a diff node is about differences between two diff nodes of
856 /// @param diff the diff node to consider.
858 /// @return the @p diff converted into an instance of @ref
859 /// distintc_diff iff @p diff is about differences between two diff
862 is_distinct_diff(const diff *diff)
863 {return dynamic_cast<const distinct_diff*>(diff);}
865 /// Test if a diff node is a @ref corpus_diff node.
867 /// @param diff the diff node to consider.
869 /// @return a non-nil pointer to a @ref corpus_diff iff @p diff is a
872 is_corpus_diff(const diff* diff)
873 {return dynamic_cast<const corpus_diff*>(diff);}
875 /// Test if a diff node is a child node of a function parameter diff node.
877 /// @param diff the diff node to test.
879 /// @return true iff @p diff is a child node of a function parameter
880 /// diff node.
882 is_child_node_of_function_parm_diff(const diff* diff)
883 {return diff && is_fn_parm_diff(diff->parent_node());}
885 /// Test if a diff node is a child node of a base diff node.
887 /// @param diff the diff node to test.
889 /// @return true iff @p diff is a child node of a base diff node.
891 is_child_node_of_base_diff(const diff* diff)
892 {return diff && is_base_diff(diff->parent_node());}
904 // Setup all the diff output filters we have.
919 /// Set the corpus diff relevant to this context.
926 /// Get the corpus diff for the current context.
928 /// @return the corpus diff of this context.
933 /// Getter for the first corpus of the corpus diff of the current context.
935 /// @return the first corpus of the corpus diff of the current
936 /// context, if no corpus diff is associated to the context.
945 /// Getter for the second corpus of the corpus diff of the current
948 /// @return the second corpus of the corpus diff of the current
949 /// context, if no corpus diff is associated to the context.
982 /// Tests if the current diff context already has a diff for two decls.
988 /// @return a pointer to the diff for @p first @p second if found,
1001 /// Tests if the current diff context already has a diff for two types.
1007 /// @return a pointer to the diff for @p first @p second if found,
1014 /// Tests if the current diff context already has a given diff.
1016 ///@param d the diff to consider.
1018 /// @return a pointer to the diff found for @p d
1019 const diff*
1020 diff_context::has_diff_for(const diff* d) const
1023 /// Tests if the current diff context already has a given diff.
1025 ///@param d the diff to consider.
1027 /// @return a pointer to the diff found for @p d
1074 /// Add a diff for two decls to the cache of the current diff_context.
1076 /// Doing this allows to later find the added diff from its two
1083 /// @param the diff to add.
1090 /// Add a diff tree node to the cache of the current diff_context
1092 /// @param d the diff tree node to add.
1094 diff_context::add_diff(const diff* d)
1098 diff_sptr dif(const_cast<diff*>(d), noop_deleter());
1103 /// Add a diff tree node to the cache of the current diff_context
1105 /// @param d the diff tree node to add.
1113 /// Getter for the @ref CanonicalDiff "canonical diff node" for the
1114 /// @ref diff represented by their two subjects.
1116 /// @param first the first subject of the diff.
1118 /// @param second the second subject of the diff.
1120 /// @return the canonical diff for the diff node represented by the
1121 /// two diff subjects @p first and @p second. If no canonical diff
1129 /// Getter for the @ref CanonicalDiff "canonical diff node" for the
1130 /// @ref diff represented by the two subjects of a given diff node.
1132 /// @param d the diff node to get the canonical node for.
1134 /// @return the canonical diff for the diff node represented by the
1135 /// two diff subjects of @p d. If no canonical diff node was
1141 /// Setter for the @ref CanonicalDiff "canonical diff node" for the
1142 /// @ref diff represented by their two subjects.
1144 /// @param first the first subject of the diff.
1146 /// @param second the second subject of the diff.
1148 /// @param d the new canonical diff.
1162 /// If there is is a @ref CanonicalDiff "canonical diff node"
1163 /// registered for two diff subjects, return it. Otherwise, register
1164 /// a canonical diff node for these two diff subjects and return it.
1166 /// @param first the first subject of the diff.
1168 /// @param second the second subject of the diff.
1170 /// @param d the new canonical diff node.
1172 /// @return the canonical diff node.
1189 /// Set the canonical diff node property of a given diff node
1192 /// For a given diff node that has no canonical diff node, retrieve
1193 /// the canonical diff node (by looking at its diff subjects and at
1194 /// the current context) and set the canonical diff node property of
1195 /// the diff node to that canonical diff node. If no canonical diff
1196 /// node has been registered to the diff context for the subjects of
1197 /// the diff node then, register the canonical diff node as being the
1198 /// diff node itself; and set its canonical diff node property as
1199 /// such. Otherwise, if the diff node already has a canonical diff
1202 /// @param diff the diff node to initialize the canonical diff node
1205 diff_context::initialize_canonical_diff(const diff_sptr diff)
1207 if (diff->get_canonical_diff() == 0)
1210 set_or_get_canonical_diff_for(diff->first_subject(),
1211 diff->second_subject(),
1212 diff);
1213 diff->set_canonical_diff(canonical.get());
1217 /// Add a diff node to the set of diff nodes that are kept alive for
1220 /// Note that diff added to the diff cache are kept alive as well, and
1223 /// @param d the diff node to be kept alive during the life time of
1229 /// Test if a diff node has been traversed.
1231 /// @param d the diff node to consider.
1233 /// @return the first diff node against which @p d is redundant.
1234 diff*
1235 diff_context::diff_has_been_visited(const diff* d) const
1237 const diff* canonical = d->get_canonical_diff();
1243 return reinterpret_cast<diff*>(it->second);
1248 /// Test if a diff node has been traversed.
1250 /// @param d the diff node to consider.
1252 /// @return the first diff node against which @p d is redundant.
1256 diff_sptr diff(diff_has_been_visited(d.get()));
1257 return diff;
1260 /// Mark a diff node as traversed by a traversing algorithm.
1262 /// Actually, it's the @ref CanonicalDiff "canonical diff" of this
1265 /// Subsequent invocations of diff_has_been_visited() on the diff node
1268 diff_context::mark_diff_as_visited(const diff* d)
1273 const diff* canonical = d->get_canonical_diff();
1281 /// Unmark all the diff nodes that were marked as being traversed.
1287 /// a diff nodes tree each node is visited at most once.
1289 /// @param f if true then during the traversing of a diff nodes tree
1306 /// Return a flag that, if true, then during the traversing of a diff
1314 /// Return a flag that, if true, then during the traversing of a diff
1316 /// diff tree underneath a given interface (public function or
1330 /// Getter for the diff tree nodes filters to apply to diff sub-trees.
1332 /// @return the vector of tree filters to apply to diff sub-trees.
1337 /// Setter for the diff filters to apply to a given diff sub-tree.
1339 /// @param f the new diff filter to add to the vector of diff filters
1340 /// to apply to diff sub-trees.
1345 /// Apply the diff filters to a given diff sub-tree.
1351 /// @param diff the diff sub-tree to apply the filters to.
1353 diff_context::maybe_apply_filters(diff_sptr diff)
1355 if (!diff)
1361 if (!diff->has_changes())
1368 filtering::apply_filter(*i, diff);
1369 propagate_categories(diff);
1374 /// Apply the diff filters to the diff nodes of a @ref corpus_diff
1378 /// then this function walks the diff tree and categorizes its nodes
1381 /// @param diff the corpus diff to apply the filters to.
1383 diff_context::maybe_apply_filters(corpus_diff_sptr diff)
1386 if (!diff || !diff->has_changes())
1393 filtering::apply_filter(**i, diff);
1394 propagate_categories(diff);
1398 /// Getter for the vector of suppressions that specify which diff node
1406 /// Add a new suppression specification that specifies which diff node
1410 /// existing set of suppressions specifications of the diff context.
1415 /// Add new suppression specifications that specify which diff node
1419 /// existing set of suppression specifications of the diff context.
1427 /// Set the flag that indicates if the diff using this context should
1430 /// @param f the new value of the flag that indicates if the diff
1442 /// Get the flag that indicates if the diff using this context should
1445 /// @return the value of the flag that indicates if the diff using
1451 /// Get the flag that indicates if the diff reports using this context
1461 /// Set the flag that indicates if diff reports using this context
1471 /// Get the flag that indicates if diff reports using this context
1480 /// Set the flag that indicates if diff reports using this context
1508 /// diff stats.
1515 /// Test if the comparison module should only show the diff stats.
1517 /// @return true if the comparison module should only show the diff
1653 /// functions or variables diff nodes that have *exclusively*
1654 /// redundant diff tree children nodes.
1662 /// functions or variables diff nodes that have *exclusively*
1663 /// redundant diff tree children nodes.
1778 /// Test if the comparison engine should dump the diff tree for the
1782 /// diff tree for the changed functions and variables it has.
1787 /// Set if the comparison engine should dump the diff tree for the
1791 /// diff tree for the changed functions and variables it has.
1796 /// Emit a textual representation of a diff tree to the error output
1799 /// @param d the diff tree to serialize to the error output associated
1821 // <diff stuff>
1823 /// Constructor for the @ref diff type.
1825 /// This constructs a diff between two subjects that are actually
1828 /// @param first_subject the first decl (subject) of the diff.
1830 /// @param second_subject the second decl (subject) of the diff.
1831 diff::diff(type_or_decl_base_sptr first_subject,
1840 /// Constructor for the @ref diff type.
1842 /// This constructs a diff between two subjects that are actually
1845 /// @param first_subject the first decl (subject) of the diff.
1847 /// @param second_subject the second decl (subject) of the diff.
1849 /// @param ctxt the context of the diff. Note that this context
1851 /// instance of @ref diff. Otherwise, memory corruption issues occur.
1852 diff::diff(type_or_decl_base_sptr first_subject,
1861 /// Flag a given diff node as being traversed.
1863 /// For certain diff nodes like @ref class_diff, it's important to
1866 /// diff::begin_traversing() and diff::end_traversing() methods flag a
1868 /// diff::is_traversing() can tell if the node is being traversed.
1877 diff::begin_traversing()
1892 /// Please read the comments for the diff::begin_traversing() for mode
1895 /// @return true if the current instance of @diff is being traversed.
1897 diff::is_traversing() const
1904 /// Flag a given diff node as not being traversed anymore.
1909 /// Please read the comments of the function diff::begin_traversing()
1912 diff::end_traversing()
1920 /// Finish the insertion of a diff tree node into the diff graph.
1925 /// For instance, certain kinds of diff tree node have specific
1927 /// diff tree node has been called. In that case, calling overloads
1931 diff::finish_diff_type()
1933 if (diff::priv_->finished_)
1936 diff::priv_->finished_ = true;
1939 /// Getter of the first subject of the diff.
1941 /// @return the first subject of the diff.
1943 diff::first_subject() const
1946 /// Getter of the second subject of the diff.
1948 /// @return the second subject of the diff.
1950 diff::second_subject() const
1953 /// Getter for the children nodes of the current @ref diff node.
1956 const vector<diff*>&
1957 diff::children_nodes() const
1960 /// Getter for the parent node of the current @ref diff node.
1962 /// @return the parent node of the current @ref diff node.
1963 const diff*
1964 diff::parent_node() const
1967 /// Getter for the canonical diff of the current instance of @ref
1968 /// diff.
1970 /// Note that the canonical diff node for the current instanc eof diff
1973 /// diff node.
1975 /// @return the canonical diff node or null if none was set.
1976 diff*
1977 diff::get_canonical_diff() const
1980 /// Setter for the canonical diff of the current instance of @ref
1981 /// diff.
1985 diff::set_canonical_diff(diff * d)
1989 /// current @ref diff node.
1993 diff::append_child_node(diff_sptr d)
1998 // diff.
2004 // this diff, thanks to the call to context()->keep_diff_alive(d)
2011 /// Getter of the context of the current diff.
2013 /// @return the context of the current diff.
2015 diff::context() const
2018 /// Setter of the context of the current diff.
2022 diff::context(diff_context_sptr c)
2026 /// this diff.
2029 /// current diff, false otherwise.
2031 diff::currently_reporting() const
2039 /// a report for this diff.
2042 /// current diff, false otherwise.
2044 diff::currently_reporting(bool f) const
2051 /// Tests if a report has already been emitted for the current diff.
2054 /// current diff, false otherwise.
2056 diff::reported_once() const
2062 /// The generic traversing code that walks a given diff sub-tree.
2064 /// Note that there is a difference between traversing a diff node and
2065 /// visiting it. Basically, traversing a diff node means visiting it
2070 /// Note that the insertion of the "generic view" of the diff node
2072 /// insertion of the "typed view" of the diff node into the graph is
2074 /// of the diff node, please read the introductory comments of the
2075 /// @ref diff class.
2078 /// equivalence of a diff node only once. This behaviour can been
2081 /// very risky as it might create endless loops while visiting a diff
2083 /// diff tree graphs with cycles.
2085 /// When a diff node is encountered, the
2086 /// diff_node_visitor::visit_begin() method is invoked on the diff
2089 /// If the diff node has already been visited, then
2091 /// is done; the children of the diff node are not visited in this
2094 /// If the diff node has *NOT* been visited yet, then the
2097 /// returns true, then the children nodes of the diff node are
2098 /// visited. Otherwise, no children nodes of the diff node is
2106 /// @param v the entity that visits each node of the diff sub-tree.
2112 diff::traverse(diff_node_visitor& v)
2114 // Insert the "generic view" of the diff node into its graph.
2140 for (vector<diff*>::const_iterator i = children_nodes().begin();
2172 /// current diff.
2175 /// current diff, false otherwise.
2177 diff::reported_once(bool f) const
2184 /// Getter for the local category of the current diff tree node.
2186 /// The local category represents the set of categories of a diff
2190 /// @return the local category of the current diff tree node.
2192 diff::get_local_category() const
2196 /// diff tree node.
2198 /// That is, if the current diff tree node has a canonical node,
2205 diff::get_class_of_equiv_category() const
2207 diff* canonical = get_canonical_diff();
2211 /// Getter for the category of the current diff tree node.
2214 /// categories inherited from the children diff nodes.
2216 /// @return the category of the current diff tree node.
2218 diff::get_category() const
2221 /// Adds the current diff tree node to an additional set of
2223 /// from the children nodes of this diff node.
2226 /// current diff tree node to.
2229 /// current diff tree node belongs to, including those inherited from
2232 diff::add_to_category(diff_category c)
2238 /// Adds the current diff tree node to the categories resulting from
2239 /// the local changes of the current diff node.
2242 /// current diff tree node to.
2245 /// current diff tree node belongs to.
2247 diff::add_to_local_category(diff_category c)
2253 /// Adds the current diff tree node to the categories resulting from
2254 /// the local and inherited changes of the current diff node.
2257 /// current diff tree node to.
2259 diff::add_to_local_and_inherited_categories(diff_category c)
2265 /// Remove the current diff tree node from an a existing sef of
2267 /// children nodes of the current diff node.
2270 /// current diff tree node to.
2273 /// current diff tree onde belongs to, including the categories
2274 /// inherited from the children nodes of the current diff node.
2276 diff::remove_from_category(diff_category c)
2282 /// Remove the current diff tree node from the categories resulting
2286 /// current diff tree node to.
2289 /// current diff tree onde belongs to.
2291 diff::remove_from_local_category(diff_category c)
2297 /// Set the category of the current @ref diff node. This category
2299 /// current diff node.
2301 /// @param c the new category for the current diff node.
2303 diff::set_category(diff_category c)
2306 /// Set the local category of the current @ref diff node.
2308 /// @param c the new category for the current diff node.
2310 diff::set_local_category(diff_category c)
2313 /// Test if this diff tree node is to be filtered out for reporting
2316 /// The function tests if the categories of the diff tree node are
2319 /// @return true iff the current diff node should NOT be reported.
2321 diff::is_filtered_out() const
2323 if (diff * canonical = get_canonical_diff())
2335 /// Test if this diff tree node is to be filtered out for reporting
2339 /// The function tests if the local categories of the diff tree node
2342 /// @return true iff the current diff node should NOT be reported,
2345 diff::is_filtered_out_wrt_non_inherited_categories() const
2348 /// Test if the current diff node has been suppressed by a
2351 /// @return true if the current diff node has been suppressed by a
2354 diff::is_suppressed() const
2360 /// Test if the current diff node has been suppressed by a
2367 /// @param is_private_type out parameter if the current diff node was
2371 /// @return true if the current diff node has been suppressed by a
2374 diff::is_suppressed(bool &is_private_type) const
2391 /// Test if this diff tree node should be reported.
2395 diff::to_be_reported() const
2402 /// Test if this diff tree node should be reported when considering
2407 diff::has_local_changes_to_be_reported() const
2415 /// Get a pretty representation of the current @ref diff node.
2417 /// This is suitable for e.g. emitting debugging traces for the diff
2420 /// @return the pretty representation of the diff node.
2422 diff::get_pretty_representation() const
2431 /// There are several types of diff nodes that have logical children
2432 /// nodes; for instance, a typedef_diff has the diff of the underlying
2433 /// type as a child node. A var_diff has the diff of the types of the
2436 /// But because the @ref diff base has a generic representation for
2437 /// children nodes of the all the types of @ref diff nodes (regardless
2438 /// of the specific most-derived type of diff node) that one can get
2439 /// using the method diff::children_nodes(), one need to populate that
2443 /// it must be overloaded by each most-derived type of diff node that
2444 /// extends the @ref diff type.
2446 diff::chain_into_hierarchy()
2449 // </diff stuff>
2456 : diff(first_subject, second_subject, ctxt),
2468 /// @param first_subject the first subject of the diff.
2470 /// @param second_subject the second subject of the diff.
2472 /// @param ctxt the context of the diff. This object must stay alive
2478 : diff(first_subject, second_subject, ctxt),
2493 if (diff::priv_->pretty_representation_.empty())
2507 diff::priv_->pretty_representation_ = o.str();
2509 return diff::priv_->pretty_representation_;
2512 /// Populate the vector of children node of the @ref diff base type
2516 /// diff::children_nodes().
2528 /// Note that the two entities considered for the diff (and passed in
2531 /// @param first the first entity to consider for the diff.
2533 /// @param second the second entity to consider for the diff.
2535 /// @param ctxt the context of the diff. Note that this context
2542 : diff(first, second, ctxt),
2546 /// Getter for the first subject of the diff.
2548 /// @return the first subject of the diff.
2553 /// Getter for the second subject of the diff.
2555 /// @return the second subject of the diff.
2560 /// Getter for the child diff of this distinct_diff instance.
2563 /// compatible, then the distinct_diff instance has a child diff node
2564 /// (named the compatible child diff) that is the diff between the two
2566 /// child diff is nul.
2568 /// Note that two diff subjects (that compare different) are
2572 /// @return the compatible child diff node, if any. Otherwise, null.
2606 // We do consider diffs of two empty decls as a diff of distinct
2616 /// @return true if the two subjects of the diff are different, false
2622 /// @return the kind of local change carried by the current diff node.
2634 /// Emit a report about the current diff instance.
2636 /// @param out the output stream to send the diff report to.
2645 /// Try to diff entities that are of distinct kinds.
2647 /// @param first the first entity to consider for the diff.
2649 /// @param second the second entity to consider for the diff.
2651 /// @param ctxt the context of the diff.
2653 /// @return a non-null diff if a diff object could be built, null
2672 /// Try to compute a diff on two instances of DiffType representation.
2674 /// The function template performs the diff if and only if the decl
2677 /// @tparm DiffType the type of instances to diff.
2680 /// diff computation.
2683 /// diff computation.
2685 /// @param ctxt the diff context to use.
2687 ///@return the diff of the two types @p first and @p second if and
2709 /// This is a specialization of @ref try_to_diff() template to diff
2713 /// diff computation.
2716 /// diff computation.
2718 /// @param ctxt the diff context to use.
2751 /// Try to diff entities that are of distinct kinds.
2753 /// @param first the first entity to consider for the diff.
2755 /// @param second the second entity to consider for the diff.
2757 /// @param ctxt the context of the diff.
2759 /// @return a non-null diff if a diff object could be built, null
2770 /// and runs the appropriate diff function on them.
2773 /// want to be able to diff two instances of it, we need to update
2776 /// @param first the first type decl to consider for the diff
2778 /// @param second the second type decl to consider for the diff.
2780 /// @param ctxt the diff context to use.
2782 /// @return the resulting diff. It's a pointer to a descendent of
2783 /// abigail::comparison::diff.
3084 /// runs the appropriate diff function on them.
3087 /// we want to be able to diff two instances of it, we need to update
3090 /// @param first the first decl to consider for the diff
3092 /// @param second the second decl to consider for the diff.
3094 /// @param ctxt the diff context to use.
3096 /// @return the resulting diff.
3124 /// @param ctxt the diff context to use.
3126 /// @return the resulting diff, or NULL if the diff could not be
3154 /// @param ctxt the diff context to use.
3156 /// @return the resulting diff, or NULL if the diff couldn't be
3171 /// Get a copy of the pretty representation of a diff node.
3173 /// @param d the diff node to consider.
3177 get_pretty_representation(diff* d)
3181 string prefix= "diff of ";
3187 /// Populate the vector of children node of the @ref diff base type
3191 /// diff::children_node().
3201 if (diff::priv_->pretty_representation_.empty())
3209 diff::priv_->pretty_representation_ = o.str();
3211 return diff::priv_->pretty_representation_;
3216 /// the diff.
3219 /// the diff.
3221 /// @param type_diff the diff between types of the instances of
3224 /// @param ctxt the diff context to use.
3233 /// Getter for the first @ref var_decl of the diff.
3235 /// @return the first @ref var_decl of the diff.
3240 /// Getter for the second @ref var_decl of the diff.
3242 /// @return the second @ref var_decl of the diff.
3247 /// Getter for the diff of the types of the instances of @ref
3250 /// @return the diff of the types of the instances of @ref var_decl.
3267 /// Return true iff the diff node has a change.
3269 /// @return true iff the diff node has a change.
3274 /// @return the kind of local change carried by the current diff node.
3286 /// Report the diff in a serialized form.
3288 /// @param out the stream to serialize the diff to.
3298 /// Compute the diff between two instances of @ref var_decl.
3303 /// @param first the first @ref var_decl to consider for the diff.
3305 /// @param second the second @ref var_decl to consider for the diff.
3307 /// @param ctxt the diff context to use.
3309 /// @return the resulting diff between the two @ref var_decl.
3325 /// Populate the vector of children node of the @ref diff base type
3329 /// diff::children_node().
3336 /// @param first the first pointer to consider for the diff.
3338 /// @param second the secon pointer to consider for the diff.
3340 /// @param ctxt the diff context to use.
3349 /// Getter for the first subject of a pointer diff
3351 /// @return the first pointer considered in this pointer diff.
3356 /// Getter for the second subject of a pointer diff
3358 /// @return the second pointer considered in this pointer diff.
3368 if (diff::priv_->pretty_representation_.empty())
3376 diff::priv_->pretty_representation_ = o.str();
3378 return diff::priv_->pretty_representation_;
3381 /// Return true iff the current diff node carries a change.
3383 /// @return true iff the current diff node carries a change.
3388 /// @return the kind of local change carried by the current diff node.
3400 /// Getter for the diff between the pointed-to types of the pointers
3401 /// of this diff.
3403 /// @return the diff between the pointed-to types.
3408 /// Setter for the diff between the pointed-to types of the pointers
3409 /// of this diff.
3411 /// @param d the new diff between the pointed-to types of the pointers
3412 /// of this diff.
3417 /// Report the diff in a serialized form.
3419 /// @param out the stream to serialize the diff to.
3429 /// Compute the diff between between two pointers.
3434 /// @param first the pointer to consider for the diff.
3436 /// @param second the pointer to consider for the diff.
3438 /// @return the resulting diff between the two pointers.
3440 /// @param ctxt the diff context to use.
3459 /// Populate the vector of children node of the @ref diff base type
3463 /// diff::children_node().
3470 /// @param first the first array_type of the diff.
3472 /// @param second the second array_type of the diff.
3474 /// @param element_type_diff the diff between the two array element
3477 /// @param ctxt the diff context to use.
3486 /// Getter for the first array of the diff.
3488 /// @return the first array of the diff.
3493 /// Getter for the second array of the diff.
3495 /// @return for the second array of the diff.
3500 /// Getter for the diff between the two types of array elements.
3502 /// @return the diff between the two types of array elements.
3507 /// Setter for the diff between the two array element types.
3509 /// @param d the new diff betweend the two array element types.
3519 if (diff::priv_->pretty_representation_.empty())
3527 diff::priv_->pretty_representation_ = o.str();
3529 return diff::priv_->pretty_representation_;
3532 /// Return true iff the current diff node carries a change.
3534 /// @return true iff the current diff node carries a change.
3561 /// @return the kind of local change carried by the current diff node.
3573 /// Report the diff in a serialized form.
3584 /// Compute the diff between two arrays.
3589 /// @param first the first array to consider for the diff.
3591 /// @param second the second array to consider for the diff.
3593 /// @param ctxt the diff context to use.
3610 /// Populate the vector of children node of the @ref diff base type
3614 /// diff::children_node().
3621 /// @param first the first reference_type of the diff.
3623 /// @param second the second reference_type of the diff.
3625 /// @param ctxt the diff context to use.
3634 /// Getter for the first reference of the diff.
3636 /// @return the first reference of the diff.
3641 /// Getter for the second reference of the diff.
3643 /// @return for the second reference of the diff.
3649 /// Getter for the diff between the two referred-to types.
3651 /// @return the diff between the two referred-to types.
3656 /// Setter for the diff between the two referred-to types.
3658 /// @param d the new diff betweend the two referred-to types.
3671 if (diff::priv_->pretty_representation_.empty())
3679 diff::priv_->pretty_representation_ = o.str();
3681 return diff::priv_->pretty_representation_;
3684 /// Return true iff the current diff node carries a change.
3686 /// @return true iff the current diff node carries a change.
3693 /// @return the kind of local change carried by the current diff node.
3705 /// Report the diff in a serialized form.
3716 /// Compute the diff between two references.
3721 /// @param first the first reference to consider for the diff.
3723 /// @param second the second reference to consider for the diff.
3725 /// @param ctxt the diff context to use.
3742 /// Populate the vector of children node of the @ref diff base type
3746 /// diff::children_node().
3753 /// @param first the first qualified type of the diff.
3755 /// @param second the second qualified type of the diff.
3757 /// @param ctxt the diff context to use.
3766 /// Getter for the first qualified type of the diff.
3768 /// @return the first qualified type of the diff.
3773 /// Getter for the second qualified type of the diff.
3775 /// @return the second qualified type of the diff.
3780 /// Getter for the diff between the underlying types of the two
3783 /// @return the diff between the underlying types of the two qualified
3789 /// Getter for the diff between the most underlying non-qualified
3792 /// @return the diff between the most underlying non-qualified types
3806 /// Setter for the diff between the underlying types of the two
3809 /// @return the diff between the underlying types of the two qualified
3820 if (diff::priv_->pretty_representation_.empty())
3828 diff::priv_->pretty_representation_ = o.str();
3830 return diff::priv_->pretty_representation_;
3833 /// Return true iff the current diff node carries a change.
3835 /// @return true iff the current diff node carries a change.
3840 /// @return the kind of local change carried by the current diff node.
3852 /// Report the diff in a serialized form.
3863 /// Compute the diff between two qualified types.
3868 /// @param first the first qualified type to consider for the diff.
3870 /// @param second the second qualified type to consider for the diff.
3872 /// @param ctxt the diff context to use.
3969 /// Populate the vector of children node of the @ref diff base type
3973 /// diff::children_node().
3980 /// @param first the first enum type of the diff.
3982 /// @param second the second enum type of the diff.
3984 /// @param underlying_type_diff the diff of the two underlying types
3987 /// @param ctxt the diff context to use.
3996 /// @return the first enum of the diff.
4001 /// @return the second enum of the diff.
4006 /// @return the diff of the two underlying enum types.
4031 if (diff::priv_->pretty_representation_.empty())
4039 diff::priv_->pretty_representation_ = o.str();
4041 return diff::priv_->pretty_representation_;
4044 /// Return true iff the current diff node carries a change.
4046 /// @return true iff the current diff node carries a change.
4051 /// @return the kind of local change carried by the current diff node.
4084 /// @return the resulting diff of the two enums @p first and @p
4087 /// @param ctxt the diff context to use.
4114 /// Test if the current diff node carries a member type change for a
4137 /// Test if the current diff node carries a data member change for a
4160 /// Test if the current diff node carries a member class template
4223 /// current diff node that were filtered out.
4229 /// current diff node that were filtered out.
4254 /// Get the number of data member changes carried by the current diff
4261 /// diff node that were filtered out.
4271 diff_sptr diff = i->second;
4274 if ((diff->has_changes() && !diff->has_local_changes_to_be_reported())
4275 || diff->is_filtered_out())
4280 if (diff->is_filtered_out())
4309 /// diff node that were filtered out.
4312 /// current diff node that were filtered out.
4337 diff_sptr diff = *i;
4338 ctxt->maybe_apply_filters(diff);
4340 if (diff->is_filtered_out())
4348 /// diff node that were filtered out.
4351 /// current diff node that were filtered out.
4369 diff_sptr diff = compute_diff_for_decls(f, s, ctxt);
4370 ctxt->maybe_apply_filters(diff);
4372 if (diff->get_category() != NO_CHANGE_CATEGORY
4373 && diff->is_filtered_out())
4381 /// diff node that were filtered out.
4384 /// current diff node that were filtered out.
4402 diff_sptr diff = compute_diff_for_decls(f, s, ctxt);
4403 ctxt->maybe_apply_filters(diff);
4405 if (diff->get_category() != NO_CHANGE_CATEGORY
4406 && diff->is_filtered_out())
4833 /// @param first_scope the first @ref class_or_union of the diff node.
4835 /// @param second_scope the second @ref class_or_union of the diff node.
4837 /// @param ctxt the context of the diff.
4878 /// @return the first @ref class_or_union involved in the diff.
4883 /// @return the second @ref class_or_union involved in the diff.
5052 /// Test if the current diff node carries a change.
5057 /// @return the kind of local change carried by the current diff node.
5082 /// Populate the vector of children node of the @ref diff base type
5086 /// diff::children_node().
5357 // tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt
5470 diff_sptr diff = *i;
5471 if (diff && diff->is_filtered_out())
5477 /// Populate the vector of children node of the @ref diff base type
5481 /// diff::children_node().
5498 /// @param first_scope the first class of the diff.
5500 /// @param second_scope the second class of the diff.
5502 /// @param ctxt the diff context to use.
5511 // the priv_ is set to the priv_ of the canonical diff node.
5550 if (diff::priv_->pretty_representation_.empty())
5558 diff::priv_->pretty_representation_ = o.str();
5560 return diff::priv_->pretty_representation_;
5563 /// Return true iff the current diff node carries a change.
5565 /// @return true iff the current diff node carries a change.
5570 /// @return the kind of local change carried by the current diff node.
5582 /// @return the first class invoveld in the diff.
5587 /// Getter of the second class involved in the diff.
5589 /// @return the second class invoveld in the diff
5599 /// Getter for the deleted base classes of the diff.
5607 /// Getter for the inserted base classes of the diff.
5615 /// Getter for the changed base classes of the diff.
5660 /// @param ctxt the diff context to use.
5677 // canonical diff here in that case.
5765 /// Populate the vector of children node of the @ref diff base type
5769 /// diff::children_node().
5778 /// @param ctxt the context of the diff. Note that this context
5786 : diff(first, second, ctxt),
5790 /// Getter for the first base spec of the diff object.
5792 /// @return the first base specifier for the diff object.
5797 /// Getter for the second base spec of the diff object.
5799 /// @return the second base specifier for the diff object.
5804 /// Getter for the diff object for the diff of the underlying base
5807 /// @return the diff object for the diff of the underlying base
5813 /// Setter for the diff object for the diff of the underlyng base
5816 /// @param d the new diff object for the diff of the underlying base
5827 if (diff::priv_->pretty_representation_.empty())
5835 diff::priv_->pretty_representation_ = o.str();
5837 return diff::priv_->pretty_representation_;
5840 /// Return true iff the current diff node carries a change.
5842 /// Return true iff the current diff node carries a change.
5847 /// @return the kind of local change carried by the current diff node.
5870 /// Constructs the diff object representing a diff between two base
5880 /// @param ctxt the content of the diff.
5882 /// @return the resulting diff object.
5959 /// @return the pretty representation of the current diff node.
5963 if (diff::priv_->pretty_representation_.empty())
5971 diff::priv_->pretty_representation_ = o.str();
5973 return diff::priv_->pretty_representation_;
5997 /// @param ctxt the context of the diff to use.
6243 /// Populate the vector of children node of the @ref diff base type
6247 /// diff::children_node().
6266 /// @param first_scope the first scope to consider for the diff.
6268 /// @param second_scope the second scope to consider for the diff.
6270 /// @param ctxt the diff context to use. Note that this context
6277 : diff(first_scope, second_scope, ctxt),
6281 /// Getter for the first scope of the diff.
6283 /// @return the first scope of the diff.
6288 /// Getter for the second scope of the diff.
6290 /// @return the second scope of the diff.
6357 /// of this diff instance) that is reported (in the edit script) as
6363 /// @return the scope member of the first scope of this diff that has
6371 /// scope of this diff instance) that is reported as being inserted
6374 /// @param i the index of an element of the second scope this diff
6377 /// @return the scope member of the second scope of this diff that has
6388 /// scope of this diff instance) that is reported as being inserted
6391 /// @param i the iterator of an element of the second scope this diff
6394 /// @return the scope member of the second scope of this diff that has
6433 if (diff::priv_->pretty_representation_.empty())
6441 diff::priv_->pretty_representation_ = o.str();
6443 return diff::priv_->pretty_representation_;
6446 /// Return true iff the current diff node carries a change.
6448 /// Return true iff the current diff node carries a change.
6456 /// @return the kind of local change carried by the current diff node.
6479 /// Compute the diff between two scopes.
6484 /// @param first the first scope to consider in computing the diff.
6486 /// @param second the second scope to consider in the diff
6489 /// @param d a pointer to the diff object to populate with the
6490 /// computed diff.
6495 /// @param ctxt the diff context to use.
6516 /// Compute the diff between two scopes.
6521 /// @param first_scope the first scope to consider in computing the diff.
6523 /// @param second_scope the second scope to consider in the diff
6526 /// @param ctxt the diff context to use.
6528 /// @return return the resulting diff
6546 /// @param first the first subject of the diff.
6548 /// @param second the second subject of the diff.
6550 /// @param ctxt the context of the diff. Note that this context
6567 /// Getter for the first subject of this diff node.
6570 /// diff node.
6575 /// Getter for the second subject of this diff node.
6578 /// diff node.
6583 /// Getter for the diff representing the changes on the type of the
6601 if (diff::priv_->pretty_representation_.empty())
6609 diff::priv_->pretty_representation_ = o.str();
6611 return diff::priv_->pretty_representation_;
6614 /// Return true iff the current diff node carries a change.
6616 /// @return true iff the current diff node carries a change.
6621 /// Check if the current diff node carries a local change.
6623 /// @return the kind of local change carried by the current diff node.
6646 /// Populate the vector of children nodes of the @ref diff base type
6650 /// diff::children_nodes()
6665 /// @param first the first subject of the diff.
6667 /// @param second the second subject of the diff.
6669 /// @param ctxt the context of the diff.
6671 /// @return fn_parm_diff_sptr the resulting diff node.
6808 /// @param first the first @ref function_type subject of the diff to
6811 /// @param second the second @ref function_type subject of the diff to
6814 /// @param ctxt the diff context to be used by the newly created
6826 /// Getter for the first subject of the diff.
6828 /// @return the first function type involved in the diff.
6833 /// Getter for the second subject of the diff.
6835 /// @return the second function type involved in the diff.
6840 /// Getter for the diff of the return types of the two function types
6841 /// of the current diff.
6843 /// @return the diff of the return types of the two function types of
6844 /// the current diff.
6849 /// Getter for the map of function parameter changes of the current diff.
6851 /// @return a map of function parameter changes of the current diff.
6878 if (diff::priv_->pretty_representation_.empty())
6886 diff::priv_->pretty_representation_ = o.str();
6888 return diff::priv_->pretty_representation_;
6891 /// Test if the current diff node carries changes.
6893 /// @return true iff the current diff node carries changes.
6898 /// Test if the current diff node carries local changes.
6900 /// A local change is a change that is carried by this diff node, not
6903 /// @return the kind of local change carried by the current diff node.
6927 /// Populate the vector of children node of the @ref diff base type
6931 /// diff::children_node().
6953 /// Compute the diff between two instances of @ref function_type.
6958 /// @param first the first @ref function_type to consider for the diff.
6960 /// @param second the second @ref function_type to consider for the diff.
6962 /// @param ctxt the diff context to use.
6964 /// @return the resulting diff between the two @ref function_type.
6994 /// Build the lookup tables of the diff, if necessary.
7000 /// Populate the vector of children node of the @ref diff base type
7004 /// diff::children_node().
7014 /// @param first the first function considered by the diff.
7016 /// @param second the second function considered by the diff.
7018 /// @param ctxt the context of the diff. Note that this context
7030 /// @return the first function considered by the diff.
7035 /// @return the second function considered by the diff.
7049 if (diff::priv_->pretty_representation_.empty())
7057 diff::priv_->pretty_representation_ = o.str();
7059 return diff::priv_->pretty_representation_;
7062 /// Return true iff the current diff node carries a change.
7064 /// @return true iff the current diff node carries a change.
7069 /// @return the kind of local change carried by the current diff node.
7093 /// Compute the diff between two function_decl.
7098 /// @param first the first function_decl to consider for the diff
7100 /// @param second the second function_decl to consider for the diff
7102 /// @param ctxt the diff context to use.
7104 /// @return the computed diff
7137 /// @param first the first subject of the diff.
7139 /// @param second the second subject of the diff.
7141 /// @param ctxt the context of the diff. Note that this context
7153 /// @return the first type_decl involved in the diff.
7160 /// @return the second type_decl involved in the diff.
7170 if (diff::priv_->pretty_representation_.empty())
7178 diff::priv_->pretty_representation_ = o.str();
7180 return diff::priv_->pretty_representation_;
7182 /// Return true iff the current diff node carries a change.
7184 /// @return true iff the current diff node carries a change.
7189 /// @return the kind of local change carried by the current diff node.
7212 /// Compute a diff between two type_decl.
7217 /// This function doesn't actually compute a diff. As a type_decl is
7230 /// @param ctxt the diff context to use.
7240 // We don't need to actually compute a diff here as a type_decl
7256 /// Populate the vector of children node of the @ref diff base type
7260 /// diff::children_node().
7267 /// @param first the first subject of the diff.
7269 /// @param second the second subject of the diff.
7271 /// @param underlying the underlying diff of the @ref typedef_diff.
7272 /// That is the diff between the underlying types of @p first and @p
7275 /// @param ctxt the context of the diff. Note that this context
7287 /// Getter for the firt typedef_decl involved in the diff.
7289 /// @return the first subject of the diff.
7294 /// Getter for the second typedef_decl involved in the diff.
7296 /// @return the second subject of the diff.
7301 /// Getter for the diff between the two underlying types of the
7304 /// @return the diff object reprensenting the difference between the
7310 /// Setter for the diff between the two underlying types of the
7313 /// @param d the new diff object reprensenting the difference between
7324 if (diff::priv_->pretty_representation_.empty())
7332 diff::priv_->pretty_representation_ = o.str();
7334 return diff::priv_->pretty_representation_;
7337 /// Return true iff the current diff node carries a change.
7339 /// @return true iff the current diff node carries a change.
7347 /// @return the kind of local change carried by the current diff node.
7359 /// Reports the difference between the two subjects of the diff in a
7371 /// Compute a diff between two typedef_decl.
7380 /// @param ctxt the diff context to use.
7398 /// Return the leaf underlying diff node of a @ref typedef_diff node.
7400 /// If the underlying diff node of a @ref typedef_diff node is itself
7402 /// diff nodes to get the first one that is not a a @ref typedef_diff
7403 /// node. This is what a leaf underlying diff node means.
7405 /// Otherwise, if the underlying diff node of @ref typedef_diff is
7407 /// diff node.
7409 /// And if the diff node considered is not a @ref typedef_diff node,
7412 /// @return the leaf underlying diff node of a @p diff.
7413 const diff*
7414 get_typedef_diff_underlying_type_diff(const diff* diff)
7416 const typedef_diff* d = dynamic_cast<const typedef_diff*>(diff);
7418 return diff;
7433 /// @param first the first translation unit to consider for this diff.
7435 /// @param second the second translation unit to consider for this diff.
7437 /// @param ctxt the context of the diff. Note that this context
7449 /// Getter for the first translation unit of this diff.
7451 /// @return the first translation unit of this diff.
7456 /// Getter for the second translation unit of this diff.
7458 /// @return the second translation unit of this diff.
7463 /// Return true iff the current diff node carries a change.
7465 /// @return true iff the current diff node carries a change.
7470 /// @return the kind of local change carried by the current diff node.
7477 /// Report the diff in a serialized form.
7486 /// Compute the diff between two translation_units.
7495 /// @param ctxt the diff context to use. If null, this function will
7496 /// create a new context and set to the diff object returned.
7498 /// @return the newly created diff object.
7721 /// Insert a new diff node into the current instance of @ref diff_maps.
7723 /// @param dif the new diff node to insert into the @ref diff_maps.
7726 /// currently being analysed that led to analysing the diff node @p
7727 /// dif. In other words, this is the interface impacted by the diff
7732 /// @return true iff the diff node could be added to the current
7735 diff_maps::insert_diff_node(const diff *dif,
7770 // Update the map that associates this diff node to the set of
7791 /// Lookup the interfaces that are impacted by a given leaf diff node.
7793 /// @param d the diff node to consider.
7797 diff_maps::lookup_impacted_interfaces(const diff *d) const
7813 /// @param ctxt the context of the corpus diff. Note that this
7971 /// out from the diff.
7975 /// filtered out from the diff.
8114 /// out from the diff.
8118 /// filtered out from the diff.
8357 /// Getter of the number of leaf type change diff nodes.
8359 /// @return the number of leaf type change diff nodes.
8364 /// Setter of the number of leaf type change diff nodes.
8366 /// @param n the new number of leaf type change diff nodes.
8371 /// Getter of the number of leaf type change diff nodes that have been
8374 /// @return the number of leaf type change diff nodes that have been
8379 /// Setter of the number of leaf type change diff nodes that have been
8382 /// @param n the new number of leaf type change diff nodes that have
8388 /// Getter of the net number of leaf change diff nodes.
8391 /// diff nodes, and the number of the leaf change diff nodes that have
8403 /// Getter for the number of leaf type change diff nodes.
8405 /// @return the number of leaf type changes diff nodes.
8410 /// Setter for the number of leaf type change diff nodes.
8412 /// @param n the new number of leaf type change diff nodes.
8417 /// Getter for the number of filtered out leaf type change diff nodes.
8419 /// @return the number of filtered out leaf type change diff nodes.
8424 /// Setter for the number of filtered out leaf type change diff nodes.
8425 /// @param n the new number of filtered out leaf type change diff nodes.
8430 /// Getter for the net number of leaf type change diff nodes.
8435 /// @return the net number of leaf type change diff nodes.
8440 /// Getter for the number of leaf function change diff nodes.
8442 /// @return the number of leaf function change diff nodes.
8447 /// Setter for the number of leaf function change diff nodes.
8449 /// @param n the new number of leaf function change diff nodes.
8454 /// Getter for the number of leaf function change diff nodes that were
8457 /// @return the number of leaf function change diff nodes that were
8463 /// Setter for the number of leaf function change diff nodes that were
8466 /// @param n the new number of leaf function change diff nodes that
8472 /// Getter for the net number of leaf function change diff nodes.
8475 /// diff nodes and the number of filtered out leaf function change
8476 /// diff nodes.
8478 /// @return the net number of leaf function change diff nodes.
8483 /// Getter for the number of leaf variable change diff nodes.
8485 /// @return the number of leaf variable change diff nodes.
8490 /// Setter for the number of leaf variable change diff nodes.
8492 /// @param n the number of leaf variable change diff nodes.
8693 /// Getter for the number of leaf variable changes diff nodes that
8696 /// @return the number of leaf variable changes diff nodes that have
8702 /// Setter for the number of leaf variable changes diff nodes that
8705 /// @param n the number of leaf variable changes diff nodes that have
8711 /// Getter for the net number of leaf variable change diff nodes.
8714 /// diff nodes and the number of filtered out leaf variable change
8715 /// diff nodes.
8717 /// @return the net number of leaf variable change diff nodes.
9138 // case we'll compute the diff of that change and store it
9157 // was changed. Let's compute its diff and store it
9188 /// @param ctxt the context of the current diff.
9215 /// @param ctxt the context of the current diff.
9232 /// Apply suppression specifications for this corpus diff to the set
9695 /// Get the sorted vector of diff nodes representing changed
9699 /// this function gets the diff nodes representing changed
9702 /// @return the sorted vector of diff nodes representing changed
9715 /// Compute the diff stats.
9718 /// function applies the categorizing filters to the diff sub-trees of
9719 /// each function changes diff, prior to calculating the stats.
9746 // Walk the changed function diff nodes to apply the categorization
9748 diff_sptr diff;
9754 diff_sptr diff = *i;
9755 ctxt->maybe_apply_filters(diff);
9758 // Walk the changed variable diff nodes to apply the categorization
9764 diff_sptr diff = *i;
9765 ctxt->maybe_apply_filters(diff);
9775 diff_sptr diff = *i;
9776 ctxt->maybe_apply_filters(diff);
9781 // Walk the changed function diff nodes to count the number of
9810 // Walk the changed variables diff nodes to count the number of
9839 // Walk the general leaf type diff nodes to count them
9848 // Walk the general leaf artefacts diff nodes to count them
10149 /// Walk the changed functions and variables diff nodes to categorize
10154 diff_sptr diff;
10164 diff = *i;
10165 categorize_redundancy(diff);
10172 diff_sptr diff = *i;
10173 categorize_redundancy(diff);
10181 diff_sptr diff = *i;
10182 categorize_redundancy(diff);
10186 /// Walk the changed functions and variables diff nodes and clear the
10191 diff_sptr diff;
10196 diff = *i;
10197 abigail::comparison::clear_redundancy_categorization(diff);
10204 diff = *i;
10205 abigail::comparison::clear_redundancy_categorization(diff);
10209 /// If the user asked to dump the diff tree node (for changed
10225 *ctxt->error_output_stream() << "changed functions diff tree: \n\n";
10238 *ctxt->error_output_stream() << "\nchanged variables diff tree: \n\n";
10252 "types diff tree: \n\n";
10281 /// @param first the first corpus of the diff.
10283 /// @param second the second corpus of the diff.
10285 /// @param ctxt the diff context to use. Note that this context
10307 /// @return the first corpus of the diff.
10312 /// @return the second corpus of the diff.
10318 const vector<diff*>&
10339 for (vector<diff*>::iterator i = priv_->children_.begin();
10342 // Look for the point where to insert the diff child node.
10364 /// by the diff.
10370 /// by the diff.
10389 /// Getter for the deleted functions of the diff.
10391 /// @return the the deleted functions of the diff.
10396 /// Getter for the added functions of the diff.
10398 /// @return the added functions of the diff.
10425 /// of the diff.
10432 /// Getter for the added variables of the diff.
10562 /// Getter of the diff context of this diff
10564 /// @return the diff context for this diff.
10589 /// @return true iff the current diff node carries a change.
10682 /// the diff tree; that includes the categorization filters. Also,
10714 /// A visitor that marks leaf diff nodes by storing them in the
10720 /// This is called when the visitor visits a diff node.
10722 /// It basically tests if the diff node being visited is a leaf diff
10731 /// @param d the diff node being visited.
10733 visit_begin(diff *d)
10761 // An anonymous class or union diff doesn't make sense on its
10762 // own. It must have been described already by the diff of
10771 // yield a diff node for a decl-only class (and empty class
10781 if (diff *iface_diff = get_current_topmost_iface_diff())
10784 // So, this diff node that is reachable from a global
10794 /// Walks the diff nodes associated to the current corpus diff and
10796 /// diff nodes.
10837 /// Report the diff in a serialized form.
10839 /// @param out the stream to serialize the diff to.
10849 /// Traverse the diff sub-tree under the current instance corpus_diff.
10851 /// @param v the visitor to invoke on each diff node of the sub-tree.
10938 /// Compute the diff between two instances of @ref corpus.
10943 /// @param f the first @ref corpus to consider for the diff.
10945 /// @param s the second @ref corpus to consider for the diff.
10947 /// @param ctxt the diff context to use.
10949 /// @return the resulting diff between the two @ref corpus.
10978 // Compute the diff of publicly defined and exported functions
10985 // Compute the diff of publicly defined and exported variables.
10991 // Compute the diff of function elf symbols not referenced by debug
11000 // Compute the diff of variable elf symbols not referenced by debug
11010 // Compute the diff of types not reachable from public functions
11026 /// Compute the diff between two instances of @ref corpus_group.
11031 /// @param f the first @ref corpus_group to consider for the diff.
11033 /// @param s the second @ref corpus_group to consider for the diff.
11035 /// @param ctxt the diff context to use.
11037 /// @return the resulting diff between the two @ref corpus_group.
11058 diff* topmost_interface_diff;
11115 /// Setter of the diff current topmost interface which is impacted by
11116 /// the current diff node being visited.
11118 /// @param d the current topmost interface diff impacted.
11120 diff_node_visitor::set_current_topmost_iface_diff(diff* d)
11123 /// Getter of the diff current topmost interface which is impacted by
11124 /// the current diff node being visited.
11126 /// @return the current topmost interface diff impacted.
11127 diff*
11131 /// This is called by the traversing code on a @ref diff node just
11135 /// @param d the diff node to visit.
11137 diff_node_visitor::visit_begin(diff* /*p*/)
11140 /// This is called by the traversing code on a @ref diff node just
11144 /// @param d the diff node that got visited.
11146 diff_node_visitor::visit_end(diff* /*p*/)
11163 /// @param d the diff node that got visited.
11172 diff_node_visitor::visit(diff*, bool)
11181 diff* d = dif;
11193 diff* d = dif;
11205 diff* d = dif;
11217 diff* d = dif;
11229 diff* d = dif;
11241 diff* d = dif;
11253 diff* d = dif;
11265 diff* d = dif;
11277 diff* d = dif;
11289 diff* d = dif;
11301 diff* d = dif;
11313 diff* d = dif;
11325 diff* d = dif;
11340 // <redundant diff node marking>
11342 // </redundant diff node marking>
11344 // <diff tree category propagation>
11353 visit_end(diff* d)
11355 // Has this diff node 'd' been already visited ?
11358 // The canonical diff node of the class of equivalence of the diff
11360 diff* canonical = d->get_canonical_diff();
11362 // If this class of equivalence of diff node is being visited for
11366 for (vector<diff*>::const_iterator i = d->children_nodes().begin();
11375 // visited, then let's look at the canonical diff nodes of the
11377 diff* diff = already_visited
11381 ABG_ASSERT(diff);
11383 diff_category c = diff->get_category();
11407 /// @param diff_tree the diff sub-tree to walk for categorization
11410 propagate_categories(diff* diff_tree)
11424 /// @param diff_tree the diff sub-tree to walk for categorization
11456 /// A tree node visitor that knows how to categorizes a given diff
11462 /// Before visiting the children of the diff node, check if the node
11466 /// @param p the diff node to visit.
11468 visit_begin(diff* d)
11480 diff *canonical_diff = d->get_canonical_diff();
11486 /// After visiting the children nodes of a given diff node,
11488 /// diff node, if need be.
11501 visit_end(diff* d)
11516 // reference or qualified diff node).
11518 // Note that qualified type and typedef diff nodes are a bit
11530 // Note that all pointer/reference diff node changes are
11538 // those kinds of diff node.
11558 // Note that we handle private diff nodes differently from
11559 // generally suppressed diff nodes. E.g, it's not because a
11563 // diff nodes thus have different propagation rules than
11565 for (vector<diff*>::const_iterator i = d->children_nodes().begin();
11569 diff* child = *i;
11603 diff *canonical_diff = d->get_canonical_diff();
11627 diff *canonical_diff = d->get_canonical_diff();
11644 diff *canonical_diff = d->get_canonical_diff();
11653 // d is a function diff that carries a local *type*
11655 // type). Let's see if the child function type diff
11657 // instructed to show details of a diff that is deemed
11667 diff *canonical_diff = d->get_canonical_diff();
11676 /// Walk a given diff-sub tree and appply the suppressions carried by
11681 /// @param diff_tree the diff-sub tree to apply the suppressions to.
11683 apply_suppressions(diff* diff_tree)
11698 /// Walk a given diff-sub tree and appply the suppressions carried by
11703 /// @param diff_tree the diff-sub tree to apply the suppressions to.
11713 /// @param diff_tree the diff tree to apply the suppressions to.
11737 /// Walk a diff tree and appply the suppressions carried by the
11742 /// @param diff_tree the diff tree to apply the suppressions to.
11747 // </diff tree category propagation>
11749 // <diff tree printing stuff>
11752 /// of a @ref diff sub-tree or of a complete @ref corpus_diff tree.
11776 visit_begin(diff*)
11782 visit_end(diff*)
11800 visit(diff* d, bool pre)
11803 // We are post-visiting the diff node D. Which means, we have
11831 // We are post-visiting the diff node D. Which means, we have
11845 // </ diff tree printing stuff>
11847 /// Emit a textual representation of a @ref diff sub-tree to an
11856 print_diff_tree(diff* diff_tree, ostream& out)
11883 /// Emit a textual representation of a @ref diff sub-tree to an
11926 visit_begin(diff* d)
11930 // A diff node that carries a change and that has been already
11938 // But if two diff nodes are redundant sibbling that carry
11949 // the same level in the diff tree.
11952 const diff* p = d->parent_node();
11955 // the fn_parm_diff node to get the function diff node.
11960 for (vector<diff*>::const_iterator s =
11967 diff* sib = *s;
11975 // Sibbling diff nodes that carry base type
12001 // If the canonical diff itself has been filtered out,
12003 // canonical diff was already redundant.
12007 // If the *same* diff node (not one that is merely
12013 // If the diff node is a function parameter and is not
12015 // distinct type diff) then do not mark it as
12018 // Children nodes of base class diff nodes are never
12028 // correctness. In the case of a diff node involving
12052 visit_end(diff* d)
12112 for (vector<diff*>::const_iterator i =
12134 // A diff node for which at least a child node carries a
12150 visit(diff*, bool)
12160 /// A visitor of @ref diff nodes that clears the REDUNDANT_CATEGORY
12169 visit(diff* d, bool)
12179 /// Walk a given @ref diff sub-tree to categorize each of the nodes
12182 /// @param diff_tree the @ref diff sub-tree to walk.
12184 categorize_redundancy(diff* diff_tree)
12195 /// Walk a given @ref diff sub-tree to categorize each of the nodes
12198 /// @param diff_tree the @ref diff sub-tree to walk.
12228 /// Walk a given @ref diff sub-tree to clear the REDUNDANT_CATEGORY
12231 /// @param diff_tree the @ref diff sub-tree to walk.
12233 clear_redundancy_categorization(diff* diff_tree)
12243 /// Walk a given @ref diff sub-tree to clear the REDUNDANT_CATEGORY
12246 /// @param diff_tree the @ref diff sub-tree to walk.
12274 /// Apply the @ref diff tree filters that have been associated to the
12276 /// nodes of the @diff tree are going to be categorized into one of
12279 /// @param diff_tree the @ref corpus_diff instance which @ref diff are
12288 /// Test if a diff node represents the difference between a variadic
12291 /// @param d the diff node to consider.
12293 /// @return true iff @p d is a diff node that represents the
12296 is_diff_of_variadic_parameter_type(const diff* d)
12312 /// Test if a diff node represents the difference between a variadic
12315 /// @param d the diff node to consider.
12317 /// @return true iff @p d is a diff node that represents the
12323 /// Test if a diff node represents the difference between a variadic
12326 /// @param d the diff node to consider.
12328 /// @return true iff @p d is a diff node that represents the
12331 is_diff_of_variadic_parameter(const diff* d)
12333 fn_parm_diff* diff =
12334 dynamic_cast<fn_parm_diff*>(const_cast<abigail::comparison::diff*>(d));
12335 return (diff && is_diff_of_variadic_parameter_type(diff->type_diff()));
12338 /// Test if a diff node represents the difference between a variadic
12341 /// @param d the diff node to consider.
12343 /// @return true iff @p d is a diff node that represents the
12349 /// Test if a diff node represents a diff between two basic types.
12351 /// @param d the diff node to consider.
12353 /// @return true iff @p d is a diff between two basic types.
12355 is_diff_of_basic_type(const diff *d)
12358 /// Test if a diff node represents a diff between two basic types, or
12361 /// @param diff the diff node to consider.
12364 /// pointer, reference or qualified diff types to see if they "point
12367 /// @return true iff @p d is a diff between two basic types.
12369 is_diff_of_basic_type(const diff* diff, bool allow_indirect_type)
12372 diff = peel_pointer_or_qualified_type_diff(diff);
12373 return is_diff_of_basic_type(diff);
12376 /// If a diff node is about changes between two typedef types, get the
12377 /// diff node about changes between the underlying types.
12379 /// Note that this function walks the tree of underlying diff nodes
12380 /// returns the first diff node about types that are not typedefs.
12384 /// @return the underlying diff node of @p dif, or just return @p dif
12385 /// if it's not a typedef diff node.
12386 const diff*
12387 peel_typedef_diff(const diff* dif)
12395 /// If a diff node is about changes between two pointer types, get the
12396 /// diff node about changes between the underlying (pointed-to) types.
12398 /// Note that this function walks the tree of underlying diff nodes
12399 /// returns the first diff node about types that are not pointers.
12403 /// @return the underlying diff node of @p dif, or just return @p dif
12404 /// if it's not a pointer diff node.
12405 const diff*
12406 peel_pointer_diff(const diff* dif)
12414 /// If a diff node is about changes between two reference types, get
12415 /// the diff node about changes between the underlying (pointed-to)
12418 /// Note that this function walks the tree of underlying diff nodes
12419 /// returns the first diff node about types that are not references.
12423 /// @return the underlying diff node of @p dif, or just return @p dif
12424 /// if it's not a reference diff node.
12425 const diff*
12426 peel_reference_diff(const diff* dif)
12434 /// If a diff node is about changes between two qualified types, get
12435 /// the diff node about changes between the underlying (non-qualified)
12438 /// Note that this function walks the tree of underlying diff nodes
12439 /// returns the first diff node about types that are not qualified.
12443 /// @return the underlying diff node of @p dif, or just return @p dif
12444 /// if it's not a qualified diff node.
12445 const diff*
12446 peel_qualified_diff(const diff* dif)
12454 /// If a diff node is about changes between two function parameters
12455 /// get the diff node about changes between the types of the parameters.
12459 /// @return the diff of the types of the parameters.
12460 const diff*
12461 peel_fn_parm_diff(const diff* dif)
12469 /// If a diff node is about changes between two pointer, reference or
12470 /// qualified types, get the diff node about changes between the
12473 /// Note that this function walks the tree of underlying diff nodes
12474 /// returns the first diff node about types that are not pointer,
12479 /// @return the underlying diff node of @p dif, or just return @p dif
12480 /// if it's not a pointer, reference or qualified diff node.
12481 const diff*
12482 peel_pointer_or_qualified_type_diff(const diff*dif)
12498 /// If a diff node is about changes between two typedefs or qualified
12499 /// types, get the diff node about changes between the underlying
12502 /// Note that this function walks the tree of underlying diff nodes
12503 /// returns the first diff node about types that are not typedef or
12508 /// @return the underlying diff node of @p dif, or just return @p dif
12509 /// if it's not typedef or qualified diff node.
12510 const diff*
12511 peel_typedef_or_qualified_type_diff(const diff *dif)
12525 /// If a diff node is about changes between two typedefs or qualified
12526 /// types, get the diff node about changes between the underlying
12529 /// Note that this function walks the tree of underlying diff nodes
12530 /// returns the first diff node about types that are neither typedef,
12535 /// @return the diff node about changes between the underlying types.
12536 const diff*
12537 peel_typedef_qualified_type_or_parameter_diff(const diff *dif)
12553 /// Test if a diff node represents a diff between two class or union
12556 /// @param d the diff node to consider.
12558 /// @return iff @p is a diff between two class or union types then
12562 is_diff_of_class_or_union_type(const diff *d)
12565 /// Test if a given diff node carries *only* a local type change.
12567 /// @param d the diff node to consider.
12572 has_local_type_change_only(const diff *d)
12582 /// Test if a diff node is a decl diff that only carries a basic type
12583 /// change on its type diff sub-node.
12588 /// @param d the diff node to consider.
12590 /// @return true iff @p d is a decl diff that only carries a basic
12591 /// type change on its type diff sub-node.
12593 has_basic_type_change_only(const diff *d)