16#include "abg-reporter-priv.h"
48 apply_filters_and_suppressions_before_reporting();
86 bool started_to_emit =
false;
87 for (diff_ptrs_type::const_iterator i = sorted_diffs.begin();
88 i != sorted_diffs.end();
100 string n = (*i)->first_subject()->get_pretty_representation();
102 out << indent <<
"'" << n;
105 *(*i)->context(), out);
107 out <<
"' changed:\n";
109 (*i)->get_canonical_diff()->report(out, indent +
" ");
110 started_to_emit =
true;
123report_type_changes_from_diff_maps(
const leaf_reporter& reporter,
124 const diff_maps& maps,
126 const string& indent)
129 report_diffs(reporter, maps.get_type_decl_diff_map(), out, indent);
132 report_diffs(reporter, maps.get_enum_diff_map(), out, indent);
135 report_diffs(reporter, maps.get_class_diff_map(), out, indent);
138 report_diffs(reporter, maps.get_union_diff_map(), out, indent);
141 report_diffs(reporter, maps.get_typedef_diff_map(), out, indent);
144 report_diffs(reporter, maps.get_subrange_diff_map(), out, indent);
147 report_diffs(reporter, maps.get_array_diff_map(), out, indent);
153 report_diffs(reporter, maps.get_distinct_diff_map(), out, indent);
156 report_diffs(reporter, maps.get_fn_parm_diff_map(), out, indent);
169 const string& indent)
const
171 report_type_changes_from_diff_maps(*
this, maps, out, indent);
188 const string& indent)
const
195 default_reporter::report(d, out, indent);
207 const string& indent)
const
226leaf_reporter::report(
const pointer_diff &d,
228 const string& indent)
const
236 <<
"pointer type changed from: '"
237 << d.first_pointer()->get_pretty_representation()
239 << d.second_pointer()->get_pretty_representation()
249leaf_reporter::report(
const reference_diff& d,
251 const string& indent)
const
266 const std::string& indent)
const
282 const string& indent)
const
292 <<
"parameter " << f->get_index();
297 << f->get_type_pretty_representation()
299 d.
type_diff()->report(out, indent +
" ");
310 const string& indent)
const
319 out << indent <<
"return type changed:\n";
320 d.priv_->return_type_diff_->report(out, indent +
" ");
326 for (vector<fn_parm_diff_sptr>::const_iterator i =
327 d.priv_->sorted_subtype_changed_parms_.begin();
328 i != d.priv_->sorted_subtype_changed_parms_.end();
333 dif->report(out, indent);
343leaf_reporter::report(
const scope_diff& d,
345 const string& indent)
const
347 if (!d.to_be_reported())
351 unsigned num_changed_types = d.changed_types().size();
352 if (num_changed_types)
353 out << indent <<
"changed types:\n";
355 for (diff_sptrs_type::const_iterator dif = d.changed_types().begin();
356 dif != d.changed_types().end();
362 out << indent <<
" '"
363 << (*dif)->first_subject()->get_pretty_representation()
365 (*dif)->report(out, indent +
" ");
369 unsigned num_changed_decls = d.changed_decls().size();
370 if (num_changed_decls)
371 out << indent <<
"changed declarations:\n";
373 for (diff_sptrs_type::const_iterator dif= d.changed_decls().begin();
374 dif != d.changed_decls().end ();
380 out << indent <<
" '"
381 << (*dif)->first_subject()->get_pretty_representation()
382 <<
"' was changed to '"
383 << (*dif)->second_subject()->get_pretty_representation() <<
"'";
387 (*dif)->report(out, indent +
" ");
391 for (string_decl_base_sptr_map::const_iterator i =
392 d.priv_->deleted_types_.begin();
393 i != d.priv_->deleted_types_.end();
397 << i->second->get_pretty_representation()
398 <<
"' was removed\n";
400 if (d.priv_->deleted_types_.size())
403 for (string_decl_base_sptr_map::const_iterator i =
404 d.priv_->deleted_decls_.begin();
405 i != d.priv_->deleted_decls_.end();
409 << i->second->get_pretty_representation()
410 <<
"' was removed\n";
412 if (d.priv_->deleted_decls_.size())
416 bool emitted =
false;
417 for (string_decl_base_sptr_map::const_iterator i =
418 d.priv_->inserted_types_.begin();
419 i != d.priv_->inserted_types_.end();
424 if (dynamic_pointer_cast<type_decl>(i->second))
428 << i->second->get_pretty_representation()
437 for (string_decl_base_sptr_map::const_iterator i =
438 d.priv_->inserted_decls_.begin();
439 i != d.priv_->inserted_decls_.end();
444 if (dynamic_pointer_cast<type_decl>(i->second))
448 << i->second->get_pretty_representation()
467 const std::string& indent)
const
472 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER3(d.
first_subrange(),
489 const string& indent)
const
494 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER3(d.
first_array(),
508 out << indent <<
"array element type '"
509 << fn <<
"' changed: \n";
510 dif->report(out, indent +
" ");
522leaf_reporter::report(
const class_or_union_diff& d,
524 const string& indent)
const
529 class_or_union_sptr first = d.first_class_or_union(),
530 second = d.second_class_or_union();
539 first->get_is_declaration_only()
540 ?
" was a declaration-only type"
541 :
" was a defined type";
544 second->get_is_declaration_only()
545 ?
" and is now a declaration-only type"
546 :
" and is now a defined type";
548 out << indent <<
"type " << first->get_pretty_representation()
549 << was << is_now <<
"\n";
554 if (d.member_fns_changes())
557 int numdels = d.get_priv()->deleted_member_functions_.size();
558 size_t num_filtered =
559 d.get_priv()->count_filtered_deleted_mem_fns(ctxt);
562 "member function", indent);
563 for (string_member_function_sptr_map::const_iterator i =
564 d.get_priv()->deleted_member_functions_.begin();
565 i != d.get_priv()->deleted_member_functions_.end();
568 if (!(ctxt->get_allowed_category()
573 method_decl_sptr mem_fun = i->second;
574 out << indent <<
" ";
579 int numins = d.get_priv()->inserted_member_functions_.size();
580 num_filtered = d.get_priv()->count_filtered_inserted_mem_fns(ctxt);
583 "member function", indent);
584 for (string_member_function_sptr_map::const_iterator i =
585 d.get_priv()->inserted_member_functions_.begin();
586 i != d.get_priv()->inserted_member_functions_.end();
589 if (!(ctxt->get_allowed_category()
594 method_decl_sptr mem_fun = i->second;
595 out << indent <<
" ";
600 int numchanges = d.get_priv()->sorted_changed_member_functions_.size();
603 for (function_decl_diff_sptrs_type::const_iterator i =
604 d.get_priv()->sorted_changed_member_functions_.begin();
605 i != d.get_priv()->sorted_changed_member_functions_.end();
608 if (!(ctxt->get_allowed_category()
611 ((*i)->first_function_decl()))
613 ((*i)->second_function_decl())))
621 (*i)->first_function_decl()->get_pretty_representation();
622 out << indent <<
" '" << repr <<
"' has some changes:\n";
623 diff->report(out, indent +
" ");
628 if (d.data_members_changes())
631 int numdels = d.class_or_union_diff::get_priv()->
632 get_deleted_non_static_data_members_number();
636 "data member", indent);
637 vector<decl_base_sptr> sorted_dms;
639 (d.class_or_union_diff::get_priv()->deleted_data_members_,
641 for (vector<decl_base_sptr>::const_iterator i = sorted_dms.begin();
642 i != sorted_dms.end();
646 dynamic_pointer_cast<var_decl>(*i);
656 d.class_or_union_diff::get_priv()->inserted_data_members_.size();
660 "data member", indent);
661 vector<decl_base_sptr> sorted_dms;
663 (d.class_or_union_diff::get_priv()->inserted_data_members_,
665 for (vector<decl_base_sptr>::const_iterator i = sorted_dms.begin();
666 i != sorted_dms.end();
670 dynamic_pointer_cast<var_decl>(*i);
677 size_t net_numchanges = 0;
679 for (var_diff_sptrs_type::const_iterator it =
680 d.sorted_changed_data_members().begin();
681 it != d.sorted_changed_data_members().end();
686 for (var_diff_sptrs_type::const_iterator it =
687 d.sorted_subtype_changed_data_members().begin();
688 it != d.sorted_subtype_changed_data_members().end();
697 for (var_diff_sptrs_type::const_iterator it =
698 d.sorted_changed_data_members().begin();
699 it != d.sorted_changed_data_members().end();
702 represent(*it, ctxt, out, indent +
" ",
true);
704 for (var_diff_sptrs_type::const_iterator it =
705 d.sorted_subtype_changed_data_members().begin();
706 it != d.sorted_subtype_changed_data_members().end();
709 represent(*it, ctxt, out, indent +
" ",
true);
724leaf_reporter::report(
const class_diff& d,
726 const string& indent)
const
731 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER(d.first_subject(),
734 string name = d.first_subject()->get_pretty_representation();
738 second = d.second_class_decl();
746 d.class_or_union_diff::report(out, indent);
752 d.reported_once(
true);
761leaf_reporter::report(
const union_diff& d,
763 const string& indent)
const
768 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER(d.first_subject(),
772 union_decl_sptr first = d.first_union_decl(), second = d.second_union_decl();
779 d.class_or_union_diff::report(out, indent);
790leaf_reporter::report(
const distinct_diff& d,
792 const string& indent)
const
799 string f_repr = f ? f->get_pretty_representation() :
"'void'";
800 string s_repr = s ? s->get_pretty_representation() :
"'void'";
802 diff_sptr diff = d.compatible_child_diff();
804 string compatible = diff ?
" to compatible type '":
" to '";
806 out << indent <<
"entity changed from '" << f_repr <<
"'"
807 << compatible << s_repr <<
"'";
821leaf_reporter::report(
const function_decl_diff& d,
823 const string& indent)
const
829 d.second_function_decl(),
830 d.context(), out, indent);
836 corpus_sptr fc = ctxt->get_corpus_diff()->first_corpus();
837 corpus_sptr sc = ctxt->get_corpus_diff()->second_corpus();
839 string qn1 = ff->get_qualified_name(), qn2 = sf->get_qualified_name(),
840 linkage_names1, linkage_names2;
844 linkage_names1 = s1->get_id_string();
846 linkage_names2 = s2->get_id_string();
852 s1->get_aliases_id_string(fc->get_fun_symbol_map());
855 s2->get_aliases_id_string(sc->get_fun_symbol_map());
859 if (linkage_names1 != linkage_names2)
861 if (linkage_names1.empty())
863 out << indent << ff->get_pretty_representation()
864 <<
" didn't have any linkage name, and it now has: '"
865 << linkage_names2 <<
"'\n";
867 else if (linkage_names2.empty())
869 out << indent << ff->get_pretty_representation()
870 <<
" did have linkage names '" << linkage_names1
872 << indent <<
"but it doesn't have any linkage name anymore\n";
875 out << indent <<
"linkage names of "
876 << ff->get_pretty_representation()
877 <<
"\n" << indent <<
"changed from '"
878 << linkage_names1 <<
"' to '" << linkage_names2 <<
"'\n";
888 string frep1 = d.first_function_decl()->get_pretty_representation(),
889 frep2 = d.second_function_decl()->get_pretty_representation();
890 out << indent <<
"'" << frep1 <<
" {" << linkage_names1<<
"}"
892 << frep2 <<
" {" << linkage_names2 <<
"}" <<
"'\n";
900 if (ff->is_declared_inline() != sf->is_declared_inline())
903 if (ff->is_declared_inline())
904 out << sf->get_pretty_representation()
905 <<
" is not declared inline anymore\n";
907 out << sf->get_pretty_representation()
908 <<
" is now declared inline\n";
916 if (ff_is_virtual != sf_is_virtual)
920 out << ff->get_pretty_representation()
921 <<
" is no more declared virtual\n";
923 out << ff->get_pretty_representation()
924 <<
" is now declared virtual\n";
929 if (ff_is_virtual && sf_is_virtual
930 && (ff_vtable_offset != sf_vtable_offset))
933 <<
"the vtable offset of " << ff->get_pretty_representation()
934 <<
" changed from " << ff_vtable_offset
935 <<
" to " << sf_vtable_offset <<
"\n";
946 bool vtable_added =
false, vtable_removed =
false;
947 if (!fc->get_is_declaration_only() && !sc->get_is_declaration_only())
949 vtable_added = !fc->has_vtable() && sc->has_vtable();
950 vtable_removed = fc->has_vtable() && !sc->has_vtable();
952 bool vtable_changed = ((ff_is_virtual != sf_is_virtual)
953 || (ff_vtable_offset != sf_vtable_offset));
954 bool incompatible_change = (ff_vtable_offset != sf_vtable_offset);
958 <<
" note that a vtable was added to "
959 << fc->get_pretty_representation()
961 else if (vtable_removed)
963 <<
" note that the vtable was removed from "
964 << fc->get_pretty_representation()
966 else if (vtable_changed)
969 if (incompatible_change)
970 out <<
" note that this is an ABI incompatible "
971 "change to the vtable of ";
973 out <<
" note that this induces a change to the vtable of ";
974 out << fc->get_pretty_representation()
982 d.type_diff()->report(out, indent);
991leaf_reporter::report(
const var_diff& d,
993 const string& indent)
const
998 decl_base_sptr first = d.first_var(), second = d.second_var();
999 string n = first->get_pretty_representation();
1006 d.second_var()->get_symbol(),
1007 d.context(), out, indent);
1015 RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif,
"type");
1016 out << indent <<
"type of variable changed:\n";
1017 dif->report(out, indent +
" ");
1028leaf_reporter::report(
const translation_unit_diff& d,
1030 const string& indent)
const
1032 if (!d.to_be_reported())
1035 static_cast<const scope_diff&
>(d).report(out, indent);
1044leaf_reporter::report(
const corpus_diff& d,
1046 const string& indent)
const
1048 if (!d.has_changes())
1051 const corpus_diff::diff_stats &s =
1052 const_cast<corpus_diff&
>(d).
1053 apply_filters_and_suppressions_before_reporting();
1057 d.priv_->emit_diff_stats(s, out, indent);
1058 if (ctxt->show_stats_only())
1062 if (ctxt->show_soname_change()
1063 && !d.priv_->sonames_equal_)
1064 out << indent <<
"SONAME changed from '"
1065 << d.first_corpus()->get_soname() <<
"' to '"
1066 << d.second_corpus()->get_soname() <<
"'\n\n";
1068 if (ctxt->show_architecture_change()
1069 && !d.priv_->architectures_equal_)
1070 out << indent <<
"architecture changed from '"
1071 << d.first_corpus()->get_architecture_name() <<
"' to '"
1072 << d.second_corpus()->get_architecture_name() <<
"'\n\n";
1075 if (ctxt->show_deleted_fns())
1077 if (s.net_num_func_removed() == 1)
1078 out << indent <<
"1 Removed function:\n\n";
1079 else if (s.net_num_func_removed() > 1)
1080 out << indent << s.net_num_func_removed() <<
" Removed functions:\n\n";
1082 bool emitted =
false;
1085 for (
auto f : sorted_deleted_fns)
1087 if (d.priv_->deleted_function_is_suppressed(f))
1093 out <<
"'" << f->get_pretty_representation() <<
"'";
1094 if (ctxt->show_linkage_names())
1098 d.first_corpus()->get_fun_symbol_map());
1108 <<
"note that this removes an entry from the vtable of "
1109 << c->get_pretty_representation()
1118 if (ctxt->show_added_fns())
1120 if (s.net_num_func_added() == 1)
1121 out << indent <<
"1 Added function:\n\n";
1122 else if (s.net_num_func_added() > 1)
1123 out << indent << s.net_num_func_added()
1124 <<
" Added functions:\n\n";
1125 bool emitted =
false;
1128 for (
auto f : sorted_added_fns)
1130 if (d.priv_->added_function_is_suppressed(f))
1138 << f->get_pretty_representation()
1140 if (ctxt->show_linkage_names())
1144 (out,
"", *f->get_symbol(),
1145 d.second_corpus()->get_fun_symbol_map());
1155 <<
"note that this adds a new entry to the vtable of "
1156 << c->get_pretty_representation()
1165 if (ctxt->show_changed_fns())
1168 size_t num_changed = s.net_num_leaf_func_changes();
1169 if (num_changed == 1)
1170 out << indent <<
"1 function with some sub-type change:\n\n";
1171 else if (num_changed > 1)
1172 out << indent << num_changed
1173 <<
" functions with some sub-type change:\n\n";
1175 vector<function_decl_diff_sptr> sorted_changed_fns;
1177 sorted_changed_fns);
1178 for (vector<function_decl_diff_sptr>::const_iterator i =
1179 sorted_changed_fns.begin();
1180 i != sorted_changed_fns.end();
1190 out << indent <<
" [C] '"
1191 << fn->get_pretty_representation() <<
"'";
1193 out <<
" has some sub-type changes:\n";
1194 if ((fn->get_symbol()->has_aliases()
1200 && fn->get_name() != fn->get_linkage_name()))
1202 int number_of_aliases =
1203 fn->get_symbol()->get_number_of_aliases();
1204 if (number_of_aliases == 0)
1206 out << indent <<
" "
1207 <<
"Please note that the exported symbol of "
1209 << fn->get_symbol()->get_id_string()
1214 out << indent <<
" "
1215 <<
"Please note that the symbol of this function is "
1216 << fn->get_symbol()->get_id_string()
1217 <<
"\n and it aliases symbol";
1218 if (number_of_aliases > 1)
1221 << fn->get_symbol()->get_aliases_id_string(
false)
1225 diff->report(out, indent +
" ");
1234 if (ctxt->show_deleted_vars())
1236 if (s.net_num_vars_removed() == 1)
1237 out << indent <<
"1 Removed variable:\n\n";
1238 else if (s.net_num_vars_removed() > 1)
1239 out << indent << s.net_num_vars_removed()
1240 <<
" Removed variables:\n\n";
1242 bool emitted =
false;
1245 for (
auto v : sorted_deleted_vars)
1247 if (d.priv_->deleted_variable_is_suppressed(v))
1250 n = v->get_pretty_representation();
1258 if (ctxt->show_linkage_names())
1262 d.first_corpus()->get_var_symbol_map());
1272 if (ctxt->show_added_vars())
1274 if (s.net_num_vars_added() == 1)
1275 out << indent <<
"1 Added variable:\n\n";
1276 else if (s.net_num_vars_added() > 1)
1277 out << indent << s.net_num_vars_added()
1278 <<
" Added variables:\n\n";
1280 bool emitted =
false;
1283 for (
auto v : sorted_added_vars)
1285 if (d.priv_->added_variable_is_suppressed(v))
1288 n = v->get_pretty_representation();
1293 out <<
"'" << n <<
"'";
1294 if (ctxt->show_linkage_names())
1298 d.second_corpus()->get_var_symbol_map());
1308 if (ctxt->show_changed_vars())
1310 size_t num_changed = s.net_num_leaf_var_changes();
1311 if (num_changed == 1)
1312 out << indent <<
"1 Changed variable:\n\n";
1313 else if (num_changed > 1)
1314 out << indent << num_changed
1315 <<
" Changed variables:\n\n";
1317 for (
diff_sptr diff : d.priv_->sorted_changed_vars_)
1325 n1 = diff->first_subject()->get_pretty_representation();
1326 n2 = diff->second_subject()->get_pretty_representation();
1328 out << indent <<
" [C] '" << n1 <<
"' was changed";
1330 out <<
" to '" << n2 <<
"'";
1333 diff->report(out, indent +
" ");
1341 if (ctxt->show_symbols_unreferenced_by_debug_info()
1342 && d.priv_->deleted_unrefed_fn_syms_.size())
1344 if (s.net_num_removed_func_syms() == 1)
1346 <<
"1 Removed function symbol not referenced by debug info:\n\n";
1347 else if (s.net_num_removed_func_syms() > 0)
1349 << s.net_num_removed_func_syms()
1350 <<
" Removed function symbols not referenced by debug info:\n\n";
1352 bool emitted =
false;
1353 vector<elf_symbol_sptr> sorted_deleted_unrefed_fn_syms;
1355 sorted_deleted_unrefed_fn_syms);
1356 for (vector<elf_symbol_sptr>::const_iterator i =
1357 sorted_deleted_unrefed_fn_syms.begin();
1358 i != sorted_deleted_unrefed_fn_syms.end();
1361 if (d.priv_->deleted_unrefed_fn_sym_is_suppressed((*i).get()))
1364 out << indent <<
" ";
1368 d.first_corpus()->get_fun_symbol_map());
1377 if (ctxt->show_symbols_unreferenced_by_debug_info()
1378 && ctxt->show_added_symbols_unreferenced_by_debug_info()
1379 && d.priv_->added_unrefed_fn_syms_.size())
1381 if (s.net_num_added_func_syms() == 1)
1383 <<
"1 Added function symbol not referenced by debug info:\n\n";
1384 else if (s.net_num_added_func_syms() > 0)
1386 << s.net_num_added_func_syms()
1387 <<
" Added function symbols not referenced by debug info:\n\n";
1389 bool emitted =
false;
1390 vector<elf_symbol_sptr> sorted_added_unrefed_fn_syms;
1392 sorted_added_unrefed_fn_syms);
1393 for (vector<elf_symbol_sptr>::const_iterator i =
1394 sorted_added_unrefed_fn_syms.begin();
1395 i != sorted_added_unrefed_fn_syms.end();
1398 if (d.priv_->added_unrefed_fn_sym_is_suppressed((*i).get()))
1401 out << indent <<
" ";
1405 d.second_corpus()->get_fun_symbol_map());
1414 if (ctxt->show_symbols_unreferenced_by_debug_info()
1415 && d.priv_->deleted_unrefed_var_syms_.size())
1417 if (s.net_num_removed_var_syms() == 1)
1419 <<
"1 Removed variable symbol not referenced by debug info:\n\n";
1420 else if (s.net_num_removed_var_syms() > 0)
1422 << s.net_num_removed_var_syms()
1423 <<
" Removed variable symbols not referenced by debug info:\n\n";
1425 bool emitted =
false;
1426 vector<elf_symbol_sptr> sorted_deleted_unrefed_var_syms;
1428 sorted_deleted_unrefed_var_syms);
1429 for (vector<elf_symbol_sptr>::const_iterator i =
1430 sorted_deleted_unrefed_var_syms.begin();
1431 i != sorted_deleted_unrefed_var_syms.end();
1434 if (d.priv_->deleted_unrefed_var_sym_is_suppressed((*i).get()))
1437 out << indent <<
" ";
1442 d.first_corpus()->get_fun_symbol_map());
1452 if (ctxt->show_symbols_unreferenced_by_debug_info()
1453 && ctxt->show_added_symbols_unreferenced_by_debug_info()
1454 && d.priv_->added_unrefed_var_syms_.size())
1456 if (s.net_num_added_var_syms() == 1)
1458 <<
"1 Added variable symbol not referenced by debug info:\n\n";
1459 else if (s.net_num_added_var_syms() > 0)
1461 << s.net_num_added_var_syms()
1462 <<
" Added variable symbols not referenced by debug info:\n\n";
1464 bool emitted =
false;
1465 vector<elf_symbol_sptr> sorted_added_unrefed_var_syms;
1467 sorted_added_unrefed_var_syms);
1468 for (vector<elf_symbol_sptr>::const_iterator i =
1469 sorted_added_unrefed_var_syms.begin();
1470 i != sorted_added_unrefed_var_syms.end();
1473 if (d.priv_->added_unrefed_var_sym_is_suppressed((*i).get()))
1476 out << indent <<
" ";
1479 d.second_corpus()->get_fun_symbol_map());
1488 const diff_maps& leaf_diffs = d.get_leaf_diffs();
1489 report_type_changes_from_diff_maps(*
this, leaf_diffs, out, indent);
1495 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_leaf_var_changes() const
Getter for the net number of leaf variable change diff nodes.
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_leaf_type_changes() const
Getter for the net number of leaf type change diff nodes.
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_leaf_func_changes() const
Getter for the net number of leaf function change diff nodes.
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*...
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.
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.
This type contains maps. Each map associates a type name to a diff of that type. Not all kinds of dif...
const string_diff_ptr_map & get_function_decl_diff_map() const
Getter of the map that contains function decl diffs.
const string_diff_ptr_map & get_var_decl_diff_map() const
Getter of the map that contains var decl diffs.
The abstraction of a change between two ABI artifacts, a.k.a an artifact change.
const diff_context_sptr context() const
Getter of the context of the current diff.
virtual enum change_kind has_local_changes() const =0
Pure interface to know if the current instance of @diff carries a local change. A local change is a c...
bool to_be_reported() const
Test if this diff tree node should be reported.
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.
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.
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_changes_from_diff_maps(const diff_maps &, std::ostream &out, const std::string &indent) const
Report the changes carried by an instance of diff_maps.
virtual bool diff_to_be_reported(const diff *d) const
Test if a diff node is to be reported by the current instance of leaf_reporter.
The abstraction of a diff between two ptr_to_mbr_type.
Abstraction of a diff between two qualified types.
The base class of all the reporting classes.
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 typedef_decl.
Abstracts a diff between two instances of var_decl.
vector< var_decl_sptr > variables
Convenience typedef for std::vector<abigail::ir::var_decl*>
vector< const function_decl * > functions
Convenience typedef for std::vector<abigail::ir::function_decl*>
shared_ptr< parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
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...
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 ...
vector< diff * > diff_ptrs_type
Convenience typedef for a vector of diff*.
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...
void sort_string_diff_ptr_map(const string_diff_ptr_map &map, diff_ptrs_type &sorted)
Sort a map ofg string -> diff* into a vector of diff_ptr. The diff_ptr are sorted lexicographically w...
@ 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...
@ 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 ...
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...
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.
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 sort_string_var_ptr_map(const string_var_ptr_map &map, vector< var_decl_sptr > &sorted)
Sort a map of string -> pointer to var_decl.
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.
unordered_map< string, diff * > string_diff_ptr_map
Convenience typedef for a map which value is a diff*. The key of the map is the qualified name of the...
const var_diff * is_var_diff(const diff *diff)
Test if a diff node is about differences between variables.
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.
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.
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...
shared_ptr< class_decl > class_decl_sptr
Convenience typedef for a shared pointer on a class_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 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.
bool get_member_function_is_virtual(const function_decl &f)
Test if a given member function is virtual.
translation_unit * get_translation_unit(const type_or_decl_base &t)
Return the translation unit a declaration belongs to.
bool is_data_member(const var_decl &v)
Test if a var_decl is a data member.
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.