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()
107default_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 << (first->get_is_anonymous()
167 : i->get_qualified_name())
179 for (enum_type_decl::enumerators::const_iterator i =
180 sorted_inserted_enumerators.begin();
181 i != sorted_inserted_enumerators.end();
186 << (second->get_is_anonymous()
188 :i->get_qualified_name())
200 sorted_changed_enumerators);
201 for (changed_enumerators_type::const_iterator i =
202 sorted_changed_enumerators.begin();
203 i != sorted_changed_enumerators.end();
208 << (first->get_is_anonymous()
209 ? i->first.get_name()
210 : i->first.get_qualified_name())
212 << i->first.get_value() <<
"' to '"
213 << i->second.get_value() <<
"'";
219 if (ctxt->show_leaf_changes_only())
222 d.reported_once(
true);
239 const string& indent)
const
249 && ((d.
context()->get_allowed_category()
251 || d.
context()->show_leaf_changes_only()))
252 || f->get_qualified_name() != s->get_qualified_name())
254 out << indent <<
"typedef name changed from "
255 << f->get_qualified_name()
257 << s->get_qualified_name();
274 const string& indent)
const
285 if (dif && dif->has_changes())
287 if (dif->to_be_reported())
289 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif,
292 <<
"underlying type '"
293 << dif->first_subject()->get_pretty_representation() <<
"'";
295 out <<
" changed:\n";
296 dif->report(out, indent +
" ");
311 <<
"underlying type '"
312 << dif->first_subject()->get_pretty_representation() <<
"'";
314 out <<
" changed:\n";
317 dif->report(out, indent +
" ");
341 const string& indent)
const
351 out << indent <<
"'" << fname <<
"' changed to '" << sname <<
"'\n";
378 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif,
382 string fltname = dif->first_subject()->get_pretty_representation();
383 out << indent <<
"in unqualified underlying type '" << fltname <<
"'";
386 dif->report(out, indent +
" ");
398 const string& indent)
const
425default_reporter::report(
const pointer_diff& d, ostream& out,
426 const string& indent)
const
433 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif,
"pointed to type");
434 string repr = dif->first_subject()
435 ? dif->first_subject()->get_pretty_representation()
439 <<
"in pointed to type '" << repr <<
"'";
442 dif->report(out, indent +
" ");
457 const string& indent)
const
465 string f_repr = f->get_pretty_representation(),
466 s_repr = s->get_pretty_representation();
468 if (f->is_lvalue() != s->is_lvalue())
472 out <<
"lvalue reference type '" << f_repr
473 <<
" became an rvalue reference type: '"
477 out <<
"rvalue reference type '" << f_repr
478 <<
" became an lvalue reference type: '"
483 s->get_pointed_to_type().get()))
485 <<
"reference type changed from: '"
486 << f_repr <<
"' to: '" << s_repr <<
"'\n";
498 const string& indent)
const
513 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif,
517 <<
"in referenced type '"
518 << dif->first_subject()->get_pretty_representation() <<
"'";
521 dif->report(out, indent +
" ");
542 const std::string& indent)
const
555 string f_repr = f->get_pretty_representation(),
556 s_repr = s->get_pretty_representation();
559 out <<
"pointer-to-member type changed from: '"
560 << f_repr <<
" to: '"<< s_repr <<
"'\n";
576 const std::string& indent)
const
585 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2
586 (dif,
"data member type of pointer-to-member");
587 if (dif->to_be_reported())
590 <<
"in data member type '"
591 << dif->first_subject()->get_pretty_representation()
592 <<
"' of pointed-to-member type '"
597 dif->report(out, indent +
" ");
602 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2
603 (dif,
"containing type of pointer-to-member");
604 if (dif->to_be_reported())
607 <<
"in containing type '"
608 << dif->first_subject()->get_pretty_representation()
609 <<
"' of pointed-to-member type '"
614 dif->report(out, indent +
" ");
627default_reporter::report(
const fn_parm_diff& d, ostream& out,
628 const string& indent)
const
640 bool has_sub_type_change =
648 if (f->get_is_artificial())
650 out <<
"parameter " << f->get_index();
653 << f->get_type_pretty_representation();
655 if (has_sub_type_change)
656 out <<
"' has sub-type changes:\n";
658 out <<
"' changed:\n";
660 type_diff->report(out, indent +
" ");
674 const string& indent)
const
686 if (fft->get_size_in_bits() != sft->get_size_in_bits())
688 out << indent <<
"address size of function changed from "
689 << fft->get_size_in_bits()
691 << sft->get_size_in_bits()
696 if (fft->get_alignment_in_bits()
697 != sft->get_alignment_in_bits())
699 out << indent <<
"address alignment of function changed from "
700 << fft->get_alignment_in_bits()
702 << sft->get_alignment_in_bits()
710 for (vector<function_decl::parameter_sptr>::const_iterator i =
711 d.priv_->sorted_deleted_parms_.begin();
712 i != d.priv_->sorted_deleted_parms_.end();
715 out << indent <<
"parameter " << (*i)->get_index()
716 <<
" of type '" << (*i)->get_type_pretty_representation()
717 <<
"' was removed\n";
721 for (vector<function_decl::parameter_sptr>::const_iterator i =
722 d.priv_->sorted_added_parms_.begin();
723 i != d.priv_->sorted_added_parms_.end();
726 out << indent <<
"parameter " << (*i)->get_index()
727 <<
" of type '" << (*i)->get_type_pretty_representation()
741 const string& indent)
const
750 corpus_sptr fc = ctxt->get_first_corpus();
751 corpus_sptr sc = ctxt->get_second_corpus();
754 if (d.priv_->return_type_diff_
755 && d.priv_->return_type_diff_->to_be_reported())
757 out << indent <<
"return type changed:\n";
758 d.priv_->return_type_diff_->report(out, indent +
" ");
762 for (vector<fn_parm_diff_sptr>::const_iterator i =
763 d.priv_->sorted_subtype_changed_parms_.begin();
764 i != d.priv_->sorted_subtype_changed_parms_.end();
768 if (dif && dif->to_be_reported())
769 dif->report(out, indent);
786 const std::string& indent)
const
791 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER3(d.
first_subrange(),
806default_reporter::report(
const array_diff& d, ostream& out,
807 const string& indent)
const
812 string name = d.
first_array()->get_pretty_representation();
813 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER3(d.
first_array(),
818 if (dif->to_be_reported())
822 out << indent <<
"array element type '"
823 << fn <<
"' changed:\n";
824 dif->report(out, indent +
" ");
842default_reporter::report(
const base_diff& d, ostream& out,
843 const string& indent)
const
845 if (!d.to_be_reported())
849 string repr = f->get_base_class()->get_pretty_representation();
850 bool emitted =
false;
852 if (!d.is_filtered_out_without_looking_at_allowed_changes())
854 if (f->get_is_static() != s->get_is_static())
856 if (f->get_is_static())
857 out << indent <<
"is no more static";
859 out << indent <<
"now becomes static";
864 && (f->get_access_specifier() != s->get_access_specifier()))
869 out <<
"has access changed from '"
870 << f->get_access_specifier()
872 << s->get_access_specifier()
880 if (dif->to_be_reported())
884 dif->report(out, indent);
897default_reporter::report(
const scope_diff& d, ostream& out,
898 const string& indent)
const
900 if (!d.to_be_reported())
904 unsigned num_changed_types = d.changed_types().size();
905 if (num_changed_types == 0)
907 else if (num_changed_types == 1)
908 out << indent <<
"1 changed type:\n";
910 out << indent << num_changed_types <<
" changed types:\n";
912 for (diff_sptrs_type::const_iterator dif = d.changed_types().begin();
913 dif != d.changed_types().end();
919 out << indent <<
" '"
920 << (*dif)->first_subject()->get_pretty_representation()
922 (*dif)->report(out, indent +
" ");
926 unsigned num_changed_decls = d.changed_decls().size();
927 if (num_changed_decls == 0)
929 else if (num_changed_decls == 1)
930 out << indent <<
"1 changed declaration:\n";
932 out << indent << num_changed_decls <<
" changed declarations:\n";
934 for (diff_sptrs_type::const_iterator dif= d.changed_decls().begin();
935 dif != d.changed_decls().end ();
941 out << indent <<
" '"
942 << (*dif)->first_subject()->get_pretty_representation()
943 <<
"' was changed to '"
944 << (*dif)->second_subject()->get_pretty_representation() <<
"'";
948 (*dif)->report(out, indent +
" ");
952 for (string_decl_base_sptr_map::const_iterator i =
953 d.priv_->deleted_types_.begin();
954 i != d.priv_->deleted_types_.end();
958 << i->second->get_pretty_representation()
959 <<
"' was removed\n";
961 if (d.priv_->deleted_types_.size())
964 for (string_decl_base_sptr_map::const_iterator i =
965 d.priv_->deleted_decls_.begin();
966 i != d.priv_->deleted_decls_.end();
970 << i->second->get_pretty_representation()
971 <<
"' was removed\n";
973 if (d.priv_->deleted_decls_.size())
977 bool emitted =
false;
978 for (string_decl_base_sptr_map::const_iterator i =
979 d.priv_->inserted_types_.begin();
980 i != d.priv_->inserted_types_.end();
985 if (dynamic_pointer_cast<type_decl>(i->second))
989 << i->second->get_pretty_representation()
998 for (string_decl_base_sptr_map::const_iterator i =
999 d.priv_->inserted_decls_.begin();
1000 i != d.priv_->inserted_decls_.end();
1005 if (dynamic_pointer_cast<type_decl>(i->second))
1009 << i->second->get_pretty_representation()
1027default_reporter::report(
const class_or_union_diff& d,
1029 const string& indent)
const
1031 if (!d.to_be_reported())
1034 class_or_union_sptr first = d.first_class_or_union(),
1035 second = d.second_class_or_union();
1044 first->get_is_declaration_only()
1045 ?
" was a declaration-only type"
1046 :
" was a defined type";
1049 second->get_is_declaration_only()
1050 ?
" and is now a declaration-only type"
1051 :
" and is now a defined type";
1053 out << indent <<
"type " << first->get_pretty_representation()
1054 << was << is_now <<
"\n";
1059 if (d.member_fns_changes())
1062 int numdels = d.get_priv()->deleted_member_functions_.size();
1063 size_t num_filtered =
1064 d.get_priv()->count_filtered_deleted_mem_fns(ctxt);
1067 "member function", indent);
1068 for (class_or_union::member_functions::const_iterator i =
1069 d.get_priv()->sorted_deleted_member_functions_.begin();
1070 i != d.get_priv()->sorted_deleted_member_functions_.end();
1073 if (!(ctxt->get_allowed_category()
1078 method_decl_sptr mem_fun = *i;
1079 out << indent <<
" ";
1084 int numins = d.get_priv()->inserted_member_functions_.size();
1085 num_filtered = d.get_priv()->count_filtered_inserted_mem_fns(ctxt);
1088 "member function", indent);
1089 for (class_or_union::member_functions::const_iterator i =
1090 d.get_priv()->sorted_inserted_member_functions_.begin();
1091 i != d.get_priv()->sorted_inserted_member_functions_.end();
1094 if (!(ctxt->get_allowed_category()
1099 method_decl_sptr mem_fun = *i;
1100 out << indent <<
" ";
1105 int numchanges = d.get_priv()->sorted_changed_member_functions_.size();
1106 num_filtered = d.get_priv()->count_filtered_changed_mem_fns(ctxt);
1109 "member function", indent);
1110 for (function_decl_diff_sptrs_type::const_iterator i =
1111 d.get_priv()->sorted_changed_member_functions_.begin();
1112 i != d.get_priv()->sorted_changed_member_functions_.end();
1115 if (!(ctxt->get_allowed_category()
1118 ((*i)->first_function_decl()))
1120 ((*i)->second_function_decl())))
1124 if (!diff || !diff->to_be_reported())
1128 (*i)->first_function_decl()->get_pretty_representation();
1129 out << indent <<
" '" << repr <<
"' has some sub-type changes:\n";
1130 diff->report(out, indent +
" ");
1135 if (d.data_members_changes())
1138 int numdels = d.class_or_union_diff::get_priv()->
1139 get_deleted_non_static_data_members_number();
1143 "data member", indent);
1144 vector<decl_base_sptr> sorted_dms;
1146 (d.class_or_union_diff::get_priv()->deleted_data_members_,
1148 for (vector<decl_base_sptr>::const_iterator i = sorted_dms.begin();
1149 i != sorted_dms.end();
1153 dynamic_pointer_cast<var_decl>(*i);
1163 d.class_or_union_diff::get_priv()->inserted_data_members_.size();
1167 "data member", indent);
1168 vector<decl_base_sptr> sorted_dms;
1170 (d.class_or_union_diff::get_priv()->inserted_data_members_,
1172 for (vector<decl_base_sptr>::const_iterator i = sorted_dms.begin();
1173 i != sorted_dms.end();
1177 dynamic_pointer_cast<var_decl>(*i);
1184 size_t num_changes =
1185 (d.sorted_subtype_changed_data_members().size()
1186 + d.sorted_changed_data_members().size());
1188 size_t num_changes_filtered =
1189 (d.count_filtered_subtype_changed_data_members()
1190 + d.count_filtered_changed_data_members());
1195 change_kind,
"data member", indent);
1197 for (var_diff_sptrs_type::const_iterator it =
1198 d.sorted_changed_data_members().begin();
1199 it != d.sorted_changed_data_members().end();
1201 if ((*it)->to_be_reported())
1202 represent(*it, ctxt, out, indent +
" ");
1204 for (var_diff_sptrs_type::const_iterator it =
1205 d.sorted_subtype_changed_data_members().begin();
1206 it != d.sorted_subtype_changed_data_members().end();
1208 if ((*it)->to_be_reported())
1209 represent(*it, ctxt, out, indent +
" ");
1218 if (
const edit_script& e = d.member_types_changes())
1221 d.class_or_union_diff::get_priv()->sorted_changed_member_types_.size();
1223 d.class_or_union_diff::get_priv()->deleted_member_types_.size();
1229 "member type", indent);
1231 for (string_decl_base_sptr_map::const_iterator i =
1232 d.class_or_union_diff::get_priv()->deleted_member_types_.begin();
1233 i != d.class_or_union_diff::get_priv()->deleted_member_types_.end();
1236 decl_base_sptr mem_type = i->second;
1237 out << indent <<
" '"
1238 << mem_type->get_pretty_representation()
1247 "member type", indent);
1249 for (diff_sptrs_type::const_iterator it =
1250 d.class_or_union_diff::get_priv()->sorted_changed_member_types_.begin();
1251 it != d.class_or_union_diff::get_priv()->sorted_changed_member_types_.end();
1254 if (!(*it)->to_be_reported())
1259 out << indent <<
" '"
1260 << o->get_pretty_representation()
1264 (*it)->report(out, indent +
" ");
1270 int numins = e.num_insertions();
1272 numins -= numchanges;
1277 "member type", indent);
1279 for (vector<insertion>::const_iterator i = e.insertions().begin();
1280 i != e.insertions().end();
1283 type_base_sptr mem_type;
1284 for (vector<unsigned>::const_iterator j =
1285 i->inserted_indexes().begin();
1286 j != i->inserted_indexes().end();
1289 mem_type = second->get_member_types()[*j];
1290 if (!d.class_or_union_diff::get_priv()->
1293 out << indent <<
" '"
1305 if (
const edit_script& e = d.member_fn_tmpls_changes())
1308 int numdels = e.num_deletions();
1311 "member function template", indent);
1312 for (vector<deletion>::const_iterator i = e.deletions().begin();
1313 i != e.deletions().end();
1316 member_function_template_sptr mem_fn_tmpl =
1317 first->get_member_function_templates()[i->index()];
1318 out << indent <<
" '"
1319 << mem_fn_tmpl->as_function_tdecl()->get_pretty_representation()
1324 int numins = e.num_insertions();
1327 "member function template", indent);
1328 for (vector<insertion>::const_iterator i = e.insertions().begin();
1329 i != e.insertions().end();
1332 member_function_template_sptr mem_fn_tmpl;
1333 for (vector<unsigned>::const_iterator j =
1334 i->inserted_indexes().begin();
1335 j != i->inserted_indexes().end();
1338 mem_fn_tmpl = second->get_member_function_templates()[*j];
1339 out << indent <<
" '"
1340 << mem_fn_tmpl->as_function_tdecl()->
1348 if (
const edit_script& e = d.member_class_tmpls_changes())
1351 int numdels = e.num_deletions();
1354 "member class template", indent);
1355 for (vector<deletion>::const_iterator i = e.deletions().begin();
1356 i != e.deletions().end();
1359 member_class_template_sptr mem_cls_tmpl =
1360 first->get_member_class_templates()[i->index()];
1361 out << indent <<
" '"
1362 << mem_cls_tmpl->as_class_tdecl()->get_pretty_representation()
1367 int numins = e.num_insertions();
1370 "member class template", indent);
1371 for (vector<insertion>::const_iterator i = e.insertions().begin();
1372 i != e.insertions().end();
1375 member_class_template_sptr mem_cls_tmpl;
1376 for (vector<unsigned>::const_iterator j =
1377 i->inserted_indexes().begin();
1378 j != i->inserted_indexes().end();
1381 mem_cls_tmpl = second->get_member_class_templates()[*j];
1382 out << indent <<
" '"
1383 << mem_cls_tmpl->as_class_tdecl()
1384 ->get_pretty_representation()
1401default_reporter::report(
const class_diff& d, ostream& out,
1402 const string& indent)
const
1404 if (!d.to_be_reported())
1407 string name = d.first_subject()->get_pretty_representation();
1409 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER(d.first_subject(),
1410 d.second_subject());
1412 d.currently_reporting(
true);
1416 second = d.second_class_decl();
1425 if (d.base_changes())
1428 int numdels = d.get_priv()->deleted_bases_.size();
1429 size_t numchanges = d.get_priv()->sorted_changed_bases_.size();
1434 "base class", indent);
1436 for (class_decl::base_specs::const_iterator i
1437 = d.get_priv()->sorted_deleted_bases_.begin();
1438 i != d.get_priv()->sorted_deleted_bases_.end();
1441 if (i != d.get_priv()->sorted_deleted_bases_.begin())
1446 if (d.get_priv()->base_has_changed(base))
1448 out << indent <<
" "
1449 << base->get_base_class()->get_pretty_representation();
1456 size_t num_filtered = d.get_priv()->count_filtered_bases();
1460 "base class", indent);
1461 for (base_diff_sptrs_type::const_iterator it =
1462 d.get_priv()->sorted_changed_bases_.begin();
1463 it != d.get_priv()->sorted_changed_bases_.end();
1467 if (!diff || !diff->to_be_reported())
1471 out << indent <<
" '"
1472 << o->get_base_class()->get_pretty_representation() <<
"'";
1474 out <<
" changed:\n";
1475 diff->report(out, indent +
" ");
1480 int numins = d.get_priv()->inserted_bases_.size();
1484 "base class", indent);
1486 for (class_decl::base_specs::const_iterator i =
1487 d.get_priv()->sorted_inserted_bases_.begin();
1488 i != d.get_priv()->sorted_inserted_bases_.end();
1492 out << indent <<
" " << b->get_pretty_representation();
1502 d.class_or_union_diff::report(out, indent);
1504 d.currently_reporting(
false);
1506 d.reported_once(
true);
1519default_reporter::report(
const union_diff& d, ostream& out,
1520 const string& indent)
const
1522 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER(d.first_subject(),
1523 d.second_subject());
1525 d.currently_reporting(
true);
1528 union_decl_sptr first = d.first_union_decl(), second = d.second_union_decl();
1535 d.class_or_union_diff::report(out, indent);
1543 out << indent <<
"type changed from:\n"
1549 << indent <<
"to:\n"
1557 d.currently_reporting(
false);
1559 d.reported_once(
true);
1571default_reporter::report(
const distinct_diff& d, ostream& out,
1572 const string& indent)
const
1574 if (!d.to_be_reported())
1579 string f_repr = f ? f->get_pretty_representation() :
"'void'";
1580 string s_repr = s ? s->get_pretty_representation() :
"'void'";
1582 diff_sptr diff = d.compatible_child_diff();
1584 string compatible = diff ?
" to compatible type '":
" to '";
1586 out << indent <<
"entity changed from '" << f_repr <<
"'"
1587 << compatible << s_repr <<
"'";
1595 diff->report(out, indent +
" ");
1609default_reporter::report(
const function_decl_diff& d, ostream& out,
1610 const string& indent)
const
1612 if (!d.to_be_reported())
1616 d.second_function_decl(),
1617 d.context(), out, indent);
1623 corpus_sptr fc = ctxt->get_first_corpus();
1624 corpus_sptr sc = ctxt->get_second_corpus();
1627 string qn1 = ff->get_qualified_name(), qn2 = sf->get_qualified_name(),
1628 linkage_names1, linkage_names2;
1632 linkage_names1 = s1->get_id_string();
1634 linkage_names2 = s2->get_id_string();
1640 s1->get_aliases_id_string(fc->get_fun_symbol_map());
1643 s2->get_aliases_id_string(sc->get_fun_symbol_map());
1645 if (!d.is_filtered_out_without_looking_at_allowed_changes())
1649 if (linkage_names1 != linkage_names2)
1651 if (linkage_names1.empty())
1653 out << indent << ff->get_pretty_representation()
1654 <<
" didn't have any linkage name, and it now has: '"
1655 << linkage_names2 <<
"'\n";
1657 else if (linkage_names2.empty())
1659 out << indent << ff->get_pretty_representation()
1660 <<
" did have linkage names '" << linkage_names1
1662 << indent <<
"but it doesn't have any linkage name anymore\n";
1665 out << indent <<
"linkage names of "
1666 << ff->get_pretty_representation()
1667 <<
"\n" << indent <<
"changed from '"
1668 << linkage_names1 <<
"' to '" << linkage_names2 <<
"'\n";
1673 && d.type_diff()->to_be_reported())
1679 string frep1 = d.first_function_decl()->get_pretty_representation(),
1680 frep2 = d.second_function_decl()->get_pretty_representation();
1681 out << indent <<
"'" << frep1 <<
" {" << linkage_names1<<
"}"
1682 <<
"' now becomes '"
1683 << frep2 <<
" {" << linkage_names2 <<
"}" <<
"'\n";
1688 d.context(), out, indent);
1691 if (ff->is_declared_inline() != sf->is_declared_inline())
1694 if (ff->is_declared_inline())
1695 out << sf->get_pretty_representation()
1696 <<
" is not declared inline anymore\n";
1698 out << sf->get_pretty_representation()
1699 <<
" is now declared inline\n";
1707 if (ff_is_virtual != sf_is_virtual)
1711 out << ff->get_pretty_representation()
1712 <<
" is no more declared virtual\n";
1714 out << ff->get_pretty_representation()
1715 <<
" is now declared virtual\n";
1720 if (ff_is_virtual && sf_is_virtual
1721 && (ff_vtable_offset != sf_vtable_offset))
1724 <<
"the vtable offset of " << ff->get_pretty_representation()
1725 <<
" changed from " << ff_vtable_offset
1726 <<
" to " << sf_vtable_offset <<
"\n";
1731 class_or_union_sptr f =
1733 class_or_union_sptr s =
1741 bool vtable_added =
false, vtable_removed =
false;
1742 if (!f->get_is_declaration_only() && !s->get_is_declaration_only())
1746 vtable_added = !fc->has_vtable() && sc->has_vtable();
1747 vtable_removed = fc->has_vtable() && !sc->has_vtable();
1750 bool vtable_changed = ((ff_is_virtual != sf_is_virtual)
1751 || (ff_vtable_offset != sf_vtable_offset));
1752 bool incompatible_change = (ff_vtable_offset != sf_vtable_offset);
1756 <<
" note that a vtable was added to "
1757 << fc->get_pretty_representation()
1759 else if (vtable_removed)
1761 <<
" note that the vtable was removed from "
1762 << fc->get_pretty_representation()
1764 else if (vtable_changed)
1767 if (incompatible_change)
1768 out <<
" note that this is an ABI incompatible "
1769 "change to the vtable of ";
1771 out <<
" note that this induces a change to the vtable of ";
1772 out << fc->get_pretty_representation()
1780 if (d.type_diff() && d.type_diff()->to_be_reported())
1781 d.type_diff()->report(out, indent);
1794default_reporter::report(
const var_diff& d, ostream& out,
1795 const string& indent)
const
1797 if (!d.to_be_reported())
1800 decl_base_sptr first = d.first_var(), second = d.second_var();
1801 string n = first->get_pretty_representation();
1803 if (!d.is_filtered_out_without_looking_at_allowed_changes())
1810 d.second_var()->get_symbol(),
1811 d.context(), out, indent);
1820 if (dif->to_be_reported())
1822 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif,
"type");
1823 out << indent <<
"type of variable changed:\n";
1824 dif->report(out, indent +
" ");
1838default_reporter::report(
const translation_unit_diff& d,
1840 const string& indent)
const
1842 static_cast<const scope_diff&
>(d).report(out, indent);
1854default_reporter::report(
const corpus_diff& d, ostream& out,
1855 const string& indent)
const
1857 const corpus_diff::diff_stats &s =
1858 const_cast<corpus_diff&
>(d).
1859 apply_filters_and_suppressions_before_reporting();
1863 d.priv_->emit_diff_stats(s, out, indent);
1864 if (ctxt->show_stats_only())
1868 if (ctxt->show_soname_change()
1869 && !d.priv_->sonames_equal_)
1870 out << indent <<
"SONAME changed from '"
1871 << d.first_corpus()->get_soname() <<
"' to '"
1872 << d.second_corpus()->get_soname() <<
"'\n\n";
1874 if (ctxt->show_architecture_change()
1875 && !d.priv_->architectures_equal_)
1876 out << indent <<
"architecture changed from '"
1877 << d.first_corpus()->get_architecture_name() <<
"' to '"
1878 << d.second_corpus()->get_architecture_name() <<
"'\n\n";
1881 if (ctxt->show_deleted_fns())
1883 if (s.net_num_func_removed() == 1)
1884 out << indent <<
"1 Removed function:\n\n";
1885 else if (s.net_num_func_removed() > 1)
1886 out << indent << s.net_num_func_removed() <<
" Removed functions:\n\n";
1888 bool emitted =
false;
1891 for (
auto f : sorted_deleted_fns)
1893 if (d.priv_->deleted_function_is_suppressed(f))
1900 if (ctxt->show_linkage_names())
1904 d.first_corpus()->get_fun_symbol_map());
1914 <<
"note that this removes an entry from the vtable of "
1915 << c->get_pretty_representation()
1924 if (ctxt->show_added_fns())
1926 if (s.net_num_func_added() == 1)
1927 out << indent <<
"1 Added function:\n\n";
1928 else if (s.net_num_func_added() > 1)
1929 out << indent << s.net_num_func_added()
1930 <<
" Added functions:\n\n";
1931 bool emitted =
false;
1934 for (
auto f : sorted_added_fns)
1936 if (d.priv_->added_function_is_suppressed(f))
1944 << f->get_pretty_representation()
1946 if (ctxt->show_linkage_names())
1950 (out,
"", *f->get_symbol(),
1951 d.second_corpus()->get_fun_symbol_map());
1961 <<
"note that this adds a new entry to the vtable of "
1962 << c->get_pretty_representation()
1971 if (ctxt->show_changed_fns())
1973 size_t num_changed = s.num_func_changed() - s.num_changed_func_filtered_out();
1974 if (num_changed == 1)
1975 out << indent <<
"1 function with some indirect sub-type change:\n\n";
1976 else if (num_changed > 1)
1977 out << indent << num_changed
1978 <<
" functions with some indirect sub-type change:\n\n";
1980 vector<function_decl_diff_sptr> sorted_changed_fns;
1982 sorted_changed_fns);
1983 for (vector<function_decl_diff_sptr>::const_iterator i =
1984 sorted_changed_fns.begin();
1985 i != sorted_changed_fns.end();
1992 if (diff->to_be_reported())
1995 out << indent <<
" [C] '"
1996 << fn->get_pretty_representation() <<
"'";
1998 out <<
" has some indirect sub-type changes:\n";
2002 (fn->get_symbol()->has_aliases()
2014 && fn->get_name() != fn->get_symbol()->get_name()))
2020 int number_of_aliases =
2021 fn->get_symbol()->get_number_of_aliases();
2022 if (number_of_aliases == 0)
2024 out << indent <<
" "
2025 <<
"Please note that the exported symbol of "
2027 << fn->get_symbol()->get_id_string()
2032 out << indent <<
" "
2033 <<
"Please note that the symbol of this function is "
2034 << fn->get_symbol()->get_id_string()
2035 <<
"\n and it aliases symbol";
2036 if (number_of_aliases > 1)
2039 << fn->get_symbol()->get_aliases_id_string(
false)
2043 diff->report(out, indent +
" ");
2052 if (ctxt->show_deleted_vars())
2054 if (s.net_num_vars_removed() == 1)
2055 out << indent <<
"1 Removed variable:\n\n";
2056 else if (s.net_num_vars_removed() > 1)
2057 out << indent << s.net_num_vars_removed()
2058 <<
" Removed variables:\n\n";
2060 bool emitted =
false;
2063 for (
auto v : sorted_deleted_vars)
2065 if (d.priv_->deleted_variable_is_suppressed(v))
2068 n = v->get_pretty_representation();
2076 if (ctxt->show_linkage_names())
2080 d.first_corpus()->get_var_symbol_map());
2090 if (ctxt->show_added_vars())
2092 if (s.net_num_vars_added() == 1)
2093 out << indent <<
"1 Added variable:\n\n";
2094 else if (s.net_num_vars_added() > 1)
2095 out << indent << s.net_num_vars_added()
2096 <<
" Added variables:\n\n";
2098 bool emitted =
false;
2101 for (
auto v : sorted_added_vars)
2103 if (d.priv_->added_variable_is_suppressed(v))
2106 n = v->get_pretty_representation();
2111 out <<
"'" << n <<
"'";
2112 if (ctxt->show_linkage_names())
2116 d.second_corpus()->get_var_symbol_map());
2126 if (ctxt->show_changed_vars())
2128 size_t num_changed =
2129 s.num_vars_changed() - s.num_changed_vars_filtered_out();
2130 if (num_changed == 1)
2131 out << indent <<
"1 Changed variable:\n\n";
2132 else if (num_changed > 1)
2133 out << indent << num_changed
2134 <<
" Changed variables:\n\n";
2137 for (var_diff_sptrs_type::const_iterator i =
2138 d.priv_->sorted_changed_vars_.begin();
2139 i != d.priv_->sorted_changed_vars_.end();
2147 if (!diff->to_be_reported())
2150 n1 = diff->first_subject()->get_pretty_representation();
2151 n2 = diff->second_subject()->get_pretty_representation();
2153 out << indent <<
" [C] '" << n1 <<
"' was changed";
2155 out <<
" to '" << n2 <<
"'";
2158 diff->report(out, indent +
" ");
2166 if (ctxt->show_symbols_unreferenced_by_debug_info()
2167 && d.priv_->deleted_unrefed_fn_syms_.size())
2169 if (s.net_num_removed_func_syms() == 1)
2171 <<
"1 Removed function symbol not referenced by debug info:\n\n";
2172 else if (s.net_num_removed_func_syms() > 0)
2174 << s.net_num_removed_func_syms()
2175 <<
" Removed function symbols not referenced by debug info:\n\n";
2177 bool emitted =
false;
2178 vector<elf_symbol_sptr> sorted_deleted_unrefed_fn_syms;
2180 sorted_deleted_unrefed_fn_syms);
2181 for (vector<elf_symbol_sptr>::const_iterator i =
2182 sorted_deleted_unrefed_fn_syms.begin();
2183 i != sorted_deleted_unrefed_fn_syms.end();
2186 if (d.priv_->deleted_unrefed_fn_sym_is_suppressed((*i).get()))
2189 out << indent <<
" ";
2193 d.first_corpus()->get_fun_symbol_map());
2202 if (ctxt->show_symbols_unreferenced_by_debug_info()
2203 && ctxt->show_added_symbols_unreferenced_by_debug_info()
2204 && d.priv_->added_unrefed_fn_syms_.size())
2206 if (s.net_num_added_func_syms() == 1)
2208 <<
"1 Added function symbol not referenced by debug info:\n\n";
2209 else if (s.net_num_added_func_syms() > 0)
2211 << s.net_num_added_func_syms()
2212 <<
" Added function symbols not referenced by debug info:\n\n";
2214 bool emitted =
false;
2215 vector<elf_symbol_sptr> sorted_added_unrefed_fn_syms;
2217 sorted_added_unrefed_fn_syms);
2218 for (vector<elf_symbol_sptr>::const_iterator i =
2219 sorted_added_unrefed_fn_syms.begin();
2220 i != sorted_added_unrefed_fn_syms.end();
2223 if (d.priv_->added_unrefed_fn_sym_is_suppressed((*i).get()))
2226 out << indent <<
" ";
2230 d.second_corpus()->get_fun_symbol_map());
2239 if (ctxt->show_symbols_unreferenced_by_debug_info()
2240 && d.priv_->deleted_unrefed_var_syms_.size())
2242 if (s.net_num_removed_var_syms() == 1)
2244 <<
"1 Removed variable symbol not referenced by debug info:\n\n";
2245 else if (s.net_num_removed_var_syms() > 0)
2247 << s.net_num_removed_var_syms()
2248 <<
" Removed variable symbols not referenced by debug info:\n\n";
2250 bool emitted =
false;
2251 vector<elf_symbol_sptr> sorted_deleted_unrefed_var_syms;
2253 sorted_deleted_unrefed_var_syms);
2254 for (vector<elf_symbol_sptr>::const_iterator i =
2255 sorted_deleted_unrefed_var_syms.begin();
2256 i != sorted_deleted_unrefed_var_syms.end();
2259 if (d.priv_->deleted_unrefed_var_sym_is_suppressed((*i).get()))
2262 out << indent <<
" ";
2267 d.first_corpus()->get_fun_symbol_map());
2277 if (ctxt->show_symbols_unreferenced_by_debug_info()
2278 && ctxt->show_added_symbols_unreferenced_by_debug_info()
2279 && d.priv_->added_unrefed_var_syms_.size())
2281 if (s.net_num_added_var_syms() == 1)
2283 <<
"1 Added variable symbol not referenced by debug info:\n\n";
2284 else if (s.net_num_added_var_syms() > 0)
2286 << s.net_num_added_var_syms()
2287 <<
" Added variable symbols not referenced by debug info:\n\n";
2289 bool emitted =
false;
2290 vector<elf_symbol_sptr> sorted_added_unrefed_var_syms;
2292 sorted_added_unrefed_var_syms);
2293 for (vector<elf_symbol_sptr>::const_iterator i =
2294 sorted_added_unrefed_var_syms.begin();
2295 i != sorted_added_unrefed_var_syms.end();
2298 if (d.priv_->added_unrefed_var_sym_is_suppressed((*i).get()))
2301 out << indent <<
" ";
2304 d.second_corpus()->get_fun_symbol_map());
2316 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_ptr_to_mbr_type_changes(const ptr_to_mbr_diff &d, std::ostream &out, const std::string &indent="") const
Report the local changes carried by a ptr_to_mbr_diff diff node.
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 parameters.
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 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.
The abstraction of a diff between two ptr_to_mbr_type.
ptr_to_mbr_type_sptr first_ptr_to_mbr_type() const
Getter of the first pointer-to-member subject of the current diff node.
const diff_sptr containing_type_diff() const
Getter of the diff node carrying changes to the containing type of first subject of the current diff ...
const diff_sptr member_type_diff() const
Getter of the diff node carrying changes to the member type of first subject of the current diff node...
ptr_to_mbr_type_sptr second_ptr_to_mbr_type() const
Getter of the second pointer-to-member subject of the current diff node.
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.
vector< const var_decl * > variables
Convenience typedef for std::vector<abigail::ir::var_decl*>
vector< const function_decl * > functions
Convenience typedef for std::vector<abigail::ir::function_decl*>
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_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....
void sort_string_function_ptr_map(const string_function_ptr_map &map, vector< const function_decl * > &sorted)
Sort an instance of string_function_ptr_map map and stuff a resulting sorted vector of pointers to fu...
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 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_string_var_ptr_map(const string_var_ptr_map &map, vector< const var_decl * > &sorted)
Sort a map of string -> pointer to var_decl.
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.
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< ptr_to_mbr_type > ptr_to_mbr_type_sptr
Convenience typedef for a shared pointer to a ptr_to_mbr_type.
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.