16 #include "abg-reporter-priv.h"
38 apply_filters_and_suppressions_before_reporting();
69 const string& indent)
const
76 string name = f->get_pretty_representation();
81 if (f->get_visibility() != s->get_visibility())
84 <<
"visibility changed from '"
85 << f->get_visibility() <<
"' to '" << s->get_visibility()
89 if (f->get_linkage_name() != s->get_linkage_name())
92 <<
"mangled name changed from '"
93 << f->get_linkage_name() <<
"' to "
94 << s->get_linkage_name()
107 default_reporter::report(
const enum_diff& d, ostream& out,
108 const string& indent)
const
110 if (!d.to_be_reported())
113 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER3(d.first_subject(),
117 string name = d.first_enum()->get_pretty_representation();
128 first->get_is_declaration_only()
129 ?
" was a declaration-only enum type"
130 :
" was a defined enum type";
133 second->get_is_declaration_only()
134 ?
" and is now a declaration-only enum type"
135 :
" and is now a defined enum type";
137 out << indent <<
"enum type " << name << was << is_now <<
"\n";
146 d.underlying_type_diff()->report(out, indent);
149 unsigned numdels = d.deleted_enumerators().size();
150 unsigned numins = d.inserted_enumerators().size();
151 unsigned numchanges = d.changed_enumerators().size();
158 for (enum_type_decl::enumerators::const_iterator i =
159 sorted_deleted_enumerators.begin();
160 i != sorted_deleted_enumerators.end();
165 << i->get_qualified_name()
177 for (enum_type_decl::enumerators::const_iterator i =
178 sorted_inserted_enumerators.begin();
179 i != sorted_inserted_enumerators.end();
184 << i->get_qualified_name()
196 sorted_changed_enumerators);
197 for (changed_enumerators_type::const_iterator i =
198 sorted_changed_enumerators.begin();
199 i != sorted_changed_enumerators.end();
204 << i->first.get_qualified_name()
206 << i->first.get_value() <<
"' to '"
207 << i->second.get_value() <<
"'";
213 if (ctxt->show_leaf_changes_only())
216 d.reported_once(
true);
233 const string& indent)
const
243 && ((d.
context()->get_allowed_category()
245 || d.
context()->show_leaf_changes_only()))
246 || f->get_qualified_name() != s->get_qualified_name())
248 out << indent <<
"typedef name changed from "
249 << f->get_qualified_name()
251 << s->get_qualified_name();
268 const string& indent)
const
279 if (dif && dif->has_changes())
281 if (dif->to_be_reported())
283 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif,
286 <<
"underlying type '"
287 << dif->first_subject()->get_pretty_representation() <<
"'";
289 out <<
" changed:\n";
290 dif->report(out, indent +
" ");
305 <<
"underlying type '"
306 << dif->first_subject()->get_pretty_representation() <<
"'";
308 out <<
" changed:\n";
311 dif->report(out, indent +
" ");
335 const string& indent)
const
345 out << indent <<
"'" << fname <<
"' changed to '" << sname <<
"'\n";
372 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif,
376 string fltname = dif->first_subject()->get_pretty_representation();
377 out << indent <<
"in unqualified underlying type '" << fltname <<
"'";
380 dif->report(out, indent +
" ");
392 const string& indent)
const
419 default_reporter::report(
const pointer_diff& d, ostream& out,
420 const string& indent)
const
427 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif,
"pointed to type");
428 string repr = dif->first_subject()
429 ? dif->first_subject()->get_pretty_representation()
433 <<
"in pointed to type '" << repr <<
"'";
436 dif->report(out, indent +
" ");
451 const string& indent)
const
459 string f_repr = f->get_pretty_representation(),
460 s_repr = s->get_pretty_representation();
462 if (f->is_lvalue() != s->is_lvalue())
466 out <<
"lvalue reference type '" << f_repr
467 <<
" became an rvalue reference type: '"
471 out <<
"rvalue reference type '" << f_repr
472 <<
" became an lvalue reference type: '"
477 s->get_pointed_to_type().get()))
479 <<
"reference type changed from: '"
480 << f_repr <<
"' to: '" << s_repr <<
"'\n";
492 const string& indent)
const
507 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif,
511 <<
"in referenced type '"
512 << dif->first_subject()->get_pretty_representation() <<
"'";
515 dif->report(out, indent +
" ");
527 default_reporter::report(
const fn_parm_diff& d, ostream& out,
528 const string& indent)
const
530 if (!d.to_be_reported())
534 s = d.second_parameter();
540 bool has_sub_type_change =
542 d.second_parameter()->get_type());
548 if (f->get_is_artificial())
550 out <<
"parameter " << f->get_index();
553 << f->get_type_pretty_representation();
555 if (has_sub_type_change)
556 out <<
"' has sub-type changes:\n";
558 out <<
"' changed:\n";
560 type_diff->report(out, indent +
" ");
574 const string& indent)
const
586 if (fft->get_size_in_bits() != sft->get_size_in_bits())
588 out << indent <<
"address size of function changed from "
589 << fft->get_size_in_bits()
591 << sft->get_size_in_bits()
596 if (fft->get_alignment_in_bits()
597 != sft->get_alignment_in_bits())
599 out << indent <<
"address alignment of function changed from "
600 << fft->get_alignment_in_bits()
602 << sft->get_alignment_in_bits()
610 for (vector<function_decl::parameter_sptr>::const_iterator i =
611 d.priv_->sorted_deleted_parms_.begin();
612 i != d.priv_->sorted_deleted_parms_.end();
615 out << indent <<
"parameter " << (*i)->get_index()
616 <<
" of type '" << (*i)->get_type_pretty_representation()
617 <<
"' was removed\n";
621 for (vector<function_decl::parameter_sptr>::const_iterator i =
622 d.priv_->sorted_added_parms_.begin();
623 i != d.priv_->sorted_added_parms_.end();
626 out << indent <<
"parameter " << (*i)->get_index()
627 <<
" of type '" << (*i)->get_type_pretty_representation()
641 const string& indent)
const
650 corpus_sptr fc = ctxt->get_first_corpus();
651 corpus_sptr sc = ctxt->get_second_corpus();
654 if (d.priv_->return_type_diff_
655 && d.priv_->return_type_diff_->to_be_reported())
657 out << indent <<
"return type changed:\n";
658 d.priv_->return_type_diff_->report(out, indent +
" ");
662 for (vector<fn_parm_diff_sptr>::const_iterator i =
663 d.priv_->sorted_subtype_changed_parms_.begin();
664 i != d.priv_->sorted_subtype_changed_parms_.end();
668 if (dif && dif->to_be_reported())
669 dif->report(out, indent);
686 const std::string& indent)
const
691 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER3(d.
first_subrange(),
706 default_reporter::report(
const array_diff& d, ostream& out,
707 const string& indent)
const
712 string name = d.
first_array()->get_pretty_representation();
713 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER3(d.
first_array(),
718 if (dif->to_be_reported())
722 out << indent <<
"array element type '"
723 << fn <<
"' changed:\n";
724 dif->report(out, indent +
" ");
742 default_reporter::report(
const base_diff& d, ostream& out,
743 const string& indent)
const
745 if (!d.to_be_reported())
749 string repr = f->get_base_class()->get_pretty_representation();
750 bool emitted =
false;
752 if (!d.is_filtered_out_without_looking_at_allowed_changes())
754 if (f->get_is_static() != s->get_is_static())
756 if (f->get_is_static())
757 out << indent <<
"is no more static";
759 out << indent <<
"now becomes static";
764 && (f->get_access_specifier() != s->get_access_specifier()))
769 out <<
"has access changed from '"
770 << f->get_access_specifier()
772 << s->get_access_specifier()
780 if (dif->to_be_reported())
784 dif->report(out, indent);
797 default_reporter::report(
const scope_diff& d, ostream& out,
798 const string& indent)
const
800 if (!d.to_be_reported())
804 unsigned num_changed_types = d.changed_types().size();
805 if (num_changed_types == 0)
807 else if (num_changed_types == 1)
808 out << indent <<
"1 changed type:\n";
810 out << indent << num_changed_types <<
" changed types:\n";
812 for (diff_sptrs_type::const_iterator dif = d.changed_types().begin();
813 dif != d.changed_types().end();
819 out << indent <<
" '"
820 << (*dif)->first_subject()->get_pretty_representation()
822 (*dif)->report(out, indent +
" ");
826 unsigned num_changed_decls = d.changed_decls().size();
827 if (num_changed_decls == 0)
829 else if (num_changed_decls == 1)
830 out << indent <<
"1 changed declaration:\n";
832 out << indent << num_changed_decls <<
" changed declarations:\n";
834 for (diff_sptrs_type::const_iterator dif= d.changed_decls().begin();
835 dif != d.changed_decls().end ();
841 out << indent <<
" '"
842 << (*dif)->first_subject()->get_pretty_representation()
843 <<
"' was changed to '"
844 << (*dif)->second_subject()->get_pretty_representation() <<
"'";
848 (*dif)->report(out, indent +
" ");
852 for (string_decl_base_sptr_map::const_iterator i =
853 d.priv_->deleted_types_.begin();
854 i != d.priv_->deleted_types_.end();
858 << i->second->get_pretty_representation()
859 <<
"' was removed\n";
861 if (d.priv_->deleted_types_.size())
864 for (string_decl_base_sptr_map::const_iterator i =
865 d.priv_->deleted_decls_.begin();
866 i != d.priv_->deleted_decls_.end();
870 << i->second->get_pretty_representation()
871 <<
"' was removed\n";
873 if (d.priv_->deleted_decls_.size())
877 bool emitted =
false;
878 for (string_decl_base_sptr_map::const_iterator i =
879 d.priv_->inserted_types_.begin();
880 i != d.priv_->inserted_types_.end();
885 if (dynamic_pointer_cast<type_decl>(i->second))
889 << i->second->get_pretty_representation()
898 for (string_decl_base_sptr_map::const_iterator i =
899 d.priv_->inserted_decls_.begin();
900 i != d.priv_->inserted_decls_.end();
905 if (dynamic_pointer_cast<type_decl>(i->second))
909 << i->second->get_pretty_representation()
927 default_reporter::report(
const class_or_union_diff& d,
929 const string& indent)
const
931 if (!d.to_be_reported())
934 class_or_union_sptr first = d.first_class_or_union(),
935 second = d.second_class_or_union();
944 first->get_is_declaration_only()
945 ?
" was a declaration-only type"
946 :
" was a defined type";
949 second->get_is_declaration_only()
950 ?
" and is now a declaration-only type"
951 :
" and is now a defined type";
953 out << indent <<
"type " << first->get_pretty_representation()
954 << was << is_now <<
"\n";
959 if (d.member_fns_changes())
962 int numdels = d.get_priv()->deleted_member_functions_.size();
963 size_t num_filtered =
964 d.get_priv()->count_filtered_deleted_mem_fns(ctxt);
967 "member function", indent);
968 for (class_or_union::member_functions::const_iterator i =
969 d.get_priv()->sorted_deleted_member_functions_.begin();
970 i != d.get_priv()->sorted_deleted_member_functions_.end();
973 if (!(ctxt->get_allowed_category()
978 method_decl_sptr mem_fun = *i;
979 out << indent <<
" ";
984 int numins = d.get_priv()->inserted_member_functions_.size();
985 num_filtered = d.get_priv()->count_filtered_inserted_mem_fns(ctxt);
988 "member function", indent);
989 for (class_or_union::member_functions::const_iterator i =
990 d.get_priv()->sorted_inserted_member_functions_.begin();
991 i != d.get_priv()->sorted_inserted_member_functions_.end();
994 if (!(ctxt->get_allowed_category()
999 method_decl_sptr mem_fun = *i;
1000 out << indent <<
" ";
1005 int numchanges = d.get_priv()->sorted_changed_member_functions_.size();
1006 num_filtered = d.get_priv()->count_filtered_changed_mem_fns(ctxt);
1009 "member function", indent);
1010 for (function_decl_diff_sptrs_type::const_iterator i =
1011 d.get_priv()->sorted_changed_member_functions_.begin();
1012 i != d.get_priv()->sorted_changed_member_functions_.end();
1015 if (!(ctxt->get_allowed_category()
1018 ((*i)->first_function_decl()))
1020 ((*i)->second_function_decl())))
1024 if (!diff || !diff->to_be_reported())
1028 (*i)->first_function_decl()->get_pretty_representation();
1029 out << indent <<
" '" << repr <<
"' has some sub-type changes:\n";
1030 diff->report(out, indent +
" ");
1035 if (d.data_members_changes())
1038 int numdels = d.class_or_union_diff::get_priv()->
1039 get_deleted_non_static_data_members_number();
1043 "data member", indent);
1044 vector<decl_base_sptr> sorted_dms;
1046 (d.class_or_union_diff::get_priv()->deleted_data_members_,
1048 for (vector<decl_base_sptr>::const_iterator i = sorted_dms.begin();
1049 i != sorted_dms.end();
1053 dynamic_pointer_cast<var_decl>(*i);
1063 d.class_or_union_diff::get_priv()->inserted_data_members_.size();
1067 "data member", indent);
1068 vector<decl_base_sptr> sorted_dms;
1070 (d.class_or_union_diff::get_priv()->inserted_data_members_,
1072 for (vector<decl_base_sptr>::const_iterator i = sorted_dms.begin();
1073 i != sorted_dms.end();
1077 dynamic_pointer_cast<var_decl>(*i);
1084 size_t num_changes =
1085 (d.sorted_subtype_changed_data_members().size()
1086 + d.sorted_changed_data_members().size());
1088 size_t num_changes_filtered =
1089 (d.count_filtered_subtype_changed_data_members()
1090 + d.count_filtered_changed_data_members());
1095 change_kind,
"data member", indent);
1097 for (var_diff_sptrs_type::const_iterator it =
1098 d.sorted_changed_data_members().begin();
1099 it != d.sorted_changed_data_members().end();
1101 if ((*it)->to_be_reported())
1102 represent(*it, ctxt, out, indent +
" ");
1104 for (var_diff_sptrs_type::const_iterator it =
1105 d.sorted_subtype_changed_data_members().begin();
1106 it != d.sorted_subtype_changed_data_members().end();
1108 if ((*it)->to_be_reported())
1109 represent(*it, ctxt, out, indent +
" ");
1118 if (
const edit_script& e = d.member_types_changes())
1121 d.class_or_union_diff::get_priv()->sorted_changed_member_types_.size();
1123 d.class_or_union_diff::get_priv()->deleted_member_types_.size();
1129 "member type", indent);
1131 for (string_decl_base_sptr_map::const_iterator i =
1132 d.class_or_union_diff::get_priv()->deleted_member_types_.begin();
1133 i != d.class_or_union_diff::get_priv()->deleted_member_types_.end();
1136 decl_base_sptr mem_type = i->second;
1137 out << indent <<
" '"
1138 << mem_type->get_pretty_representation()
1147 "member type", indent);
1149 for (diff_sptrs_type::const_iterator it =
1150 d.class_or_union_diff::get_priv()->sorted_changed_member_types_.begin();
1151 it != d.class_or_union_diff::get_priv()->sorted_changed_member_types_.end();
1154 if (!(*it)->to_be_reported())
1159 out << indent <<
" '"
1160 << o->get_pretty_representation()
1164 (*it)->report(out, indent +
" ");
1170 int numins = e.num_insertions();
1172 numins -= numchanges;
1177 "member type", indent);
1179 for (vector<insertion>::const_iterator i = e.insertions().begin();
1180 i != e.insertions().end();
1183 type_base_sptr mem_type;
1184 for (vector<unsigned>::const_iterator j =
1185 i->inserted_indexes().begin();
1186 j != i->inserted_indexes().end();
1189 mem_type = second->get_member_types()[*j];
1190 if (!d.class_or_union_diff::get_priv()->
1193 out << indent <<
" '"
1205 if (
const edit_script& e = d.member_fn_tmpls_changes())
1208 int numdels = e.num_deletions();
1211 "member function template", indent);
1212 for (vector<deletion>::const_iterator i = e.deletions().begin();
1213 i != e.deletions().end();
1216 member_function_template_sptr mem_fn_tmpl =
1217 first->get_member_function_templates()[i->index()];
1218 out << indent <<
" '"
1219 << mem_fn_tmpl->as_function_tdecl()->get_pretty_representation()
1224 int numins = e.num_insertions();
1227 "member function template", indent);
1228 for (vector<insertion>::const_iterator i = e.insertions().begin();
1229 i != e.insertions().end();
1232 member_function_template_sptr mem_fn_tmpl;
1233 for (vector<unsigned>::const_iterator j =
1234 i->inserted_indexes().begin();
1235 j != i->inserted_indexes().end();
1238 mem_fn_tmpl = second->get_member_function_templates()[*j];
1239 out << indent <<
" '"
1240 << mem_fn_tmpl->as_function_tdecl()->
1248 if (
const edit_script& e = d.member_class_tmpls_changes())
1251 int numdels = e.num_deletions();
1254 "member class template", indent);
1255 for (vector<deletion>::const_iterator i = e.deletions().begin();
1256 i != e.deletions().end();
1259 member_class_template_sptr mem_cls_tmpl =
1260 first->get_member_class_templates()[i->index()];
1261 out << indent <<
" '"
1262 << mem_cls_tmpl->as_class_tdecl()->get_pretty_representation()
1267 int numins = e.num_insertions();
1270 "member class template", indent);
1271 for (vector<insertion>::const_iterator i = e.insertions().begin();
1272 i != e.insertions().end();
1275 member_class_template_sptr mem_cls_tmpl;
1276 for (vector<unsigned>::const_iterator j =
1277 i->inserted_indexes().begin();
1278 j != i->inserted_indexes().end();
1281 mem_cls_tmpl = second->get_member_class_templates()[*j];
1282 out << indent <<
" '"
1283 << mem_cls_tmpl->as_class_tdecl()
1284 ->get_pretty_representation()
1301 default_reporter::report(
const class_diff& d, ostream& out,
1302 const string& indent)
const
1304 if (!d.to_be_reported())
1307 string name = d.first_subject()->get_pretty_representation();
1309 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER(d.first_subject(),
1310 d.second_subject());
1312 d.currently_reporting(
true);
1316 second = d.second_class_decl();
1325 if (d.base_changes())
1328 int numdels = d.get_priv()->deleted_bases_.size();
1329 size_t numchanges = d.get_priv()->sorted_changed_bases_.size();
1334 "base class", indent);
1336 for (class_decl::base_specs::const_iterator i
1337 = d.get_priv()->sorted_deleted_bases_.begin();
1338 i != d.get_priv()->sorted_deleted_bases_.end();
1341 if (i != d.get_priv()->sorted_deleted_bases_.begin())
1346 if (d.get_priv()->base_has_changed(base))
1348 out << indent <<
" "
1349 << base->get_base_class()->get_pretty_representation();
1356 size_t num_filtered = d.get_priv()->count_filtered_bases();
1360 "base class", indent);
1361 for (base_diff_sptrs_type::const_iterator it =
1362 d.get_priv()->sorted_changed_bases_.begin();
1363 it != d.get_priv()->sorted_changed_bases_.end();
1367 if (!diff || !diff->to_be_reported())
1371 out << indent <<
" '"
1372 << o->get_base_class()->get_pretty_representation() <<
"'";
1374 out <<
" changed:\n";
1375 diff->report(out, indent +
" ");
1380 int numins = d.get_priv()->inserted_bases_.size();
1384 "base class", indent);
1386 for (class_decl::base_specs::const_iterator i =
1387 d.get_priv()->sorted_inserted_bases_.begin();
1388 i != d.get_priv()->sorted_inserted_bases_.end();
1392 out << indent <<
" " << b->get_pretty_representation();
1402 d.class_or_union_diff::report(out, indent);
1404 d.currently_reporting(
false);
1406 d.reported_once(
true);
1419 default_reporter::report(
const union_diff& d, ostream& out,
1420 const string& indent)
const
1422 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER(d.first_subject(),
1423 d.second_subject());
1425 d.currently_reporting(
true);
1428 union_decl_sptr first = d.first_union_decl(), second = d.second_union_decl();
1435 d.class_or_union_diff::report(out, indent);
1443 out << indent <<
"type changed from:\n"
1449 << indent <<
"to:\n"
1457 d.currently_reporting(
false);
1459 d.reported_once(
true);
1471 default_reporter::report(
const distinct_diff& d, ostream& out,
1472 const string& indent)
const
1474 if (!d.to_be_reported())
1479 string f_repr = f ? f->get_pretty_representation() :
"'void'";
1480 string s_repr = s ? s->get_pretty_representation() :
"'void'";
1482 diff_sptr diff = d.compatible_child_diff();
1484 string compatible = diff ?
" to compatible type '":
" to '";
1486 out << indent <<
"entity changed from '" << f_repr <<
"'"
1487 << compatible << s_repr <<
"'";
1495 diff->report(out, indent +
" ");
1509 default_reporter::report(
const function_decl_diff& d, ostream& out,
1510 const string& indent)
const
1512 if (!d.to_be_reported())
1516 d.second_function_decl(),
1517 d.context(), out, indent);
1523 corpus_sptr fc = ctxt->get_first_corpus();
1524 corpus_sptr sc = ctxt->get_second_corpus();
1527 string qn1 = ff->get_qualified_name(), qn2 = sf->get_qualified_name(),
1528 linkage_names1, linkage_names2;
1532 linkage_names1 = s1->get_id_string();
1534 linkage_names2 = s2->get_id_string();
1540 s1->get_aliases_id_string(fc->get_fun_symbol_map());
1543 s2->get_aliases_id_string(sc->get_fun_symbol_map());
1545 if (!d.is_filtered_out_without_looking_at_allowed_changes())
1549 if (linkage_names1 != linkage_names2)
1551 if (linkage_names1.empty())
1553 out << indent << ff->get_pretty_representation()
1554 <<
" didn't have any linkage name, and it now has: '"
1555 << linkage_names2 <<
"'\n";
1557 else if (linkage_names2.empty())
1559 out << indent << ff->get_pretty_representation()
1560 <<
" did have linkage names '" << linkage_names1
1562 << indent <<
"but it doesn't have any linkage name anymore\n";
1565 out << indent <<
"linkage names of "
1566 << ff->get_pretty_representation()
1567 <<
"\n" << indent <<
"changed from '"
1568 << linkage_names1 <<
"' to '" << linkage_names2 <<
"'\n";
1573 && d.type_diff()->to_be_reported())
1579 string frep1 = d.first_function_decl()->get_pretty_representation(),
1580 frep2 = d.second_function_decl()->get_pretty_representation();
1581 out << indent <<
"'" << frep1 <<
" {" << linkage_names1<<
"}"
1582 <<
"' now becomes '"
1583 << frep2 <<
" {" << linkage_names2 <<
"}" <<
"'\n";
1588 d.context(), out, indent);
1591 if (ff->is_declared_inline() != sf->is_declared_inline())
1594 if (ff->is_declared_inline())
1595 out << sf->get_pretty_representation()
1596 <<
" is not declared inline anymore\n";
1598 out << sf->get_pretty_representation()
1599 <<
" is now declared inline\n";
1607 if (ff_is_virtual != sf_is_virtual)
1611 out << ff->get_pretty_representation()
1612 <<
" is no more declared virtual\n";
1614 out << ff->get_pretty_representation()
1615 <<
" is now declared virtual\n";
1620 if (ff_is_virtual && sf_is_virtual
1621 && (ff_vtable_offset != sf_vtable_offset))
1624 <<
"the vtable offset of " << ff->get_pretty_representation()
1625 <<
" changed from " << ff_vtable_offset
1626 <<
" to " << sf_vtable_offset <<
"\n";
1631 class_or_union_sptr f =
1633 class_or_union_sptr s =
1641 bool vtable_added =
false, vtable_removed =
false;
1642 if (!f->get_is_declaration_only() && !s->get_is_declaration_only())
1646 vtable_added = !fc->has_vtable() && sc->has_vtable();
1647 vtable_removed = fc->has_vtable() && !sc->has_vtable();
1650 bool vtable_changed = ((ff_is_virtual != sf_is_virtual)
1651 || (ff_vtable_offset != sf_vtable_offset));
1652 bool incompatible_change = (ff_vtable_offset != sf_vtable_offset);
1656 <<
" note that a vtable was added to "
1657 << fc->get_pretty_representation()
1659 else if (vtable_removed)
1661 <<
" note that the vtable was removed from "
1662 << fc->get_pretty_representation()
1664 else if (vtable_changed)
1667 if (incompatible_change)
1668 out <<
" note that this is an ABI incompatible "
1669 "change to the vtable of ";
1671 out <<
" note that this induces a change to the vtable of ";
1672 out << fc->get_pretty_representation()
1680 if (d.type_diff() && d.type_diff()->to_be_reported())
1681 d.type_diff()->report(out, indent);
1694 default_reporter::report(
const var_diff& d, ostream& out,
1695 const string& indent)
const
1697 if (!d.to_be_reported())
1700 decl_base_sptr first = d.first_var(), second = d.second_var();
1701 string n = first->get_pretty_representation();
1703 if (!d.is_filtered_out_without_looking_at_allowed_changes())
1710 d.second_var()->get_symbol(),
1711 d.context(), out, indent);
1720 if (dif->to_be_reported())
1722 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif,
"type");
1723 out << indent <<
"type of variable changed:\n";
1724 dif->report(out, indent +
" ");
1738 default_reporter::report(
const translation_unit_diff& d,
1740 const string& indent)
const
1742 static_cast<const scope_diff&
>(d).report(out, indent);
1754 default_reporter::report(
const corpus_diff& d, ostream& out,
1755 const string& indent)
const
1757 const corpus_diff::diff_stats &s =
1758 const_cast<corpus_diff&
>(d).
1759 apply_filters_and_suppressions_before_reporting();
1763 d.priv_->emit_diff_stats(s, out, indent);
1764 if (ctxt->show_stats_only())
1768 if (ctxt->show_soname_change()
1769 && !d.priv_->sonames_equal_)
1770 out << indent <<
"SONAME changed from '"
1771 << d.first_corpus()->get_soname() <<
"' to '"
1772 << d.second_corpus()->get_soname() <<
"'\n\n";
1774 if (ctxt->show_architecture_change()
1775 && !d.priv_->architectures_equal_)
1776 out << indent <<
"architecture changed from '"
1777 << d.first_corpus()->get_architecture_name() <<
"' to '"
1778 << d.second_corpus()->get_architecture_name() <<
"'\n\n";
1781 if (ctxt->show_deleted_fns())
1783 if (s.net_num_func_removed() == 1)
1784 out << indent <<
"1 Removed function:\n\n";
1785 else if (s.net_num_func_removed() > 1)
1786 out << indent << s.net_num_func_removed() <<
" Removed functions:\n\n";
1788 bool emitted =
false;
1789 vector<function_decl*>sorted_deleted_fns;
1791 for (vector<function_decl*>::const_iterator i =
1792 sorted_deleted_fns.begin();
1793 i != sorted_deleted_fns.end();
1796 if (d.priv_->deleted_function_is_suppressed(*i))
1802 out <<
"'" << (*i)->get_pretty_representation() <<
"'";
1803 if (ctxt->show_linkage_names())
1807 d.first_corpus()->get_fun_symbol_map());
1817 <<
"note that this removes an entry from the vtable of "
1818 << c->get_pretty_representation()
1827 if (ctxt->show_added_fns())
1829 if (s.net_num_func_added() == 1)
1830 out << indent <<
"1 Added function:\n\n";
1831 else if (s.net_num_func_added() > 1)
1832 out << indent << s.net_num_func_added()
1833 <<
" Added functions:\n\n";
1834 bool emitted =
false;
1835 vector<function_decl*> sorted_added_fns;
1837 for (vector<function_decl*>::const_iterator i = sorted_added_fns.begin();
1838 i != sorted_added_fns.end();
1841 if (d.priv_->added_function_is_suppressed(*i))
1849 << (*i)->get_pretty_representation()
1851 if (ctxt->show_linkage_names())
1855 (out,
"", *(*i)->get_symbol(),
1856 d.second_corpus()->get_fun_symbol_map());
1866 <<
"note that this adds a new entry to the vtable of "
1867 << c->get_pretty_representation()
1876 if (ctxt->show_changed_fns())
1878 size_t num_changed = s.num_func_changed() - s.num_changed_func_filtered_out();
1879 if (num_changed == 1)
1880 out << indent <<
"1 function with some indirect sub-type change:\n\n";
1881 else if (num_changed > 1)
1882 out << indent << num_changed
1883 <<
" functions with some indirect sub-type change:\n\n";
1885 vector<function_decl_diff_sptr> sorted_changed_fns;
1887 sorted_changed_fns);
1888 for (vector<function_decl_diff_sptr>::const_iterator i =
1889 sorted_changed_fns.begin();
1890 i != sorted_changed_fns.end();
1897 if (diff->to_be_reported())
1900 out << indent <<
" [C] '"
1901 << fn->get_pretty_representation() <<
"'";
1903 out <<
" has some indirect sub-type changes:\n";
1907 (fn->get_symbol()->has_aliases()
1919 && fn->get_name() != fn->get_symbol()->get_name()))
1925 int number_of_aliases =
1926 fn->get_symbol()->get_number_of_aliases();
1927 if (number_of_aliases == 0)
1929 out << indent <<
" "
1930 <<
"Please note that the exported symbol of "
1932 << fn->get_symbol()->get_id_string()
1937 out << indent <<
" "
1938 <<
"Please note that the symbol of this function is "
1939 << fn->get_symbol()->get_id_string()
1940 <<
"\n and it aliases symbol";
1941 if (number_of_aliases > 1)
1944 << fn->get_symbol()->get_aliases_id_string(
false)
1948 diff->report(out, indent +
" ");
1957 if (ctxt->show_deleted_vars())
1959 if (s.net_num_vars_removed() == 1)
1960 out << indent <<
"1 Removed variable:\n\n";
1961 else if (s.net_num_vars_removed() > 1)
1962 out << indent << s.net_num_vars_removed()
1963 <<
" Removed variables:\n\n";
1965 bool emitted =
false;
1966 vector<var_decl*> sorted_deleted_vars;
1968 for (vector<var_decl*>::const_iterator i =
1969 sorted_deleted_vars.begin();
1970 i != sorted_deleted_vars.end();
1973 if (d.priv_->deleted_variable_is_suppressed(*i))
1976 n = (*i)->get_pretty_representation();
1984 if (ctxt->show_linkage_names())
1988 d.first_corpus()->get_var_symbol_map());
1998 if (ctxt->show_added_vars())
2000 if (s.net_num_vars_added() == 1)
2001 out << indent <<
"1 Added variable:\n\n";
2002 else if (s.net_num_vars_added() > 1)
2003 out << indent << s.net_num_vars_added()
2004 <<
" Added variables:\n\n";
2006 bool emitted =
false;
2007 vector<var_decl*> sorted_added_vars;
2009 for (vector<var_decl*>::const_iterator i =
2010 sorted_added_vars.begin();
2011 i != sorted_added_vars.end();
2014 if (d.priv_->added_variable_is_suppressed(*i))
2017 n = (*i)->get_pretty_representation();
2022 out <<
"'" << n <<
"'";
2023 if (ctxt->show_linkage_names())
2027 d.second_corpus()->get_var_symbol_map());
2037 if (ctxt->show_changed_vars())
2039 size_t num_changed =
2040 s.num_vars_changed() - s.num_changed_vars_filtered_out();
2041 if (num_changed == 1)
2042 out << indent <<
"1 Changed variable:\n\n";
2043 else if (num_changed > 1)
2044 out << indent << num_changed
2045 <<
" Changed variables:\n\n";
2048 for (var_diff_sptrs_type::const_iterator i =
2049 d.priv_->sorted_changed_vars_.begin();
2050 i != d.priv_->sorted_changed_vars_.end();
2058 if (!diff->to_be_reported())
2061 n1 = diff->first_subject()->get_pretty_representation();
2062 n2 = diff->second_subject()->get_pretty_representation();
2064 out << indent <<
" [C] '" << n1 <<
"' was changed";
2066 out <<
" to '" << n2 <<
"'";
2069 diff->report(out, indent +
" ");
2077 if (ctxt->show_symbols_unreferenced_by_debug_info()
2078 && d.priv_->deleted_unrefed_fn_syms_.size())
2080 if (s.net_num_removed_func_syms() == 1)
2082 <<
"1 Removed function symbol not referenced by debug info:\n\n";
2083 else if (s.net_num_removed_func_syms() > 0)
2085 << s.net_num_removed_func_syms()
2086 <<
" Removed function symbols not referenced by debug info:\n\n";
2088 bool emitted =
false;
2089 vector<elf_symbol_sptr> sorted_deleted_unrefed_fn_syms;
2091 sorted_deleted_unrefed_fn_syms);
2092 for (vector<elf_symbol_sptr>::const_iterator i =
2093 sorted_deleted_unrefed_fn_syms.begin();
2094 i != sorted_deleted_unrefed_fn_syms.end();
2097 if (d.priv_->deleted_unrefed_fn_sym_is_suppressed((*i).get()))
2100 out << indent <<
" ";
2104 d.first_corpus()->get_fun_symbol_map());
2113 if (ctxt->show_symbols_unreferenced_by_debug_info()
2114 && ctxt->show_added_symbols_unreferenced_by_debug_info()
2115 && d.priv_->added_unrefed_fn_syms_.size())
2117 if (s.net_num_added_func_syms() == 1)
2119 <<
"1 Added function symbol not referenced by debug info:\n\n";
2120 else if (s.net_num_added_func_syms() > 0)
2122 << s.net_num_added_func_syms()
2123 <<
" Added function symbols not referenced by debug info:\n\n";
2125 bool emitted =
false;
2126 vector<elf_symbol_sptr> sorted_added_unrefed_fn_syms;
2128 sorted_added_unrefed_fn_syms);
2129 for (vector<elf_symbol_sptr>::const_iterator i =
2130 sorted_added_unrefed_fn_syms.begin();
2131 i != sorted_added_unrefed_fn_syms.end();
2134 if (d.priv_->added_unrefed_fn_sym_is_suppressed((*i).get()))
2137 out << indent <<
" ";
2141 d.second_corpus()->get_fun_symbol_map());
2150 if (ctxt->show_symbols_unreferenced_by_debug_info()
2151 && d.priv_->deleted_unrefed_var_syms_.size())
2153 if (s.net_num_removed_var_syms() == 1)
2155 <<
"1 Removed variable symbol not referenced by debug info:\n\n";
2156 else if (s.net_num_removed_var_syms() > 0)
2158 << s.net_num_removed_var_syms()
2159 <<
" Removed variable symbols not referenced by debug info:\n\n";
2161 bool emitted =
false;
2162 vector<elf_symbol_sptr> sorted_deleted_unrefed_var_syms;
2164 sorted_deleted_unrefed_var_syms);
2165 for (vector<elf_symbol_sptr>::const_iterator i =
2166 sorted_deleted_unrefed_var_syms.begin();
2167 i != sorted_deleted_unrefed_var_syms.end();
2170 if (d.priv_->deleted_unrefed_var_sym_is_suppressed((*i).get()))
2173 out << indent <<
" ";
2178 d.first_corpus()->get_fun_symbol_map());
2188 if (ctxt->show_symbols_unreferenced_by_debug_info()
2189 && ctxt->show_added_symbols_unreferenced_by_debug_info()
2190 && d.priv_->added_unrefed_var_syms_.size())
2192 if (s.net_num_added_var_syms() == 1)
2194 <<
"1 Added variable symbol not referenced by debug info:\n\n";
2195 else if (s.net_num_added_var_syms() > 0)
2197 << s.net_num_added_var_syms()
2198 <<
" Added variable symbols not referenced by debug info:\n\n";
2200 bool emitted =
false;
2201 vector<elf_symbol_sptr> sorted_added_unrefed_var_syms;
2203 sorted_added_unrefed_var_syms);
2204 for (vector<elf_symbol_sptr>::const_iterator i =
2205 sorted_added_unrefed_var_syms.begin();
2206 i != sorted_added_unrefed_var_syms.end();
2209 if (d.priv_->added_unrefed_var_sym_is_suppressed((*i).get()))
2212 out << indent <<
" ";
2215 d.second_corpus()->get_fun_symbol_map());
2227 d.priv_->maybe_dump_diff_tree();
The private data and functions of the abigail::ir::comparison types.
#define ABG_ASSERT(cond)
This is a wrapper around the 'assert' glibc call. It allows for its argument to have side effects,...
The declaration of the reporting types of libabigail's diff engine.
The abstraction of a diff between two arrays.
const diff_sptr & element_type_diff() const
Getter for the diff between the two types of array elements.
const array_type_def_sptr second_array() const
Getter for the second array of the diff.
const array_type_def_sptr first_array() const
Getter for the first array of the diff.
This is a document class that aims to capture statistics about the changes carried by a corpus_diff t...
size_t net_num_func_changed() const
Getter for the number of functions that have a change in their sub-types, minus the number of these f...
size_t net_num_vars_removed() const
Getter for the net number of removed variables.
size_t net_num_added_unreachable_types() const
Getter of the number of added types that are unreachable from public interfaces and that are *NOT* fi...
size_t net_num_added_func_syms() const
Getter of the net number of added function symbols that are not referenced by any debug info.
size_t net_num_removed_func_syms() const
Getter of the net number of removed function symbols that are not referenced by any debug info.
size_t net_num_removed_var_syms() const
Getter of the net number of removed variable symbols that are not referenced by any debug info.
size_t net_num_func_removed() const
Getter for the net number of function removed.
size_t net_num_func_added() const
Getter for the net number of added functions.
size_t net_num_removed_unreachable_types() const
Getter of the number of removed types that are not reachable from public interfaces and that have *NO...
size_t net_num_added_var_syms() const
Getter of the net number of added variable symbols that are not referenced by any debug info.
size_t net_num_vars_added() const
Getter for the net number of added variables.
size_t net_num_changed_unreachable_types() const
Getter of the number of changed types that are unreachable from public interfaces and that have *NOT*...
size_t net_num_vars_changed() const
Getter for the number of variables that have a change in their sub-types, minus the number of these v...
An abstraction of a diff between between two abi corpus.
bool soname_changed() const
Test if the soname of the underlying corpus has changed.
bool architecture_changed() const
Test if the architecture of the underlying corpus has changed.
bool report_local_qualified_type_changes(const qualified_type_diff &d, std::ostream &out, const std::string &indent) const
For a qualified_type_diff node, report the changes that are local.
void report_local_function_type_changes(const function_type_diff &d, std::ostream &out, const std::string &indent) const
For a function_type_diff node, report the local changes carried by the diff node.
void report_underlying_changes_of_qualified_type(const qualified_type_diff &d, ostream &out, const string &indent) const
For a qualified_type_diff node, report the changes of its underlying type.
virtual bool diff_has_net_changes(const corpus_diff *d) const
Test if a given instance of corpus_diff carries changes whose reports are not suppressed by any suppr...
void report_local_reference_type_changes(const reference_diff &d, std::ostream &out, const std::string &indent) const
For a @reference_diff node, report the local changes carried by the diff node.
void report_non_type_typedef_changes(const typedef_diff &d, std::ostream &out, const std::string &indent) const
For a typedef_diff node, report the local changes to the typedef rather the changes to its underlying...
bool is_filtered_out_without_looking_at_allowed_changes() const
Test if this diff tree node is to be filtered out for reporting purposes, but without considering the...
const diff_context_sptr context() const
Getter of the context of the current diff.
bool to_be_reported() const
Test if this diff tree node should be reported.
bool reported_once() const
Tests if a report has already been emitted for the current diff.
Abstraction of a diff between two function types.
const function_type_sptr first_function_type() const
Getter for the first subject of the diff.
const function_type_sptr second_function_type() const
Getter for the second subject of the diff.
The abstraction of a diff between two pointers.
diff_sptr underlying_type_diff() const
Getter for the diff between the pointed-to types of the pointers of this diff.
Abstraction of a diff between two qualified types.
diff_sptr leaf_underlying_type_diff() const
Getter for the diff between the most underlying non-qualified types of two qualified types.
const qualified_type_def_sptr second_qualified_type() const
Getter for the second qualified type of the diff.
const qualified_type_def_sptr first_qualified_type() const
Getter for the first qualified type of the diff.
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.
const diff_sptr & underlying_type_diff() const
Getter for the diff between the two referred-to types.
virtual bool diff_to_be_reported(const diff *d) const
Tests if the diff node is to be reported.
The abstraction of the diff between two subrange types.
const array_type_def::subrange_sptr second_subrange() const
Getter of the second subrange of the current instance subrange_diff.
const array_type_def::subrange_sptr first_subrange() const
Getter of the first subrange of the current instance subrange_diff.
Abstraction of a diff between two basic type declarations.
const type_decl_sptr first_type_decl() const
Getter for the first subject of the type_decl_diff.
const type_decl_sptr second_type_decl() const
Getter for the second subject of the type_decl_diff.
Abstraction of a diff between two typedef_decl.
const typedef_decl_sptr second_typedef_decl() const
Getter for the second typedef_decl involved in the diff.
const typedef_decl_sptr first_typedef_decl() const
Getter for the firt typedef_decl involved in the diff.
const diff_sptr underlying_type_diff() const
Getter for the diff between the two underlying types of the typedefs.
shared_ptr< base_spec > base_spec_sptr
Convenience typedef.
std::vector< enumerator > enumerators
Convenience typedef for a list of enumerator.
shared_ptr< parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
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_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_harmless_name_change(const decl_base_sptr &f, const decl_base_sptr &s)
Test if two decls represents a harmless name change.
bool union_diff_has_harmless_changes(const diff *d)
Test if a union diff node does have changes that don't impact its size.
shared_ptr< diff > diff_sptr
Convenience typedef for a shared_ptr for the diff class.
void show_linkage_name_and_aliases(ostream &out, const string &indent, const elf_symbol &symbol, const string_elf_symbols_map_type &sym_map)
For a given symbol, emit a string made of its name and version. The string also contains the list of ...
void maybe_report_interfaces_impacted_by_diff(const diff *d, ostream &out, const string &indent)
If a given diff node impacts some public interfaces, then report about those impacted interfaces on a...
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,...
@ SUPPRESSED_CATEGORY
This means that a diff node was marked as suppressed by a user-provided suppression specification.
@ REDUNDANT_CATEGORY
A diff node in this category is redundant. That means it's present as a child of a other nodes in 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...
@ PRIVATE_TYPE_CATEGORY
This means that a diff node was warked as being for a private type. That is, the diff node is meant t...
@ 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 ...
@ HARMLESS_DECL_NAME_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless declaration name change....
@ HARMLESS_UNION_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless union change.
void maybe_report_diff_for_symbol(const elf_symbol_sptr &symbol1, const elf_symbol_sptr &symbol2, const diff_context_sptr &ctxt, ostream &out, const string &indent)
Report the difference between two ELF symbols, if there is any.
void sort_string_var_ptr_map(const string_var_ptr_map &map, vector< var_decl * > &sorted)
Sort a map of string -> pointer to var_decl.
void maybe_report_unreachable_type_changes(const corpus_diff &d, const corpus_diff::diff_stats &s, const string &indent, ostream &out)
Report changes about types that are not reachable from global functions and variables,...
shared_ptr< diff_context > diff_context_sptr
Convenience typedef for a shared pointer of diff_context.
void report_size_and_alignment_changes(type_or_decl_base_sptr first, type_or_decl_base_sptr second, diff_context_sptr ctxt, ostream &out, const string &indent)
Report the size and alignment changes of a type.
bool report_loc_info(const type_or_decl_base_sptr &tod, const diff_context &ctxt, ostream &out)
void sort_string_elf_symbol_map(const string_elf_symbol_map &map, vector< elf_symbol_sptr > &sorted)
Sort a map of string -> pointer to elf_symbol.
void sort_string_function_decl_diff_sptr_map(const string_function_decl_diff_sptr_map &map, function_decl_diff_sptrs_type &sorted)
Sort the values of a string_function_decl_diff_sptr_map map and store the result in a vector of funct...
bool maybe_report_diff_for_variable(const decl_base_sptr &decl1, const decl_base_sptr &decl2, const diff_context_sptr &ctxt, ostream &out, const string &indent)
Report the differences between two generic variables.
void maybe_report_base_class_reordering(const class_diff &d, ostream &out, const string &indent)
Report about the base classes of a class having been re-ordered.
void represent_data_member(var_decl_sptr d, const diff_context_sptr &ctxt, ostream &out, const string &indent)
Stream a string representation for a data member.
string get_pretty_representation(diff *d)
Get a copy of the pretty representation of a diff node.
shared_ptr< base_diff > base_diff_sptr
Convenience typedef for a shared pointer to a base_diff type.
shared_ptr< class_diff > class_diff_sptr
Convenience typedef for a shared pointer on a class_diff type.
void maybe_report_data_members_replaced_by_anon_dm(const class_or_union_diff &d, ostream &out, const string &indent)
Report about data members replaced by an anonymous data member without changing the overall bit-layou...
bool maybe_report_diff_for_member(const decl_base_sptr &decl1, const decl_base_sptr &decl2, const diff_context_sptr &ctxt, ostream &out, const string &indent)
Report the differences in access specifiers and static-ness for class members.
void report_mem_header(ostream &out, size_t number, size_t num_filtered, diff_kind k, const string §ion_name, const string &indent)
Output the header preceding the the report for insertion/deletion/change of a part of a class....
void sort_data_members(const string_decl_base_sptr_map &data_members, vector< decl_base_sptr > &sorted)
Sort a map of data members by the offset of their initial value.
void sort_changed_enumerators(const string_changed_enumerator_map &enumerators_map, changed_enumerators_type &sorted)
Sort a map of changed enumerators.
vector< changed_enumerator > changed_enumerators_type
Convenience typedef for a vector of changed enumerators.
void report_name_size_and_alignment_changes(decl_base_sptr first, decl_base_sptr second, diff_context_sptr ctxt, ostream &out, const string &indent)
Report the name, size and alignment changes of a type.
void represent(const diff_context &ctxt, method_decl_sptr mem_fn, ostream &out)
Stream a string representation for a member function.
void sort_enumerators(const string_enumerator_map &enumerators_map, enum_type_decl::enumerators &sorted)
Sort a map of enumerators by their value.
void sort_string_function_ptr_map(const string_function_ptr_map &map, vector< function_decl * > &sorted)
Sort an instance of string_function_ptr_map map and stuff a resulting sorted vector of pointers to fu...
shared_ptr< reference_type_def > reference_type_def_sptr
Convenience typedef for a shared pointer on a reference_type_def.
bool get_member_function_is_dtor(const function_decl &f)
Test whether a member function is a destructor.
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.
ssize_t get_member_function_vtable_offset(const function_decl &f)
Get the vtable offset of a member function.
bool is_type(const type_or_decl_base &tod)
Test whether a declaration is a type.
shared_ptr< elf_symbol > elf_symbol_sptr
A convenience typedef for a shared pointer to elf_symbol.
change_kind
A bitfield that gives callers of abigail::ir::equals() some insight about how different two internal ...
@ SUBTYPE_CHANGE_KIND
This means that a given IR artifact has changes in some of its sub-types, with respect to the other a...
@ ALL_LOCAL_CHANGES_MASK
Testing (anding) against this mask means that a given IR artifact has local differences,...
bool is_class_type(const type_or_decl_base &t)
Test whether a type is a class.
string get_pretty_representation(const type_or_decl_base *tod, bool internal)
Build and return a copy of the pretty representation of an ABI artifact that could be either a type o...
bool types_have_similar_structure(const type_base_sptr &first, const type_base_sptr &second, bool indirect_type)
Test if two types have similar structures, even though they are (or can be) different.
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.
shared_ptr< function_type > function_type_sptr
Convenience typedef for a shared pointer on a function_type.
shared_ptr< typedef_decl > typedef_decl_sptr
Convenience typedef for a shared pointer on a typedef_decl.
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
shared_ptr< type_or_decl_base > type_or_decl_base_sptr
A convenience typedef for a shared_ptr to type_or_decl_base.
bool equals(const decl_base &l, const decl_base &r, change_kind *k)
Compares two instances of decl_base.
bool is_member_function(const function_decl &f)
Test whether a function_decl is a member function.
bool is_c_language(translation_unit::language l)
Test if a language enumerator designates the C language.
string get_class_or_union_flat_representation(const class_or_union &cou, const string &indent, bool one_line, bool internal, bool qualified_names)
Get the flat representation of an instance of class_or_union type.
shared_ptr< enum_type_decl > enum_type_decl_sptr
Convenience typedef for shared pointer to a enum_type_decl.
type_base_sptr strip_typedef(const type_base_sptr type)
Recursively returns the the underlying type of a typedef. The return type should not be a typedef of ...
bool get_member_function_is_virtual(const function_decl &f)
Test if a given member function is virtual.
const decl_base * get_type_declaration(const type_base *t)
Get the declaration for a given type.
shared_ptr< type_decl > type_decl_sptr
Convenience typedef for a shared pointer on a type_decl.
translation_unit * get_translation_unit(const decl_base &decl)
Return the translation unit a declaration belongs to.
bool type_has_sub_type_changes(const type_base_sptr t_v1, const type_base_sptr t_v2)
Tests if the change of a given type effectively comes from just its sub-types. That is,...
method_type_sptr is_method_type(const type_or_decl_base_sptr &t)
Test whether a type is a method_type.
bool get_member_function_is_ctor(const function_decl &f)
Test whether a member function is a constructor.
Toplevel namespace for libabigail.