13 #include "abg-internal.h"
16 ABG_BEGIN_EXPORT_DECLARATIONS
31 using std::dynamic_pointer_cast;
43 bool s = d->context()->visiting_a_node_twice_is_forbidden();
44 d->context()->forbid_visiting_a_node_twice(
true);
46 d->context()->forbid_visiting_a_node_twice(s);
64 bool s = d->context()->visiting_a_node_twice_is_forbidden();
65 d->context()->forbid_visiting_a_node_twice(
true);
66 d->context()->forget_visited_diffs();
68 d->context()->forbid_visiting_a_node_twice(s);
100 if ((class1 && class1->get_is_declaration_only())
101 || (class2 && class2->get_is_declaration_only()))
119 if ((enum1 && enum1->get_is_declaration_only())
120 || (enum2 && enum2->get_is_declaration_only()))
131 diff_involves_decl_only_class(
const class_diff* diff)
133 if (diff && there_is_a_decl_only_class(diff->first_class_decl(),
134 diff->second_class_decl()))
147 type_size_changed(
const type_base_sptr f,
const type_base_sptr s)
150 || f->get_size_in_bits() == 0
151 || s->get_size_in_bits() == 0
158 return f->get_size_in_bits() != s->get_size_in_bits();
171 type_size_changed(
const decl_base_sptr f,
const decl_base_sptr s)
180 has_type_size_change(
const diff* diff)
186 diff = fn_parm_d->type_diff().get();
188 type_base_sptr f =
is_type(diff->first_subject()),
189 s =
is_type(diff->second_subject());
194 return type_size_changed(f, s);
206 access_changed(
const decl_base_sptr& f,
const decl_base_sptr& s)
228 template <
typename function_or_var_decl_sptr>
230 crc_changed(
const function_or_var_decl_sptr& f,
231 const function_or_var_decl_sptr& s)
233 const auto& symbol_f = f->get_symbol();
234 const auto& symbol_s = s->get_symbol();
235 if (!symbol_f || !symbol_s)
237 return symbol_f->get_crc() != symbol_s->get_crc();
247 crc_changed(
const diff* diff)
249 if (
const function_decl_diff* d =
250 dynamic_cast<const function_decl_diff*>(diff))
251 return crc_changed(d->first_function_decl(), d->second_function_decl());
252 if (
const var_diff* d = dynamic_cast<const var_diff*>(diff))
253 return crc_changed(d->first_var(), d->second_var());
264 template <
typename function_or_var_decl_sptr>
266 namespace_changed(
const function_or_var_decl_sptr& f,
267 const function_or_var_decl_sptr& s)
269 const auto& symbol_f = f->get_symbol();
270 const auto& symbol_s = s->get_symbol();
271 if (!symbol_f || !symbol_s)
273 return symbol_f->get_namespace() != symbol_s->get_namespace();
283 namespace_changed(
const diff* diff)
285 if (
const function_decl_diff* d =
286 dynamic_cast<const function_decl_diff*>(diff))
287 return namespace_changed(d->first_function_decl(),
288 d->second_function_decl());
289 if (
const var_diff* d = dynamic_cast<const var_diff*>(diff))
290 return namespace_changed(d->first_var(), d->second_var());
311 string fn = f->get_qualified_name(),
312 sn = s->get_qualified_name();
322 s && !s->is_main_symbol();
323 s = s->get_next_alias())
340 function_name_changed_but_not_symbol(
const diff* diff)
342 if (
const function_decl_diff* d =
343 dynamic_cast<const function_decl_diff*>(diff))
344 return function_name_changed_but_not_symbol(d->first_function_decl(),
345 d->second_function_decl());
359 data_member_offset_changed(decl_base_sptr f, decl_base_sptr s)
366 v1 = dynamic_pointer_cast<var_decl>(s);
383 non_static_data_member_type_size_changed(
const decl_base_sptr& f,
384 const decl_base_sptr& s)
391 sv = dynamic_pointer_cast<var_decl>(s);
398 return type_size_changed(fv->get_type(), sv->get_type());
408 static_data_member_type_size_changed(
const decl_base_sptr& f,
409 const decl_base_sptr& s)
416 sv = dynamic_pointer_cast<var_decl>(s);
423 return type_size_changed(fv->get_type(), sv->get_type());
434 is_compatible_change(
const decl_base_sptr& d1,
const decl_base_sptr& d2)
451 decl_name_changed(
const type_or_decl_base* a1,
const type_or_decl_base *a2)
453 string d1_name, d2_name;
455 const decl_base *d1 =
dynamic_cast<const decl_base*
>(a1);
459 const decl_base *d2 =
dynamic_cast<const decl_base*
>(a2);
464 d1_name = d1->get_qualified_name();
466 d2_name = d2->get_qualified_name();
468 return d1_name != d2_name;
481 {
return decl_name_changed(d1.get(), d2.get());}
491 decl_name_changed(
const diff *d)
492 {
return decl_name_changed(d->first_subject(), d->second_subject());}
508 return (decl_name_changed(f, s)
511 (f->get_is_anonymous() && s->get_is_anonymous())
515 ((f->get_is_anonymous_or_has_anonymous_parent()
516 && s->get_is_anonymous_or_has_anonymous_parent())
518 s->get_qualified_name()))
583 non_static_data_member_added_or_removed(
const class_diff* diff)
585 if (diff && !diff_involves_decl_only_class(diff))
587 for (string_decl_base_sptr_map::const_iterator i =
594 for (string_decl_base_sptr_map::const_iterator i =
611 non_static_data_member_added_or_removed(
const diff* diff)
613 return non_static_data_member_added_or_removed
614 (dynamic_cast<const class_diff*>(diff));
668 if (fat->get_subranges().size() != 1
669 || sat->get_subranges().size() != 1
670 || (!fat->is_infinite() && !sat->is_infinite()))
679 if (!var1->get_symbol()
680 || !var2->get_symbol()
681 || var1->get_symbol()->get_size() != var2->get_symbol()->get_size())
722 static_data_member_added_or_removed(
const class_diff* diff)
724 if (diff && !diff_involves_decl_only_class(diff))
726 for (string_decl_base_sptr_map::const_iterator i =
733 for (string_decl_base_sptr_map::const_iterator i =
769 class_diff_has_harmless_odr_violation_change(
const diff* dif)
771 class_diff* d =
dynamic_cast<class_diff*
>(
const_cast<diff*
>(dif));
772 if (!d || !d->has_changes())
778 if (first->get_qualified_name() == second->get_qualified_name()
780 && first->get_corpus() == second->get_corpus())
794 static_data_member_added_or_removed(
const diff* diff)
796 return static_data_member_added_or_removed
797 (dynamic_cast<const class_diff*>(diff));
811 has_virtual_mem_fn_change(
const class_diff* diff)
813 if (!diff || diff_involves_decl_only_class(diff))
816 for (string_member_function_sptr_map::const_iterator i =
817 diff->deleted_member_fns().begin();
818 i != diff->deleted_member_fns().end();
826 string_member_function_sptr_map::const_iterator j =
827 diff->inserted_member_fns().find(i->first);
828 if (j != diff->inserted_member_fns().end()
837 for (string_member_function_sptr_map::const_iterator i =
838 diff->inserted_member_fns().begin();
839 i != diff->inserted_member_fns().end();
847 string_member_function_sptr_map::const_iterator j =
848 diff->deleted_member_fns().find(i->first);
849 if (j != diff->deleted_member_fns().end()
858 for (function_decl_diff_sptrs_type::const_iterator i =
859 diff->changed_member_fns().begin();
860 i != diff->changed_member_fns().end();
901 if (ff_is_virtual != sf_is_virtual)
907 if (ff_vtable_offset != sf_vtable_offset)
924 has_virtual_mem_fn_change(
const diff* diff)
926 return (has_virtual_mem_fn_change(dynamic_cast<const class_diff*>(diff))
927 || has_virtual_mem_fn_change(dynamic_cast<const function_decl_diff*>(diff)));
938 has_non_virtual_mem_fn_change(
const class_diff* diff)
940 if (!diff || diff_involves_decl_only_class(diff))
943 for (string_member_function_sptr_map::const_iterator i =
950 for (string_member_function_sptr_map::const_iterator i =
957 for (function_decl_diff_sptrs_type::const_iterator i =
976 has_non_virtual_mem_fn_change(
const diff* diff)
977 {
return has_non_virtual_mem_fn_change(dynamic_cast<const class_diff*>(diff));}
985 base_classes_added_or_removed(
const class_diff* diff)
989 return diff->deleted_bases().size() || diff->inserted_bases().size();
998 base_classes_added_or_removed(
const diff* diff)
999 {
return base_classes_added_or_removed(dynamic_cast<const class_diff*>(diff));}
1028 return f_is_empty && s_is_empty;
1047 const class_or_union_sptr& second)
1049 if (!first || !second)
1078 class_or_union_sptr f =
1080 class_or_union_sptr s =
1097 const decl_base_sptr& second)
1099 if (!first || !second)
1107 if (f->get_qualified_name() != s->get_qualified_name())
1110 return f->get_is_declaration_only() != s->get_is_declaration_only();
1148 const class_or_union_sptr& second)
1150 if (!first || !second)
1153 class_or_union_sptr f =
1155 class_or_union_sptr s =
1158 if (f->get_qualified_name() != s->get_qualified_name())
1161 return f->get_is_declaration_only() != s->get_is_declaration_only();
1177 if (!first || !second)
1183 if (f->get_qualified_name() != s->get_qualified_name())
1186 return f->get_is_declaration_only() != s->get_is_declaration_only();
1205 class_or_union_sptr f =
1207 class_or_union_sptr s =
1244 if (decl_name_changed(dif))
1260 if (decl_name_changed(dif))
1362 has_enumerator_insertion(
const diff* diff)
1364 if (
const enum_diff* d = dynamic_cast<const enum_diff*>(diff))
1365 return !d->inserted_enumerators().empty();
1375 has_enumerator_removal_or_change(
const diff* diff)
1377 if (
const enum_diff* d = dynamic_cast<const enum_diff*>(diff))
1378 return (!d->deleted_enumerators().empty()
1379 || !d->changed_enumerators().empty());
1389 has_harmful_enum_change(
const diff* diff)
1391 if (
const enum_diff* d = dynamic_cast<const enum_diff*>(diff))
1392 return (has_enumerator_removal_or_change(d)
1393 || has_type_size_change(d));
1407 has_harmless_enum_to_int_change(
const diff* diff)
1416 const enum_type_decl *enum_type = 0;
1417 const type_base *integer_type = 0;
1419 type_base *first_type =
1421 type_base *second_type =
1424 if (
const enum_type_decl *e =
is_enum_type(first_type))
1426 else if (
const enum_type_decl *e =
is_enum_type(second_type))
1431 else if (
const type_base *i =
is_type_decl(second_type))
1436 && enum_type->get_size_in_bits() == integer_type->get_size_in_bits())
1452 has_fn_parm_type_top_cv_qual_change(
const diff* diff)
1457 if (!parm_diff || !parm_diff->has_changes())
1465 type_base_sptr first_parm_type = first_parm->get_type();
1466 type_base_sptr second_parm_type = second_parm->get_type();
1475 type_base_sptr peeled_type_1 = first_parm_type;
1476 type_base_sptr peeled_type_2 = second_parm_type;
1480 cv_quals_1 = qtype1->get_cv_quals();
1486 cv_quals_2 = qtype2->get_cv_quals();
1493 && cv_quals_1 != cv_quals_2)
1509 type_diff_has_cv_qual_change_only(
const diff *type_dif)
1519 const type_base *f = 0;
1520 const type_base *s = 0;
1527 f =
is_type(d->first()).
get();
1528 s =
is_type(d->second()).
get();
1533 f =
is_type(d->first_qualified_type()).
get();
1534 s =
is_type(d->second_qualified_type()).
get();
1563 has_fn_parm_type_cv_qual_change(
const diff* dif)
1568 if (!parm_diff || !parm_diff->has_changes())
1573 const diff *type_dif = parm_diff->type_diff().get();
1574 return type_diff_has_cv_qual_change_only(type_dif);
1587 has_fn_return_type_cv_qual_change(
const diff* dif)
1592 fn_type_diff = fn_decl_diff->type_diff().get();
1597 const diff* return_type_diff = fn_type_diff->return_type_diff().get();
1598 return type_diff_has_cv_qual_change_only(return_type_diff);
1611 has_added_or_removed_function_parameters(
const diff *dif)
1616 fn_type_diff = fn_decl_diff->type_diff().get();
1621 if (!(fn_type_diff->sorted_deleted_parms().empty()
1622 && fn_type_diff->sorted_added_parms().empty()))
1636 has_var_type_cv_qual_change(
const diff* dif)
1642 diff *type_dif = var_dif->type_diff().get();
1646 return type_diff_has_cv_qual_change_only(type_dif);
1658 has_void_ptr_to_ptr_change(
const diff* dif)
1664 const type_base *f =
is_type(d->first().get());
1665 const type_base *s =
is_type(d->second().get());
1678 const type_base *f =
is_type(d->first_pointer()).
get();
1679 const type_base *s =
is_type(d->second_pointer()).
get();
1692 const type_base *f =
is_type(d->first_qualified_type()).
get();
1693 const type_base *s =
is_type(d->second_qualified_type()).
get();
1721 has_benign_array_of_unknown_size_change(
const diff* dif)
1738 && !has_type_size_change(d))
1755 categorize_harmless_diff_node(diff *d,
bool pre)
1771 if (access_changed(f, s))
1774 if (is_compatible_change(f, s))
1778 || class_diff_has_harmless_odr_violation_change(d))
1784 if (has_non_virtual_mem_fn_change(d))
1787 if (static_data_member_added_or_removed(d)
1788 || static_data_member_type_size_changed(f, s))
1794 if ((has_enumerator_insertion(d)
1795 && !has_harmful_enum_change(d))
1796 || has_harmless_enum_to_int_change(d))
1799 if (function_name_changed_but_not_symbol(d))
1802 if (has_fn_parm_type_top_cv_qual_change(d))
1805 if (has_fn_parm_type_cv_qual_change(d))
1808 if (has_fn_return_type_cv_qual_change(d))
1811 if (has_var_type_cv_qual_change(d))
1814 if (has_void_ptr_to_ptr_change(d))
1817 if (has_benign_array_of_unknown_size_change(d))
1825 canonical->add_to_local_and_inherited_categories(category);
1843 categorize_harmful_diff_node(diff *d,
bool pre)
1845 if (!d->has_changes())
1851 decl_base_sptr f =
is_decl(d->first_subject()),
1852 s =
is_decl(d->second_subject());
1860 && (type_size_changed(f, s)
1861 || data_member_offset_changed(f, s)
1862 || non_static_data_member_type_size_changed(f, s)
1863 || non_static_data_member_added_or_removed(d)
1864 || base_classes_added_or_removed(d)
1865 || has_harmful_enum_change(d)
1867 || namespace_changed(d)))
1870 if (has_virtual_mem_fn_change(d))
1873 if (has_added_or_removed_function_parameters(d))
1878 d->add_to_local_and_inherited_categories(category);
1880 if (diff * canonical = d->get_canonical_diff())
1881 canonical->add_to_local_and_inherited_categories(category);
1898 harmless_harmful_filter::visit(diff* d,
bool pre)
1900 return (categorize_harmless_diff_node(d, pre)
1901 && categorize_harmful_diff_node(d, pre));
1914 harmless_harmful_filter::visit_end(diff* d)
1916 if (d->context()->diff_has_been_visited(d))
1927 if (diff* c = d->get_canonical_diff())
1928 d->add_to_local_and_inherited_categories(c->get_local_category());
const string_decl_base_sptr_map & inserted_data_members() const
Getter for the data members that got inserted.
bool is_type(const type_or_decl_base &tod)
Test whether a declaration is a type.
bool get_member_function_is_virtual(const function_decl &f)
Test if a given member function is virtual.
This means the diff node (or at least one of its descendant nodes) carries a change involving two com...
const string_member_function_sptr_map & deleted_member_fns() const
This header declares filters for the diff trees resulting from comparing ABI Corpora.
const pointer_diff * is_pointer_diff(const diff *diff)
Test if a diff node is about differences between two pointers.
class_decl_sptr is_compatible_with_class_type(const type_base_sptr &t)
Test if a type is a class. This function looks through typedefs.
const function_decl_sptr first_function_decl() const
const type_decl * is_type_decl(const type_or_decl_base *t)
Test whether a type is a type_decl (a builtin type).
var_decl_sptr first_var() const
Getter for the first var_decl of the diff.
bool is_data_member(const var_decl &v)
Test if a var_decl is a data member.
An abstraction of a diff between entities that are of a different kind (disctinct).
const qualified_type_diff * is_qualified_type_diff(const diff *diff)
Test if a diff node is about differences between two qualified types.
bool is_member_function(const function_decl &f)
Test whether a function_decl is a member function.
A diff node in this category is a function (or function type) with at least one parameter added or re...
This means the diff node (or at least one of its descendant nodes) carries a change that modifies the...
This type abstracts changes for a class_decl.
access_specifier get_member_access_specifier(const decl_base &d)
Gets the access specifier for a class member.
type_or_decl_base_sptr first_subject() const
Getter of the first subject of the diff.
This means the diff node does not carry any (meaningful) change, or that it carries changes that have...
ssize_t get_member_function_vtable_offset(const function_decl &f)
Get the vtable offset of a member function.
const var_diff * is_var_diff(const diff *diff)
Test if a diff node is about differences between variables.
This means that a diff node in the sub-tree carries an addition of enumerator to an enum type...
bool is_mostly_distinct_diff(const diff *d)
Test if a diff node carries a distinct type change or a pointer/reference/typedef to distinct type ch...
const diff * peel_typedef_diff(const diff *dif)
If a diff node is about changes between two typedef types, get the diff node about changes between th...
This means the diff node (or at least one of its descendant nodes) carries access related changes...
A diff node in this category carries a change from void pointer to non-void pointer.
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
class_or_union_sptr first_class_or_union() const
bool is_member_decl(const decl_base_sptr d)
Tests if a declaration is a class member.
bool has_decl_only_def_change(const decl_base_sptr &first, const decl_base_sptr &second)
Test if two decl_base_sptr are different just by the fact that one is decl-only and the other one is ...
bool enum_has_non_name_change(const enum_type_decl &l, const enum_type_decl &r, change_kind *k)
Test if two enums differ, but not by a name change.
const fn_parm_diff * is_fn_parm_diff(const diff *diff)
Test if a diff node is about differences between two function parameters.
const type_decl_diff * is_diff_of_basic_type(const diff *d)
Test if a diff node represents a diff between two basic types.
Abstraction of a diff between two function_decl.
A diff node in this category is a function parameter type which top cv-qualifiers change...
This means that a diff node in the sub-tree carries an incompatible change to a vtable.
const enum_type_decl_sptr first_enum() const
Abstraction of a diff between two enums.
enum_type_decl_sptr is_compatible_with_enum_type(const type_base_sptr &t)
Test if a type is an enum. This function looks through typedefs.
The base class of diff between types.
Abstraction of a diff between two basic type declarations.
const function_decl_sptr second_function_decl() const
bool has_anonymous_data_member_change(const diff *d)
Test if a diff node carries a non-anonymous data member to anonymous data member change, or vice-versa.
var_decl * is_var_decl(const type_or_decl_base *tod)
Tests if a declaration is a variable declaration.
This is the base class of class_diff and union_diff.
const string_decl_base_sptr_map & deleted_data_members() const
Getter for the data members that got deleted.
typedef_decl_sptr is_typedef(const type_or_decl_base_sptr t)
Test whether a type is a typedef.
class_or_union_sptr second_class_or_union() const
uint64_t get_data_member_offset(const var_decl &m)
Get the offset of a data member.
bool get_is_declaration_only() const
Test if a decl_base is a declaration-only decl.
diff_category
An enum for the different categories that a diff tree node falls into, regarding the kind of changes ...
Toplevel namespace for libabigail.
const diff * peel_typedef_or_qualified_type_diff(const diff *dif)
If a diff node is about changes between two typedefs or qualified types, get the diff node about chan...
bool has_harmless_name_change(const decl_base_sptr &f, const decl_base_sptr &s)
Test if two decls represents a harmless name change.
bool has_basic_type_name_change(const diff *d)
Test if a diff node carries a basic type name change.
shared_ptr< function_decl > function_decl_sptr
Convenience typedef for a shared pointer on a function_decl.
decl_base * is_decl(const type_or_decl_base *d)
Test if an ABI artifact is a declaration.
bool has_harmful_name_change(const decl_base_sptr &f, const decl_base_sptr &s)
Test if two decls represents a harmful name change.
const enum_type_decl * is_enum_type(const type_or_decl_base *d)
Test if a decl is an enum_type_decl.
virtual size_t get_size_in_bits() const
Getter for the size of the type.
shared_ptr< parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
var_decl_sptr second_var() const
Getter for the second var_decl of the diff.
Abstraction of a diff between two function parameters.
This means that a diff node in the sub-tree carries a harmless union change.
This means that a diff node in the sub-tree carries a harmless declaration name change. This is set only for name changes for data members and typedefs.
This means that a diff node in the sub-tree carries a harmless data member change. An example of harmless data member change is an anonymous data member that replaces a given data member without locally changing the layout.
bool has_class_decl_only_def_change(const class_or_union_sptr &first, const class_or_union_sptr &second)
Test if two class_or_union_sptr are different just by the fact that one is decl-only and the other on...
bool has_data_member_replaced_by_anon_dm(const diff *diff)
Test if a class_or_union_diff has a data member replaced by an anonymous data member in a harmless wa...
The base type of class_decl and union_decl.
This means that a diff node in the sub-tree carries a type that was declaration-only and that is now ...
const type_base * peel_qualified_type(const type_base *type)
Return the leaf underlying type of a qualified type.
diff * get_canonical_diff() const
Getter for the canonical diff of the current instance of diff.
bool var_equals_modulo_types(const var_decl &l, const var_decl &r, change_kind *k)
Compares two instances of var_decl without taking their type into account.
shared_ptr< type_or_decl_base > type_or_decl_base_sptr
A convenience typedef for a shared_ptr to type_or_decl_base.
void apply_filter(filter_base &filter, corpus_diff_sptr d)
Walk the diff sub-trees of a a corpus_diff and apply a filter to the nodes visted. The filter categorizes each node, assigning it into one or several categories.
const function_decl_diff * is_function_decl_diff(const diff *diff)
Test if a diff node is about differences between functions.
decl_base_sptr look_through_decl_only(const decl_base &d)
If a decl is decl-only get its definition. Otherwise, just return nil.
A diff node in this category is for a variable which type holds a cv-qualifier change.
shared_ptr< elf_symbol > elf_symbol_sptr
A convenience typedef for a shared pointer to elf_symbol.
#define ABG_ASSERT(cond)
This is a wrapper around the 'assert' glibc call. It allows for its argument to have side effects...
bool union_diff_has_harmless_changes(const diff *d)
Test if a union diff node does have changes that don't impact its size.
A diff node in this category has a function parameter type with a cv-qualifiers change.
type_base * peel_qualified_or_typedef_type(const type_base *type)
Return the leaf underlying type of a qualified or typedef type.
enum_type_decl_sptr look_through_decl_only_enum(const enum_type_decl &the_enum)
If an enum is a decl-only enum, get its definition. Otherwise, just return the initial enum...
const type_base_sptr get_type() const
Getter of the type of the variable.
const string_member_function_sptr_map & inserted_member_fns() const
diff_sptr type_diff() const
Getter for the diff representing the changes on the type of the function parameter involved in the cu...
array_type_def * is_array_type(const type_or_decl_base *type)
Test if a type is an array_type_def.
shared_ptr< enum_type_decl > enum_type_decl_sptr
Convenience typedef for shared pointer to a enum_type_decl.
shared_ptr< class_decl > class_decl_sptr
Convenience typedef for a shared pointer on a class_decl.
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Compute the qualified name of the decl.
interned_string get_type_name(const type_base_sptr &t, bool qualified, bool internal)
Get the name of a given type and return a copy of it.
qualified_type_def * is_qualified_type(const type_or_decl_base *t)
Test whether a type is a reference_type_def.
static bool entities_are_of_distinct_kinds(type_or_decl_base_sptr first, type_or_decl_base_sptr second)
Test if the two arguments are of different kind, or that are both NULL.
const string_decl_base_sptr_map & data_members_replaced_by_adms() const
Get the map of data members that got replaced by anonymous data members.
Abstracts a diff between two instances of var_decl.
bool get_member_is_static(const decl_base &d)
Gets a flag saying if a class member is static or not.
const class_or_union_diff * is_class_or_union_diff(const diff *d)
Test if a diff node is a class_or_union_diff node.
This means that a diff node in the sub-tree carries an addition or removal of a non-virtual member fu...
const reference_diff * is_reference_diff(const diff *diff)
Test if a diff node is about differences between two references.
This means that a diff node in the sub-tree carries an a symbol alias change that is harmless...
const diff * peel_reference_diff(const diff *dif)
If a diff node is about changes between two reference types, get the diff node about changes between ...
type_base_sptr peel_typedef_pointer_or_reference_type(const type_base_sptr type)
Return the leaf underlying or pointed-to type node of a typedef_decl, pointer_type_def, reference_type_def, or array_type_def node.
const type_diff_base * is_type_diff(const diff *diff)
Test if a diff node is about differences between types.
shared_ptr< corpus_diff > corpus_diff_sptr
A convenience typedef for a shared pointer to corpus_diff.
bool types_are_compatible(const type_base_sptr type1, const type_base_sptr type2)
Test if two types are equal modulo a typedef.
class_or_union * look_through_decl_only_class(class_or_union *the_class)
If a class (or union) is a decl-only class, get its definition. Otherwise, just return the initial cl...
const data_members & get_data_members() const
Get the data members of this class_or_union.
const class_or_union_diff * is_diff_of_class_or_union_type(const diff *d)
Test if a diff node represents a diff between two class or union types.
bool is_anonymous_data_member(const decl_base &d)
Test if a decl is an anonymous data member.
access_specifier
Access specifier for class members.
void add_to_local_and_inherited_categories(diff_category c)
Adds the current diff tree node to the categories resulting from the local and inherited changes of t...
const function_type_diff * is_function_type_diff(const diff *diff)
Test if a diff node is a function_type_diff node.
const function_decl_diff_sptrs_type & changed_member_fns() const
Getter for the virtual members functions that have had a change in a sub-type, without having a chang...
virtual bool has_changes() const =0
Pure interface to get the length of the changes encapsulated by this diff. A length of zero means tha...
A diff node in this category carries a change in the size of the array type of a global variable...
bool has_class_or_union_type_name_change(const diff *d)
Test if a diff node carries a class or union type name change.
bool is_var_1_dim_unknown_size_array_change(const var_decl_sptr &var1, const var_decl_sptr &var2)
Test if we are looking at two variables which types are both one dimension array, with one of them be...
The base class for the diff tree node filter.
type_or_decl_base_sptr second_subject() const
Getter of the second subject of the diff.
bool has_basic_or_class_type_name_change(const diff *d)
Test if a diff node carries a basic or class type name change.
const union_diff * is_union_diff(const diff *diff)
Test if a diff node is a union_diff node.
pointer_type_def * is_pointer_type(type_or_decl_base *t)
Test whether a type is a pointer_type_def.
A diff node in this category is a function return type with a cv-qualifier change.
shared_ptr< diff > diff_sptr
Convenience typedef for a shared_ptr for the diff class.
bool has_enum_decl_only_def_change(const enum_type_decl_sptr &first, const enum_type_decl_sptr &second)
Test if two enum_sptr are different just by the fact that one is decl-only and the other one is defin...
const distinct_diff * is_distinct_diff(const diff *diff)
Test if a diff node is about differences between two diff nodes of different kinds.
const diff * peel_pointer_diff(const diff *dif)
If a diff node is about changes between two pointer types, get the diff node about changes between th...
shared_ptr< array_type_def > array_type_def_sptr
Convenience typedef for a shared pointer on a array_type_def.
bool equals_modulo_cv_qualifier(const array_type_def *l, const array_type_def *r)
Test if two variables are equals modulo CV qualifiers.
bool is_decl_only_class_with_size_change(const class_or_union &first, const class_or_union &second)
Test if two classes that are decl-only (have the decl-only flag and carry no data members) but are di...
shared_ptr< filter_base > filter_base_sptr
Convenience typedef for a shared pointer to filter_base.
const type_base * is_void_pointer_type_equivalent(const type_base *type)
Test if a type is equivalent to a pointer to void type.
const enum_type_decl_sptr second_enum() const
CV
Bit field values representing the cv qualifiers of the underlying type.
This means that a diff node in the sub-tree carries an addition or removal of a static data member...