13#include "abg-internal.h"
16ABG_BEGIN_EXPORT_DECLARATIONS
22ABG_END_EXPORT_DECLARATIONS
37type_diff_has_cv_qual_change_only(
const diff *type_dif);
40type_diff_has_cv_qual_change_only(
const type_base_sptr& f,
41 const type_base_sptr& s);
43using std::dynamic_pointer_cast;
55 bool s = d->context()->visiting_a_node_twice_is_forbidden();
56 d->context()->forbid_visiting_a_node_twice(
true);
58 d->context()->forbid_visiting_a_node_twice(s);
76 bool s = d->context()->visiting_a_node_twice_is_forbidden();
77 d->context()->forbid_visiting_a_node_twice(
true);
78 d->context()->forget_visited_diffs();
80 d->context()->forbid_visiting_a_node_twice(s);
112 if ((class1 && class1->get_is_declaration_only())
113 || (class2 && class2->get_is_declaration_only()))
131 if ((enum1 && enum1->get_is_declaration_only())
132 || (enum2 && enum2->get_is_declaration_only()))
145 if (
diff && there_is_a_decl_only_class(
diff->first_class_decl(),
146 diff->second_class_decl()))
159type_size_changed(
const type_base_sptr f,
const type_base_sptr s)
162 || f->get_size_in_bits() == 0
163 || s->get_size_in_bits() == 0
170 return f->get_size_in_bits() != s->get_size_in_bits();
185type_has_offset_changes(
const type_base_sptr f,
const type_base_sptr s)
192 if (!first || !second)
201 if (has_offset_changes(f_data_members, s_data_members))
219type_has_offset_changes(
const decl_base_sptr f,
const decl_base_sptr s)
232type_size_changed(
const decl_base_sptr f,
const decl_base_sptr s)
241has_type_size_change(
const diff* diff)
247 diff = fn_parm_d->type_diff().get();
249 type_base_sptr f =
is_type(diff->first_subject()),
250 s =
is_type(diff->second_subject());
255 return type_size_changed(f, s);
270 for (
auto e : data_members)
298 for (
auto entry : f_data_members)
303 auto i = s_data_members.find(entry.first);
305 if (i == s_data_members.end())
307 s_member = find_data_member_at_offset(s_data_members, f_offset);
318 if (f_offset != s_offset)
339class_diff_has_only_harmless_changes(
const class_diff* d)
341 if (!d || !d->has_changes())
346 if (f->get_qualified_name() != s->get_qualified_name())
349 if (f->get_size_in_bits() != s->get_size_in_bits())
358 if (has_offset_changes(f_data_members, s_data_members))
378class_diff_has_only_harmless_changes(diff* d)
381 return class_diff_has_only_harmless_changes(class_dif);
395access_changed(
const decl_base_sptr& f,
const decl_base_sptr& s)
417template <
typename function_or_var_decl_sptr>
419crc_changed(
const function_or_var_decl_sptr& f,
420 const function_or_var_decl_sptr& s)
422 const auto& symbol_f = f->get_symbol();
423 const auto& symbol_s = s->get_symbol();
424 if (!symbol_f || !symbol_s)
426 return symbol_f->get_crc() != symbol_s->get_crc();
436crc_changed(
const diff* diff)
438 if (
const function_decl_diff* d =
439 dynamic_cast<const function_decl_diff*
>(diff))
440 return crc_changed(d->first_function_decl(), d->second_function_decl());
441 if (
const var_diff* d =
dynamic_cast<const var_diff*
>(diff))
442 return crc_changed(d->first_var(), d->second_var());
453template <
typename function_or_var_decl_sptr>
455namespace_changed(
const function_or_var_decl_sptr& f,
456 const function_or_var_decl_sptr& s)
458 const auto& symbol_f = f->get_symbol();
459 const auto& symbol_s = s->get_symbol();
460 if (!symbol_f || !symbol_s)
462 return symbol_f->get_namespace() != symbol_s->get_namespace();
472namespace_changed(
const diff* diff)
474 if (
const function_decl_diff* d =
475 dynamic_cast<const function_decl_diff*
>(diff))
476 return namespace_changed(d->first_function_decl(),
477 d->second_function_decl());
478 if (
const var_diff* d =
dynamic_cast<const var_diff*
>(diff))
479 return namespace_changed(d->first_var(), d->second_var());
500 string fn = f->get_qualified_name(),
501 sn = s->get_qualified_name();
511 s && !s->is_main_symbol();
512 s = s->get_next_alias())
529function_name_changed_but_not_symbol(
const diff* diff)
531 if (
const function_decl_diff* d =
532 dynamic_cast<const function_decl_diff*
>(diff))
533 return function_name_changed_but_not_symbol(d->first_function_decl(),
534 d->second_function_decl());
548data_member_offset_changed(decl_base_sptr f, decl_base_sptr s)
555 v1 = dynamic_pointer_cast<var_decl>(s);
572non_static_data_member_type_size_changed(
const decl_base_sptr& f,
573 const decl_base_sptr& s)
580 sv = dynamic_pointer_cast<var_decl>(s);
587 return type_size_changed(fv->get_type(), sv->get_type());
597static_data_member_type_size_changed(
const decl_base_sptr& f,
598 const decl_base_sptr& s)
605 sv = dynamic_pointer_cast<var_decl>(s);
612 return type_size_changed(fv->get_type(), sv->get_type());
623is_compatible_change(
const decl_base_sptr& d1,
const decl_base_sptr& d2)
644is_non_compatible_distinct_change(
const diff *d)
648 if (dd->compatible_child_diff()
649 || type_diff_has_cv_qual_change_only(d)
650 || (!dd->first_subject() || !dd->second_subject()))
671decl_name_changed(
const type_or_decl_base* a1,
const type_or_decl_base *a2)
673 string d1_name, d2_name;
675 const decl_base *d1 =
dynamic_cast<const decl_base*
>(a1);
679 const decl_base *d2 =
dynamic_cast<const decl_base*
>(a2);
684 d1_name = d1->get_qualified_name();
686 d2_name = d2->get_qualified_name();
688 return d1_name != d2_name;
699decl_name_changed(
const type_or_decl_base_sptr& d1,
700 const type_or_decl_base_sptr& d2)
701{
return decl_name_changed(d1.get(), d2.get());}
711decl_name_changed(
const diff *d)
712{
return decl_name_changed(d->first_subject(), d->second_subject());}
721integral_type_has_harmless_name_change(
const decl_base_sptr& f,
722 const decl_base_sptr& s)
726 && decl_name_changed(f, s)
727 && (
is_type(f)->get_size_in_bits()
728 ==
is_type(s)->get_size_in_bits())
729 && (
is_type(f)->get_alignment_in_bits()
730 ==
is_type(s)->get_alignment_in_bits()))
738 if (fi.get_base_type() == si.get_base_type()
739 && fi.get_modifiers() != si.get_modifiers())
764 return (decl_name_changed(f, s)
767 (f->get_is_anonymous() && s->get_is_anonymous())
771 ((f->get_is_anonymous_or_has_anonymous_parent()
772 && s->get_is_anonymous_or_has_anonymous_parent())
774 s->get_qualified_name()))
801 || integral_type_has_harmless_name_change(f, s)));
849 if (
diff && !diff_involves_decl_only_class(
diff))
851 for (string_decl_base_sptr_map::const_iterator i =
852 diff->inserted_data_members().begin();
853 i !=
diff->inserted_data_members().end();
858 for (string_decl_base_sptr_map::const_iterator i =
859 diff->deleted_data_members().begin();
860 i !=
diff->deleted_data_members().end();
875non_static_data_member_added_or_removed(
const diff* diff)
877 return non_static_data_member_added_or_removed
878 (
dynamic_cast<const class_diff*
>(diff));
932 if (fat->get_subranges().size() != 1
933 || sat->get_subranges().size() != 1
934 || (!fat->is_non_finite() && !sat->is_non_finite()))
943 if (!var1->get_symbol()
944 || !var2->get_symbol()
945 || var1->get_symbol()->get_size() != var2->get_symbol()->get_size())
1057 if (
diff && !diff_involves_decl_only_class(
diff))
1059 for (string_decl_base_sptr_map::const_iterator i =
1060 diff->inserted_data_members().begin();
1061 i !=
diff->inserted_data_members().end();
1066 for (string_decl_base_sptr_map::const_iterator i =
1067 diff->deleted_data_members().begin();
1068 i !=
diff->deleted_data_members().end();
1102class_diff_has_harmless_odr_violation_change(
const diff* dif)
1104 class_diff* d =
dynamic_cast<class_diff*
>(
const_cast<diff*
>(dif));
1105 if (!d || !d->has_changes())
1111 if (first->get_qualified_name() == second->get_qualified_name()
1113 && first->get_corpus() == second->get_corpus())
1127static_data_member_added_or_removed(
const diff* diff)
1129 return static_data_member_added_or_removed
1130 (
dynamic_cast<const class_diff*
>(diff));
1144has_virtual_mem_fn_change(
const class_diff* diff)
1146 if (!diff || diff_involves_decl_only_class(diff))
1149 for (string_member_function_sptr_map::const_iterator i =
1150 diff->deleted_member_fns().begin();
1151 i != diff->deleted_member_fns().end();
1159 string_member_function_sptr_map::const_iterator j =
1160 diff->inserted_member_fns().find(i->first);
1161 if (j != diff->inserted_member_fns().end()
1170 for (string_member_function_sptr_map::const_iterator i =
1171 diff->inserted_member_fns().begin();
1172 i != diff->inserted_member_fns().end();
1180 string_member_function_sptr_map::const_iterator j =
1181 diff->deleted_member_fns().find(i->first);
1182 if (j != diff->deleted_member_fns().end()
1191 for (function_decl_diff_sptrs_type::const_iterator i =
1192 diff->changed_member_fns().begin();
1193 i != diff->changed_member_fns().end();
1225 sf =
diff->second_function_decl();
1234 if (ff_is_virtual != sf_is_virtual)
1240 if (ff_vtable_offset != sf_vtable_offset)
1257has_virtual_mem_fn_change(
const diff*
diff)
1259 return (has_virtual_mem_fn_change(
dynamic_cast<const class_diff*
>(
diff))
1273 if (!
diff || diff_involves_decl_only_class(
diff))
1276 for (string_member_function_sptr_map::const_iterator i =
1277 diff->deleted_member_fns().begin();
1278 i !=
diff->deleted_member_fns().end();
1283 for (string_member_function_sptr_map::const_iterator i =
1284 diff->inserted_member_fns().begin();
1285 i !=
diff->inserted_member_fns().end();
1290 for (function_decl_diff_sptrs_type::const_iterator i =
1291 diff->changed_member_fns().begin();
1292 i !=
diff->changed_member_fns().end();
1309has_non_virtual_mem_fn_change(
const diff* diff)
1310{
return has_non_virtual_mem_fn_change(
dynamic_cast<const class_diff*
>(diff));}
1318base_classes_removed(
const class_diff* diff)
1322 return diff->deleted_bases().size();
1331base_classes_removed(
const diff* diff)
1332{
return base_classes_removed(
dynamic_cast<const class_diff*
>(diff));}
1361 return f_is_empty && s_is_empty;
1380 const class_or_union_sptr& second)
1382 if (!first || !second)
1411 class_or_union_sptr f =
1413 class_or_union_sptr s =
1430 const decl_base_sptr& second)
1432 if (!first || !second)
1440 if (f->get_qualified_name() != s->get_qualified_name())
1443 return f->get_is_declaration_only() != s->get_is_declaration_only();
1481 const class_or_union_sptr& second)
1483 if (!first || !second)
1486 class_or_union_sptr f =
1488 class_or_union_sptr s =
1491 if (f->get_qualified_name() != s->get_qualified_name())
1494 return f->get_is_declaration_only() != s->get_is_declaration_only();
1510 if (!first || !second)
1516 if (f->get_qualified_name() != s->get_qualified_name())
1519 return f->get_is_declaration_only() != s->get_is_declaration_only();
1538 class_or_union_sptr f =
1540 class_or_union_sptr s =
1577 if (decl_name_changed(dif))
1593 if (decl_name_changed(dif))
1695has_enumerator_insertion(
const diff*
diff)
1698 return !d->inserted_enumerators().empty();
1708has_enumerator_removal_or_change(
const diff*
diff)
1711 return (!d->deleted_enumerators().empty()
1712 || !d->changed_enumerators().empty());
1722has_harmful_enum_change(
const diff* diff)
1724 if (
const enum_diff* d =
dynamic_cast<const enum_diff*
>(diff))
1725 return (has_enumerator_removal_or_change(d)
1726 || has_type_size_change(d));
1785has_fn_parm_type_top_cv_qual_change(
const diff*
diff)
1798 type_base_sptr first_parm_type = first_parm->get_type();
1799 type_base_sptr second_parm_type = second_parm->get_type();
1808 type_base_sptr peeled_type_1 = first_parm_type;
1809 type_base_sptr peeled_type_2 = second_parm_type;
1813 cv_quals_1 = qtype1->get_cv_quals();
1819 cv_quals_2 = qtype2->get_cv_quals();
1826 && cv_quals_1 != cv_quals_2)
1842type_diff_has_cv_qual_change_only(
const diff *type_dif)
1847 type_base_sptr f =
is_type(type_dif->first_subject());
1848 type_base_sptr s =
is_type(type_dif->second_subject());
1850 return type_diff_has_cv_qual_change_only(f, s);
1861type_diff_has_cv_qual_change_only(
const type_base_sptr& f,
1862 const type_base_sptr& s)
1864 type_base_sptr a = f;
1865 type_base_sptr b = s;
1870 if (a && b && *a == *b)
1879 if (a && b && *a == *b)
1885 if (a && b && *a == *b)
1896 return (a && b && *a == *b);
1909has_fn_parm_type_cv_qual_change(
const diff* dif)
1914 if (!parm_diff || !parm_diff->has_changes())
1919 const diff *type_dif = parm_diff->type_diff().get();
1920 return type_diff_has_cv_qual_change_only(type_dif);
1933has_fn_return_type_cv_qual_change(
const diff* dif)
1938 fn_type_diff = fn_decl_diff->type_diff().get();
1943 const diff* return_type_diff = fn_type_diff->return_type_diff().get();
1944 return type_diff_has_cv_qual_change_only(return_type_diff);
1957has_added_or_removed_function_parameters(
const diff *dif)
1962 fn_type_diff = fn_decl_diff->type_diff().get();
1967 if (!(fn_type_diff->sorted_deleted_parms().empty()
1968 && fn_type_diff->sorted_added_parms().empty()))
1982has_var_type_cv_qual_change(
const diff* dif)
1988 diff *type_dif = var_dif->type_diff().get();
1992 return type_diff_has_cv_qual_change_only(type_dif);
2004is_void_ptr_to_ptr(
const type_base* f,
const type_base* s)
2009 && ((f->get_size_in_bits() == 0)
2010 || (f->get_size_in_bits() == s->get_size_in_bits())))
2037 if (is_void_ptr_to_ptr(f, s) || is_void_ptr_to_ptr(s, f))
2048 if (is_void_ptr_to_ptr(f, s) || is_void_ptr_to_ptr(s, f))
2059 if (is_void_ptr_to_ptr(f, s) || is_void_ptr_to_ptr(s, f))
2096 && !has_type_size_change(d))
2113categorize_harmless_diff_node(
diff *d,
bool pre)
2129 if (access_changed(f, s))
2132 if (is_compatible_change(f, s))
2136 || class_diff_has_harmless_odr_violation_change(d))
2140 || class_diff_has_only_harmless_changes(d))
2143 if (has_non_virtual_mem_fn_change(d))
2146 if (static_data_member_added_or_removed(d)
2147 || static_data_member_type_size_changed(f, s))
2153 if ((has_enumerator_insertion(d)
2154 && !has_harmful_enum_change(d))
2158 if (function_name_changed_but_not_symbol(d))
2161 if (has_fn_parm_type_top_cv_qual_change(d))
2164 if (has_fn_parm_type_cv_qual_change(d))
2167 if (has_fn_return_type_cv_qual_change(d))
2170 if (has_var_type_cv_qual_change(d))
2184 canonical->add_to_local_and_inherited_categories(category);
2202categorize_harmful_diff_node(diff *d,
bool pre)
2204 if (!d->has_changes())
2210 decl_base_sptr f =
is_decl(d->first_subject()),
2211 s =
is_decl(d->second_subject());
2219 && (type_size_changed(f, s)
2220 || type_has_offset_changes(f, s)
2221 || data_member_offset_changed(f, s)
2222 || non_static_data_member_type_size_changed(f, s)
2223 || non_static_data_member_added_or_removed(d)
2224 || base_classes_removed(d)
2225 || has_harmful_enum_change(d)
2227 || namespace_changed(d)))
2230 if (has_virtual_mem_fn_change(d))
2234 category |= REFERENCE_LVALUENESS_CHANGE_CATEGORY;
2236 if (has_added_or_removed_function_parameters(d))
2239 if (is_non_compatible_distinct_change(d))
2247 d->add_to_local_and_inherited_categories(category);
2249 if (diff * canonical = d->get_canonical_diff())
2250 canonical->add_to_local_and_inherited_categories(category);
2267harmless_harmful_filter::visit(diff* d,
bool pre)
2269 return (categorize_harmless_diff_node(d, pre)
2270 && categorize_harmful_diff_node(d, pre));
2283harmless_harmful_filter::visit_end(diff* d)
2285 if (d->context()->diff_has_been_visited(d))
2296 if (diff* c = d->get_canonical_diff())
2297 d->add_to_local_and_inherited_categories(c->get_local_category());
This header declares filters for the diff trees resulting from comparing ABI Corpora.
#define ABG_ASSERT(cond)
This is a wrapper around the 'assert' glibc call. It allows for its argument to have side effects,...
This contains the private implementation of the suppression engine of libabigail.
This type abstracts changes for a class_decl.
class_decl_sptr first_class_decl() const
class_decl_sptr second_class_decl() const
Getter of the second class involved in the diff.
This is the base class of class_diff and union_diff.
class_or_union_sptr first_class_or_union() const
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.
class_or_union_sptr second_class_or_union() const
The abstraction of a change between two ABI artifacts, a.k.a an artifact change.
type_or_decl_base_sptr second_subject() const
Getter of the second subject of the diff.
type_or_decl_base_sptr first_subject() const
Getter of the first subject of the diff.
diff * get_canonical_diff() const
Getter for the canonical diff of the current instance of diff.
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...
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...
An abstraction of a diff between entities that are of a different kind (disctinct).
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.
Abstraction of a diff between two enums.
const enum_type_decl_sptr first_enum() const
const enum_type_decl_sptr second_enum() const
Abstraction of a diff between two function parameters.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
const function_decl::parameter_sptr first_parameter() const
Getter for the first subject of this diff node.
const function_decl::parameter_sptr second_parameter() const
Getter for the second subject of this diff node.
diff_sptr type_diff() const
Getter for the diff representing the changes on the type of the function parameter involved in the cu...
Abstraction of a diff between two function_decl.
The abstraction of a diff between two pointers.
Abstraction of a diff between two qualified types.
The abstraction of a diff between two references.
reference_type_def_sptr first_reference() const
Getter for the first reference of the diff.
reference_type_def_sptr second_reference() const
Getter for the second reference of the diff.
Abstraction of a diff between two basic type declarations.
The base class of diff between types.
Abstracts a diff between two instances of var_decl.
var_decl_sptr first_var() const
Getter for the first var_decl of the diff.
var_decl_sptr second_var() const
Getter for the second var_decl of the diff.
bool empty() const
Test if the current instance of interned_string is empty.
The base type of class_decl and union_decl.
const data_members & get_data_members() const
Get the data members of this class_or_union.
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Compute the qualified name of the decl.
virtual const interned_string & get_name() const
Getter for the name of the current decl.
bool get_is_declaration_only() const
Test if a decl_base is a declaration-only decl.
Abstracts a declaration for an enum type.
shared_ptr< parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
CV
Bit field values representing the cv qualifiers of the underlying type.
An abstraction helper for type declarations.
virtual size_t get_size_in_bits() const
Getter for the size of the type.
bool has_void_ptr_to_ptr_change(const diff *dif)
Test if a diff node carries a void* to pointer type change.
bool has_basic_type_name_change(const diff *d)
Test if a diff node carries a basic type name change.
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...
bool has_harmless_enum_to_int_change(const diff *diff)
Test if a diff node carries a harmless change of an enum into an integer (or vice-versa).
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...
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 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...
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.
bool has_harmful_name_change(const decl_base_sptr &f, const decl_base_sptr &s)
Test if two decls represents a harmful name change.
bool has_benign_array_of_unknown_size_change(const diff *dif)
Test if a diff node carries a benign change to the size of a variable of type array.
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 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 has_basic_or_class_type_name_change(const diff *d)
Test if a diff node carries a basic or class type name change.
bool has_lvalue_reference_ness_change(const diff *dif)
Test if a diff node carries a change where an lvalue reference changed into a rvalue reference,...
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,...
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....
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...
bool union_diff_has_harmless_changes(const diff *d)
Test if a union diff node does have changes that don't impact its size.
bool has_strict_fam_conversion(const class_decl_sptr &first, const class_decl_sptr &second)
Test if a class with a fake flexible data member got changed into a class with a real fexible data me...
shared_ptr< diff > diff_sptr
Convenience typedef for a shared_ptr for the diff class.
diff_category
An enum for the different categories that a diff tree node falls into, regarding the kind of changes ...
@ ACCESS_CHANGE_CATEGORY
This means the diff node (or at least one of its descendant nodes) carries access related changes,...
@ HARMLESS_DATA_MEMBER_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless data member change....
@ VIRTUAL_MEMBER_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an incompatible change to a vtable.
@ SIZE_OR_OFFSET_CHANGE_CATEGORY
This means the diff node (or at least one of its descendant nodes) carries a change that modifies the...
@ NON_VIRT_MEM_FUN_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an addition or removal of a non-virtual member fu...
@ HARMLESS_ENUM_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an addition of enumerator to an enum type.
@ FN_PARM_ADD_REMOVE_CHANGE_CATEGORY
A diff node in this category is a function (or function type) with at least one parameter added or re...
@ VOID_PTR_TO_PTR_CHANGE_CATEGORY
A diff node in this category carries a change from void pointer to non-void pointer.
@ NON_COMPATIBLE_DISTINCT_CHANGE_CATEGORY
A change between two non-compatible types of different kinds.
@ NON_COMPATIBLE_NAME_CHANGE_CATEGORY
A non-compatible name change between two types.
@ COMPATIBLE_TYPE_CHANGE_CATEGORY
This means the diff node (or at least one of its descendant nodes) carries a change involving two com...
@ TYPE_DECL_ONLY_DEF_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a type that was declaration-only and that is now ...
@ STATIC_DATA_MEMBER_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an addition or removal of a static data member.
@ HARMLESS_UNION_OR_CLASS_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless union or class change.
@ HARMLESS_DECL_NAME_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless declaration name change....
@ NO_CHANGE_CATEGORY
This means the diff node does not carry any (meaningful) change, or that it carries changes that have...
@ BENIGN_INFINITE_ARRAY_CHANGE_CATEGORY
A diff node in this category carries a change in the size of the array type of a global variable,...
@ VAR_TYPE_CV_CHANGE_CATEGORY
A diff node in this category is for a variable which type holds a cv-qualifier change.
@ FN_PARM_TYPE_CV_CHANGE_CATEGORY
A diff node in this category has a function parameter type with a cv-qualifiers change.
@ FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY
A diff node in this category is a function parameter type which top cv-qualifiers change.
@ FN_RETURN_TYPE_CV_CHANGE_CATEGORY
A diff node in this category is a function return type with a cv-qualifier change.
@ HARMLESS_SYMBOL_ALIAS_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an a symbol alias change that is harmless.
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.
const pointer_diff * is_pointer_diff(const diff *diff)
Test if a diff node is about differences between two pointers.
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...
const function_decl_diff * is_function_decl_diff(const diff *diff)
Test if a diff node is about differences between functions.
const function_type_diff * is_function_type_diff(const diff *diff)
Test if a diff node is a function_type_diff node.
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 fn_parm_diff * is_fn_parm_diff(const diff *diff)
Test if a diff node is about differences between two function parameters.
const union_diff * is_union_diff(const diff *diff)
Test if a diff node is a union_diff node.
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.
const class_diff * is_class_diff(const diff *diff)
Test if a diff node is a class_diff node.
const type_decl_diff * is_diff_of_basic_type(const diff *d)
Test if a diff node represents a diff between two basic types.
const qualified_type_diff * is_qualified_type_diff(const diff *diff)
Test if a diff node is about differences between two qualified types.
const var_diff * is_var_diff(const diff *diff)
Test if a diff node is about differences between variables.
const type_diff_base * is_type_diff(const diff *diff)
Test if a diff node is about differences between types.
const reference_diff * is_reference_diff(const diff *diff)
Test if a diff node is about differences between two references.
shared_ptr< corpus_diff > corpus_diff_sptr
A convenience typedef for a shared pointer to corpus_diff.
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 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 type_base * peel_qualified_type(const type_base *type)
Return the leaf underlying type of a qualified type.
bool get_member_is_static(const decl_base &d)
Gets a flag saying if a class member is static or not.
shared_ptr< function_decl > function_decl_sptr
Convenience typedef for a shared pointer on a function_decl.
access_specifier
Access specifier for class members.
ssize_t get_member_function_vtable_offset(const function_decl &f)
Get the vtable offset of a member function.
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_type(const type_or_decl_base &tod)
Test whether a declaration is a type.
bool is_anonymous_data_member(const decl_base &d)
Test if a decl is an anonymous data member.
shared_ptr< elf_symbol > elf_symbol_sptr
A convenience typedef for a shared pointer to elf_symbol.
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.
bool parse_real_type(const string &type_name, real_type &type)
Parse a real type from a string.
bool collect_non_anonymous_data_members(const class_or_union *cou, string_decl_base_sptr_map &dms)
Collect all the non-anonymous data members of a class or union type.
shared_ptr< array_type_def > array_type_def_sptr
Convenience typedef for a shared pointer on a array_type_def.
type_decl * is_integral_type(const type_or_decl_base *t)
Test if a type is an integral type.
class_or_union * is_class_or_union_type(const type_or_decl_base *t)
Test if a type is a class_or_union.
shared_ptr< class_decl > class_decl_sptr
Convenience typedef for a shared pointer on a class_decl.
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,...
const type_decl * is_type_decl(const type_or_decl_base *t)
Test whether a type is a type_decl (a builtin type).
decl_base_sptr look_through_decl_only(const decl_base &d)
If a decl is decl-only get its definition. Otherwise, just return nil.
typedef_decl_sptr is_typedef(const type_or_decl_base_sptr t)
Test whether a type is a typedef.
type_base_sptr peel_pointer_type(const type_base_sptr &type)
Return the leaf pointed-to type node of a pointer_type_def node.
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.
const enum_type_decl * is_enum_type(const type_or_decl_base *d)
Test if a decl is an enum_type_decl.
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
const type_base * is_void_pointer_type_equivalent(const type_base *type)
Test if a type is equivalent to a pointer to void type.
unordered_map< string, decl_base_sptr > string_decl_base_sptr_map
Convenience typedef for a map which key is a string and which value is a decl_base_sptr.
uint64_t get_absolute_data_member_offset(const var_decl &m)
Get the absolute offset of a data member.
bool is_member_function(const function_decl &f)
Test whether a function_decl is a member function.
var_decl * is_var_decl(const type_or_decl_base *tod)
Tests if a declaration is a variable declaration.
decl_base * is_decl(const type_or_decl_base *d)
Test if an ABI artifact is a declaration.
access_specifier get_member_access_specifier(const decl_base &d)
Gets the access specifier for a class member.
shared_ptr< enum_type_decl > enum_type_decl_sptr
Convenience typedef for shared pointer to a enum_type_decl.
uint64_t get_data_member_offset(const var_decl &m)
Get the offset of a data member.
bool get_member_function_is_virtual(const function_decl &f)
Test if a given member function is virtual.
const pointer_type_def * is_pointer_type(const type_or_decl_base *t, bool look_through_qualifiers)
Test whether a type is a pointer_type_def.
var_decl_sptr has_fake_flexible_array_data_member(const class_decl &klass)
Test if the last data member of a class is an array with one element.
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...
bool is_data_member(const var_decl &v)
Test if a var_decl is a data member.
var_decl_sptr has_flexible_array_data_member(const class_decl &klass)
Test if the last data member of a class is an array with non-finite data member.
array_type_def * is_array_type(const type_or_decl_base *type, bool look_through_qualifiers)
Test if a type is an array_type_def.
bool types_are_compatible(const type_base_sptr type1, const type_base_sptr type2)
Test if two types are equal modulo a typedef.
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.
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.
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.
type_base * peel_qualified_or_typedef_type(const type_base *type)
Return the leaf underlying type of a qualified or typedef type.
bool is_member_decl(const decl_base_sptr d)
Tests if a declaration is a class member.
Toplevel namespace for libabigail.
The base class for the diff tree node filter.