19#include "abg-reporter-priv.h"
114 for (string_enumerator_map::const_iterator i = enumerators_map.begin();
115 i != enumerators_map.end();
117 sorted.push_back(i->second);
119 std::sort(sorted.begin(), sorted.end(), comp);
131 for (string_changed_enumerator_map::const_iterator i =
132 enumerators_map.begin();
133 i != enumerators_map.end();
135 sorted.push_back(i->second);
138 std::sort(sorted.begin(), sorted.end(), comp);
148 vector<decl_base_sptr>& sorted)
150 sorted.reserve(data_members.size());
151 for (string_decl_base_sptr_map::const_iterator i = data_members.begin();
152 i != data_members.end();
154 sorted.push_back(i->second);
157 std::sort(sorted.begin(), sorted.end(), comp);
167 std::sort(to_sort.begin(), to_sort.end(), comp);
178 vector<function_decl*>& sorted)
180 sorted.reserve(map.size());
181 for (string_function_ptr_map::const_iterator i = map.begin();
184 sorted.push_back(i->second);
187 std::sort(sorted.begin(), sorted.end(), comp);
201 sorted.reserve(map.size());
202 for (string_member_function_sptr_map::const_iterator i = map.begin();
205 sorted.push_back(i->second);
208 std::sort(sorted.begin(), sorted.end(), comp);
224 sorted.reserve(map.size());
225 for (string_function_decl_diff_sptr_map::const_iterator i = map.begin();
228 sorted.push_back(i->second);
230 std::sort(sorted.begin(), sorted.end(), comp);
243 sorted.reserve(map.size());
244 for (string_var_diff_sptr_map::const_iterator i = map.begin();
247 sorted.push_back(i->second);
250 std::sort(sorted.begin(), sorted.end(), comp);
264 vector<elf_symbol_sptr>& sorted)
266 for (string_elf_symbol_map::const_iterator i = map.begin();
269 sorted.push_back(i->second);
272 std::sort(sorted.begin(), sorted.end(), comp);
285 vector<var_decl*>& sorted)
287 for (string_var_ptr_map::const_iterator i = map.begin();
290 sorted.push_back(i->second);
293 std::sort(sorted.begin(), sorted.end(), comp);
306 sorted.reserve(map.size());
307 for (string_var_diff_sptr_map::const_iterator i = map.begin();
310 sorted.push_back(i->second);
312 std::sort(sorted.begin(), sorted.end(), comp);
325 sorted.reserve(map.size());
326 for (unsigned_var_diff_sptr_map::const_iterator i = map.begin();
329 sorted.push_back(i->second);
331 std::sort(sorted.begin(), sorted.end(), comp);
347 sorted.reserve(map.size());
348 for (string_function_decl_diff_sptr_map::const_iterator i = map.begin();
351 sorted.push_back(i->second);
354 sort(sorted.begin(), sorted.end(), comp);
368 sorted.reserve(map.size());
369 for (string_diff_sptr_map::const_iterator i = map.begin();
372 sorted.push_back(i->second);
375 sort(sorted.begin(), sorted.end(), comp);
389 sorted.reserve(map.size());
390 for (string_diff_ptr_map::const_iterator i = map.begin();
393 sorted.push_back(i->second);
396 sort(sorted.begin(), sorted.end(), comp);
410 for (string_base_diff_sptr_map::const_iterator i = map.begin();
413 sorted.push_back(i->second);
415 sort(sorted.begin(), sorted.end(), comp);
424 for (string_base_sptr_map::const_iterator i = m.begin();
427 sorted.push_back(i->second);
430 std::sort(sorted.begin(), sorted.end(), comp);
442 vector<fn_parm_diff_sptr>& sorted)
444 sorted.reserve(map.size());
445 for (unsigned_fn_parm_diff_sptr_map::const_iterator i = map.begin();
448 sorted.push_back(i->second);
451 std::sort(sorted.begin(), sorted.end(), comp);
463 vector<fn_parm_diff_sptr>& sorted)
465 sorted.reserve(map.size());
466 for (string_fn_parm_diff_sptr_map::const_iterator i = map.begin();
469 sorted.push_back(i->second);
472 std::sort(sorted.begin(), sorted.end(), comp);
483 vector<function_decl::parameter_sptr>& sorted)
485 for (string_parm_map::const_iterator i = map.begin();
488 sorted.push_back(i->second);
491 std::sort(sorted.begin(), sorted.end(), comp);
503 vector<type_or_decl_base_sptr>& sorted)
506 for (artifact_sptr_set_type::const_iterator it = set.begin();
509 sorted.push_back(*it);
512 std::sort(sorted.begin(), sorted.end(), comp);
527 vector<type_base_sptr>& sorted)
529 for (string_type_base_sptr_map::const_iterator i = map.begin();
532 sorted.push_back(i->second);
535 std::sort(sorted.begin(), sorted.end(), comp);
547 return type_base_sptr();
549 type_base_sptr ut = t->get_underlying_type();
550 qualified_type_def_sptr qut = dynamic_pointer_cast<qualified_type_def>(ut);
578 if (decl_base_sptr decl =
is_decl(first))
595 |
static_cast<unsigned>(r));}
602 &
static_cast<unsigned>(r));
608{
return static_cast<visiting_kind>(~static_cast<unsigned>(l));}
682 if (dif->first_class_or_union()->get_is_anonymous())
738 if (d->has_local_changes())
912diff_context::diff_context()
928diff_context::~diff_context() =
default;
935{
return priv_->do_log_;}
949{priv_->corpus_diff_ = d;}
956{
return priv_->corpus_diff_;}
965 if (priv_->corpus_diff_)
966 return priv_->corpus_diff_->first_corpus();
967 return corpus_sptr();
978 if (priv_->corpus_diff_)
979 return priv_->corpus_diff_->second_corpus();
980 return corpus_sptr();
989 if (!priv_->reporter_)
997 return priv_->reporter_;
1005{priv_->reporter_ = r;}
1019 types_or_decls_diff_map_type::const_iterator i =
1020 priv_->types_or_decls_diff_map.find(std::make_pair(first, second));
1021 if (i != priv_->types_or_decls_diff_map.end())
1035diff_context::has_diff_for_types(
const type_base_sptr first,
1036 const type_base_sptr second)
const
1037{
return has_diff_for(first, second);}
1045diff_context::has_diff_for(
const diff* d)
const
1046{
return has_diff_for(d->first_subject(), d->second_subject()).get();}
1054diff_context::has_diff_for(
const diff_sptr d)
const
1055{
return has_diff_for(d->first_subject(), d->second_subject());}
1064{
return priv_->allowed_category_;}
1073{priv_->allowed_category_ = c;}
1086{priv_->allowed_category_ = priv_->allowed_category_ | c;}
1097{priv_->allowed_category_ = priv_->allowed_category_ & ~c;}
1113{priv_->types_or_decls_diff_map[std::make_pair(first, second)] = d;}
1119diff_context::add_diff(
const diff* d)
1132diff_context::add_diff(
const diff_sptr d)
1135 add_diff(d->first_subject(), d->second_subject(), d);
1152{
return has_diff_for(first, second);}
1164{
return has_diff_for(d);}
1180 if (!has_diff_for(first, second))
1182 add_diff(first, second, d);
1183 priv_->canonical_diffs.push_back(d);
1208 canonical = canonical_diff;
1209 set_canonical_diff_for(first, second, canonical);
1252{priv_->live_diffs_.insert(d);}
1265 size_t ptr_value =
reinterpret_cast<size_t>(canonical);
1266 pointer_map::iterator it = priv_->visited_diff_nodes_.find(ptr_value);
1267 if (it != priv_->visited_diff_nodes_.end())
1268 return reinterpret_cast<diff*
>(it->second);
1301 size_t canonical_ptr_value =
reinterpret_cast<size_t>(canonical);
1302 size_t diff_ptr_value =
reinterpret_cast<size_t>(d);
1303 priv_->visited_diff_nodes_[canonical_ptr_value] = diff_ptr_value;
1309{priv_->visited_diff_nodes_.clear();}
1319{priv_->forbid_visiting_a_node_twice_ = f;}
1329{priv_->reset_visited_diffs_for_each_interface_ = f;}
1337{
return priv_->forbid_visiting_a_node_twice_;}
1351 return (priv_->forbid_visiting_a_node_twice_
1352 && priv_->reset_visited_diffs_for_each_interface_);
1360{
return priv_->filters_;}
1368{priv_->filters_.push_back(f);}
1389 for (filtering::filters::const_iterator i =
diff_filters().begin();
1396 std::cerr <<
"applying a filter to diff '"
1407 std::cerr <<
"filter applied!:" << t <<
"\n";
1409 std::cerr <<
"propagating categories for the same diff node ... \n";
1418 std::cerr <<
"category propagated!: " << t <<
"\n";
1439 for (filtering::filters::const_iterator i =
diff_filters().begin();
1454{
return priv_->suppressions_;}
1465 priv_->negated_suppressions_.clear();
1466 priv_->direct_suppressions_.clear();
1467 return priv_->suppressions_;
1486 if (priv_->negated_suppressions_.empty())
1489 priv_->negated_suppressions_.push_back(s);
1491 return priv_->negated_suppressions_;
1509 if (priv_->direct_suppressions_.empty())
1513 priv_->direct_suppressions_.push_back(s);
1515 return priv_->direct_suppressions_;
1526 priv_->suppressions_.push_back(suppr);
1529 priv_->negated_suppressions_.clear();
1530 priv_->direct_suppressions_.clear();
1541 priv_->suppressions_.insert(priv_->suppressions_.end(),
1542 supprs.begin(), supprs.end());
1551{
return priv_->perform_change_categorization_;}
1558{priv_->perform_change_categorization_ = f;}
1572 priv_->leaf_changes_only_ = f;
1582{
return priv_->leaf_changes_only_;}
1592{
return priv_->hex_values_;}
1602{priv_->hex_values_ = f;}
1611{
return priv_->show_offsets_sizes_in_bits_;}
1620{priv_->show_offsets_sizes_in_bits_ = f;}
1629{priv_->show_relative_offset_changes_ = f;}
1638{
return priv_->show_relative_offset_changes_;}
1646{priv_->show_stats_only_ = f;}
1654{
return priv_->show_stats_only_;}
1662{priv_->show_soname_change_ = f;}
1670{
return priv_->show_soname_change_;}
1678{priv_->show_architecture_change_ = f;}
1686{
return priv_->show_architecture_change_;}
1693{priv_->show_deleted_fns_ = f;}
1699{
return priv_->show_deleted_fns_;}
1706{priv_->show_changed_fns_ = f;}
1711{
return priv_->show_changed_fns_;}
1718{priv_->show_added_fns_ = f;}
1724{
return priv_->show_added_fns_;}
1731{priv_->show_deleted_vars_ = f;}
1737{
return priv_->show_deleted_vars_;}
1744{priv_->show_changed_vars_ = f;}
1749{
return priv_->show_changed_vars_;}
1756{priv_->show_added_vars_ = f;}
1762{
return priv_->show_added_vars_;}
1765diff_context::show_linkage_names()
const
1766{
return priv_->show_linkage_names_;}
1769diff_context::show_linkage_names(
bool f)
1770{priv_->show_linkage_names_= f;}
1777{priv_->show_locs_= f;}
1783{
return priv_->show_locs_;}
1792{
return priv_->show_redundant_changes_;}
1801{priv_->show_redundant_changes_ = f;}
1809{
return priv_->show_syms_unreferenced_by_di_;}
1817{priv_->show_syms_unreferenced_by_di_ = f;}
1826{
return priv_->show_added_syms_unreferenced_by_di_;}
1835{priv_->show_added_syms_unreferenced_by_di_ = f;}
1844{priv_->show_unreachable_types_ = f;}
1853{
return priv_->show_unreachable_types_;}
1864{
return priv_->show_impacted_interfaces_;}
1875{priv_->show_impacted_interfaces_ = f;}
1884{priv_->default_output_stream_ = o;}
1893{
return priv_->default_output_stream_;}
1901{priv_->error_output_stream_ = o;}
1909{
return priv_->error_output_stream_;}
1918{
return priv_->dump_diff_tree_;}
1927{priv_->dump_diff_tree_ = f;}
1966 : priv_(new priv(first_subject, second_subject,
1988 : priv_(new priv(first_subject, second_subject,
2027 if (priv_->canonical_diff_)
2028 priv_->canonical_diff_->priv_->traversing_ =
true;
2029 priv_->traversing_ =
true;
2046 if (priv_->canonical_diff_)
2047 return priv_->canonical_diff_->priv_->traversing_;
2048 return priv_->traversing_;
2062 if (priv_->canonical_diff_)
2063 priv_->canonical_diff_->priv_->traversing_ =
false;
2064 priv_->traversing_ =
false;
2080 if (diff::priv_->finished_)
2083 diff::priv_->finished_ =
true;
2091{
return dynamic_pointer_cast<type_or_decl_base>(priv_->first_subject_);}
2098{
return dynamic_pointer_cast<type_or_decl_base>(priv_->second_subject_);}
2105{
return priv_->children_;}
2112{
return priv_->parent_;}
2125{
return priv_->canonical_diff_;}
2133{priv_->canonical_diff_ = d;}
2146 context()->keep_diff_alive(d);
2153 priv_->children_.push_back(d.get());
2155 d->priv_->parent_ =
this;
2163{
return priv_->get_context();}
2180 if (priv_->canonical_diff_)
2181 return priv_->canonical_diff_->priv_->currently_reporting_;
2182 return priv_->currently_reporting_;
2193 if (priv_->canonical_diff_)
2194 priv_->canonical_diff_->priv_->currently_reporting_ = f;
2195 priv_->currently_reporting_ = f;
2206 return priv_->canonical_diff_->priv_->reported_once_;
2266 bool already_visited =
false;
2267 if (
context()->visiting_a_node_twice_is_forbidden()
2268 &&
context()->diff_has_been_visited(
this))
2269 already_visited =
true;
2271 bool mark_visited_nodes_as_traversed =
2274 if (!already_visited && !v.
visit(
this,
true))
2277 if (mark_visited_nodes_as_traversed)
2278 context()->mark_diff_as_visited(
this);
2284 && !already_visited)
2291 if (!(*i)->traverse(v))
2294 if (mark_visited_nodes_as_traversed)
2295 context()->mark_diff_as_visited(
this);
2303 if (!v.
visit(
this,
false))
2306 if (mark_visited_nodes_as_traversed)
2307 context()->mark_diff_as_visited(
this);
2312 if (!already_visited && mark_visited_nodes_as_traversed)
2313 context()->mark_diff_as_visited(
this);
2327 priv_->canonical_diff_->priv_->reported_once_ = f;
2328 priv_->reported_once_ = f;
2340{
return priv_->local_category_;}
2366{
return priv_->category_;}
2381 priv_->category_ = priv_->category_ | c;
2382 return priv_->category_;
2396 priv_->local_category_ = priv_->local_category_ | c;
2397 return priv_->local_category_;
2425 priv_->category_ = priv_->category_ & ~c;
2426 return priv_->category_;
2440 priv_->local_category_ = priv_->local_category_ & ~c;
2441 return priv_->local_category_;
2451{priv_->category_ = c;}
2458{priv_->local_category_ = c;}
2483 && !canonical->is_allowed_by_specific_negated_suppression()
2484 && !canonical->has_descendant_allowed_by_specific_negated_suppression()
2485 && !canonical->has_parent_allowed_by_specific_negated_suppression())
2526 return priv_->is_filtered_out(c);
2537 bool is_private =
false;
2566 bool do_suppress = !
context()->negated_suppressions().empty();
2570 for (
auto n :
context()->negated_suppressions())
2571 if (!n->suppresses_diff(
this))
2573 do_suppress =
false;
2580 for (
auto d :
context()->direct_suppressions())
2581 if (d->suppresses_diff(
this))
2585 is_private_type =
true;
2625 for (suppressions_type::const_iterator i = suppressions.begin();
2626 i != suppressions.end();
2630 && !(*i)->suppresses_diff(
this))
2670 if (priv_->pretty_representation_.empty())
2671 priv_->pretty_representation_ =
"empty_diff";
2672 return priv_->pretty_representation_;
2699type_diff_base::type_diff_base(type_base_sptr first_subject,
2700 type_base_sptr second_subject,
2702 :
diff(first_subject, second_subject, ctxt),
2706type_diff_base::~type_diff_base()
2722 decl_base_sptr second_subject,
2724 :
diff(first_subject, second_subject, ctxt),
2728decl_diff_base::~decl_diff_base()
2739 if (diff::priv_->pretty_representation_.empty())
2741 std::ostringstream o;
2742 o <<
"distinct_diff[";
2753 diff::priv_->pretty_representation_ = o.str();
2755 return diff::priv_->pretty_representation_;
2788 :
diff(first, second, ctxt),
2822 if (!priv_->compatible_child_diff)
2834 return priv_->compatible_child_diff;
2859 return typeid(f) !=
typeid(s);
2877 return NO_CHANGE_KIND;
2888 context()->get_reporter()->report(*
this, out, indent);
2911 ctxt->initialize_canonical_diff(result);
2936template<
typename DiffType>
2942 if (shared_ptr<DiffType> f =
2943 dynamic_pointer_cast<DiffType>(first))
2945 shared_ptr<DiffType> s =
2946 dynamic_pointer_cast<DiffType>(second);
2972 dynamic_pointer_cast<class_decl>(first))
2978 if (f->get_is_declaration_only())
2985 if (s->get_is_declaration_only())
3040 ((d = try_to_diff<type_decl>(f, s, ctxt))
3041 ||(d = try_to_diff<enum_type_decl>(f, s, ctxt))
3042 ||(d = try_to_diff<union_decl>(f, s,ctxt))
3044 ||(d = try_to_diff<pointer_type_def>(f, s, ctxt))
3045 ||(d = try_to_diff<reference_type_def>(f, s, ctxt))
3046 ||(d = try_to_diff<array_type_def::subrange_type>(f, s, ctxt))
3047 ||(d = try_to_diff<array_type_def>(f, s, ctxt))
3048 ||(d = try_to_diff<qualified_type_def>(f, s, ctxt))
3049 ||(d = try_to_diff<typedef_decl>(f, s, ctxt))
3050 ||(d = try_to_diff<function_type>(f, s, ctxt))
3051 ||(d = try_to_diff_distinct_kinds(f, s, ctxt)));
3061 |
static_cast<unsigned>(c2));}
3080 ^
static_cast<unsigned>(c2));}
3085 &
static_cast<unsigned>(c2));}
3089{
return static_cast<diff_category>(~static_cast<unsigned>(c));}
3141 bool emitted_a_category =
false;
3145 o <<
"NO_CHANGE_CATEGORY";
3146 emitted_a_category =
true;
3151 if (emitted_a_category)
3153 o <<
"ACCESS_CHANGE_CATEGORY";
3154 emitted_a_category |=
true;
3159 if (emitted_a_category)
3161 o <<
"COMPATIBLE_TYPE_CHANGE_CATEGORY";
3162 emitted_a_category |=
true;
3167 if (emitted_a_category)
3169 o <<
"HARMLESS_DECL_NAME_CHANGE_CATEGORY";
3170 emitted_a_category |=
true;
3175 if (emitted_a_category)
3177 o <<
"NON_VIRT_MEM_FUN_CHANGE_CATEGORY";
3178 emitted_a_category |=
true;
3183 if (emitted_a_category)
3185 o <<
"STATIC_DATA_MEMBER_CHANGE_CATEGORY";
3186 emitted_a_category |=
true;
3191 if (emitted_a_category)
3193 o <<
"HARMLESS_ENUM_CHANGE_CATEGORY";
3194 emitted_a_category |=
true;
3199 if (emitted_a_category)
3201 o <<
"HARMLESS_DATA_MEMBER_CHANGE_CATEGORY";
3202 emitted_a_category |=
true;
3207 if (emitted_a_category)
3209 o <<
"HARMLESS_SYMBOL_ALIAS_CHANGE_CATEGORY";
3210 emitted_a_category |=
true;
3215 if (emitted_a_category)
3217 o <<
"HARMLESS_UNION_CHANGE_CATEGORY";
3218 emitted_a_category |=
true;
3223 if (emitted_a_category)
3225 o <<
"SUPPRESSED_CATEGORY";
3226 emitted_a_category |=
true;
3231 if (emitted_a_category)
3233 o <<
"PRIVATE_TYPE_CATEGORY";
3234 emitted_a_category |=
true;
3239 if (emitted_a_category)
3241 o <<
"SIZE_OR_OFFSET_CHANGE_CATEGORY";
3242 emitted_a_category |=
true;
3247 if (emitted_a_category)
3249 o <<
"VIRTUAL_MEMBER_CHANGE_CATEGORY";
3250 emitted_a_category |=
true;
3255 if (emitted_a_category)
3257 o <<
"REDUNDANT_CATEGORY";
3258 emitted_a_category |=
true;
3263 if (emitted_a_category)
3265 o <<
"TYPE_DECL_ONLY_DEF_CHANGE_CATEGORY";
3266 emitted_a_category |=
true;
3271 if (emitted_a_category)
3273 o <<
"FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY";
3274 emitted_a_category |=
true;
3279 if (emitted_a_category)
3281 o <<
"FN_PARM_TYPE_CV_CHANGE_CATEGORY";
3282 emitted_a_category |=
true;
3287 if (emitted_a_category)
3289 o <<
"FN_RETURN_TYPE_CV_CHANGE_CATEGORY";
3290 emitted_a_category |=
true;
3295 if (emitted_a_category)
3297 o <<
"FN_PARM_ADD_REMOVE_CHANGE_CATEGORY";
3298 emitted_a_category |=
true;
3303 if (emitted_a_category)
3305 o <<
"VAR_TYPE_CV_CHANGE_CATEGORY";
3306 emitted_a_category |=
true;
3311 if (emitted_a_category)
3313 o <<
"VOID_PTR_TO_PTR_CHANGE_CATEGORY";
3314 emitted_a_category |=
true;
3319 if (emitted_a_category)
3321 o <<
"BENIGN_INFINITE_ARRAY_CHANGE_CATEGORY";
3322 emitted_a_category |=
true;
3327 if (emitted_a_category)
3329 o <<
"HAS_ALLOWED_CHANGE_CATEGORY";
3330 emitted_a_category |=
true;
3335 if (emitted_a_category)
3337 o <<
"HAS_DESCENDANT_WITH_ALLOWED_CHANGE_CATEGORY";
3338 emitted_a_category |=
true;
3343 if (emitted_a_category)
3345 o <<
"HAS_PARENT_WITH_ALLOWED_CHANGE_CATEGORY";
3346 emitted_a_category |=
true;
3369compute_diff_for_decls(
const decl_base_sptr first,
3370 const decl_base_sptr second,
3376 ((d = try_to_diff<function_decl>(first, second, ctxt))
3377 || (d = try_to_diff<var_decl>(first, second, ctxt))
3378 || (d = try_to_diff_distinct_kinds(first, second, ctxt)));
3401 const decl_base_sptr second,
3404 if (!first || !second)
3409 d = compute_diff_for_types(first, second, ctxt);
3411 d = compute_diff_for_decls(first, second, ctxt);
3431 const type_base_sptr second,
3437 diff_sptr d = compute_diff_for_types(f,s, ctxt);
3452 string prefix=
"diff of ";
3472 if (diff::priv_->pretty_representation_.empty())
3474 std::ostringstream o;
3480 diff::priv_->pretty_representation_ = o.str();
3482 return diff::priv_->pretty_representation_;
3525 if (
diff_sptr result = priv_->type_diff_.lock())
3532 context()->keep_diff_alive(result);
3533 priv_->type_diff_ = result;
3554 return ir::NO_CHANGE_KIND;
3566 context()->get_reporter()->report(*
this, out, indent);
3587 ctxt->initialize_canonical_diff(d);
3617 priv_(new
priv(underlying))
3625{
return dynamic_pointer_cast<pointer_type_def>(
first_subject());}
3632{
return dynamic_pointer_cast<pointer_type_def>(
second_subject());}
3639 if (diff::priv_->pretty_representation_.empty())
3641 std::ostringstream o;
3642 o <<
"pointer_diff["
3647 diff::priv_->pretty_representation_ = o.str();
3649 return diff::priv_->pretty_representation_;
3668 return ir::NO_CHANGE_KIND;
3677{
return priv_->underlying_type_diff_;}
3686{priv_->underlying_type_diff_ = d;}
3697 context()->get_reporter()->report(*
this, out, indent);
3717 diff_sptr d = compute_diff_for_types(first->get_pointed_to_type(),
3718 second->get_pointed_to_type(),
3721 ctxt->initialize_canonical_diff(result);
3746 priv_(new
priv(underlying_type_diff))
3774{
return priv_->underlying_type_diff_;}
3783 if (diff::priv_->pretty_representation_.empty())
3785 std::ostringstream o;
3786 o <<
"subrange_diff["
3791 diff::priv_->pretty_representation_ = o.str();
3793 return diff::priv_->pretty_representation_;
3815 return ir::NO_CHANGE_KIND;
3825{
context()->get_reporter()->report(*
this, out, indent);}
3853 diff_sptr d = compute_diff_for_types(first->get_underlying_type(),
3854 second->get_underlying_type(),
3858 ctxt->initialize_canonical_diff(result);
3891 priv_(new
priv(element_type_diff))
3899{
return dynamic_pointer_cast<array_type_def>(
first_subject());}
3913{
return priv_->element_type_diff_;}
3920{priv_->element_type_diff_ = d;}
3927 if (diff::priv_->pretty_representation_.empty())
3929 std::ostringstream o;
3935 diff::priv_->pretty_representation_ = o.str();
3937 return diff::priv_->pretty_representation_;
3954 if (f->get_name() != s->get_name())
3956 if (f->get_size_in_bits() != s->get_size_in_bits())
3958 if (f->get_alignment_in_bits() != s->get_alignment_in_bits())
3978 return ir::NO_CHANGE_KIND;
3989 context()->get_reporter()->report(*
this, out, indent);
4007 diff_sptr d = compute_diff_for_types(first->get_element_type(),
4008 second->get_element_type(),
4011 ctxt->initialize_canonical_diff(result);
4039 priv_(new
priv(underlying))
4047{
return dynamic_pointer_cast<reference_type_def>(
first_subject());}
4054{
return dynamic_pointer_cast<reference_type_def>(
second_subject());}
4062{
return priv_->underlying_type_diff_;}
4070 priv_->underlying_type_diff_ = d;
4071 return priv_->underlying_type_diff_;
4079 if (diff::priv_->pretty_representation_.empty())
4081 std::ostringstream o;
4082 o <<
"reference_diff["
4087 diff::priv_->pretty_representation_ = o.str();
4089 return diff::priv_->pretty_representation_;
4110 return ir::NO_CHANGE_KIND;
4121 context()->get_reporter()->report(*
this, out, indent);
4139 diff_sptr d = compute_diff_for_types(first->get_pointed_to_type(),
4140 second->get_pointed_to_type(),
4143 ctxt->initialize_canonical_diff(result);
4167 qualified_type_def_sptr second,
4171 priv_(new
priv(under))
4177const qualified_type_def_sptr
4179{
return dynamic_pointer_cast<qualified_type_def>(
first_subject());}
4184const qualified_type_def_sptr
4186{
return dynamic_pointer_cast<qualified_type_def>(
second_subject());}
4195{
return priv_->underlying_type_diff;}
4205 if (!priv_->leaf_underlying_type_diff)
4206 priv_->leaf_underlying_type_diff
4211 return priv_->leaf_underlying_type_diff;
4221{priv_->underlying_type_diff = d;}
4228 if (diff::priv_->pretty_representation_.empty())
4230 std::ostringstream o;
4231 o <<
"qualified_type_diff["
4236 diff::priv_->pretty_representation_ = o.str();
4238 return diff::priv_->pretty_representation_;
4257 return ir::NO_CHANGE_KIND;
4268 context()->get_reporter()->report(*
this, out, indent);
4281qualified_type_diff_sptr
4283 const qualified_type_def_sptr second,
4286 diff_sptr d = compute_diff_for_types(first->get_underlying_type(),
4287 second->get_underlying_type(),
4291 ctxt->initialize_canonical_diff(result);
4304enum_diff::clear_lookup_tables()
4306 priv_->deleted_enumerators_.clear();
4307 priv_->inserted_enumerators_.clear();
4308 priv_->changed_enumerators_.clear();
4315enum_diff::lookup_tables_empty()
const
4317 return (priv_->deleted_enumerators_.empty()
4318 && priv_->inserted_enumerators_.empty()
4319 && priv_->changed_enumerators_.empty());
4325enum_diff::ensure_lookup_tables_populated()
4327 if (!lookup_tables_empty())
4331 edit_script e = priv_->enumerators_changes_;
4333 for (vector<deletion>::const_iterator it = e.deletions().begin();
4334 it != e.deletions().end();
4337 unsigned i = it->index();
4338 const enum_type_decl::enumerator& n =
4340 const string& name = n.get_name();
4341 ABG_ASSERT(priv_->deleted_enumerators_.find(n.get_name())
4342 == priv_->deleted_enumerators_.end());
4343 priv_->deleted_enumerators_[name] = n;
4346 for (vector<insertion>::const_iterator it = e.insertions().begin();
4347 it != e.insertions().end();
4350 for (vector<unsigned>::const_iterator iit =
4351 it->inserted_indexes().begin();
4352 iit != it->inserted_indexes().end();
4356 const enum_type_decl::enumerator& n =
4358 const string& name = n.get_name();
4359 ABG_ASSERT(priv_->inserted_enumerators_.find(n.get_name())
4360 == priv_->inserted_enumerators_.end());
4361 string_enumerator_map::const_iterator j =
4362 priv_->deleted_enumerators_.find(name);
4363 if (j == priv_->deleted_enumerators_.end())
4364 priv_->inserted_enumerators_[name] = n;
4368 priv_->changed_enumerators_[j->first] =
4369 std::make_pair(j->second, n);
4370 priv_->deleted_enumerators_.erase(j);
4401 priv_(new
priv(underlying_type_diff))
4407{
return dynamic_pointer_cast<enum_type_decl>(
first_subject());}
4417{
return priv_->underlying_type_diff_;}
4422{
return priv_->deleted_enumerators_;}
4427{
return priv_->inserted_enumerators_;}
4432{
return priv_->changed_enumerators_;}
4439 if (diff::priv_->pretty_representation_.empty())
4441 std::ostringstream o;
4447 diff::priv_->pretty_representation_ = o.str();
4449 return diff::priv_->pretty_representation_;
4468 return ir::NO_CHANGE_KIND;
4479 context()->get_reporter()->report(*
this, out, indent);
4501 diff_sptr ud = compute_diff_for_types(first->get_underlying_type(),
4502 second->get_underlying_type(),
4504 enum_diff_sptr d(
new enum_diff(first, second, ud, ctxt));
4505 if (first != second)
4508 first->get_enumerators().end(),
4509 second->get_enumerators().begin(),
4510 second->get_enumerators().end(),
4511 d->priv_->enumerators_changes_);
4512 d->ensure_lookup_tables_populated();
4514 ctxt->initialize_canonical_diff(d);
4536 string qname = d->get_qualified_name();
4537 string_diff_sptr_map::const_iterator it =
4538 changed_member_types_.find(qname);
4540 return ((it == changed_member_types_.end())
4542 : it->second->second_subject());
4559 string qname = d->get_qualified_name();
4560 string_var_diff_sptr_map::const_iterator it =
4561 subtype_changed_dm_.find(qname);
4563 if (it == subtype_changed_dm_.end())
4564 return decl_base_sptr();
4565 return it->second->second_var();
4583 string qname = d->get_qualified_name();
4584 string_diff_sptr_map::const_iterator it =
4585 changed_member_class_tmpls_.find(qname);
4587 return ((it == changed_member_class_tmpls_.end())
4589 : dynamic_pointer_cast<decl_base>(it->second->second_subject()));
4600 for (string_decl_base_sptr_map::const_iterator i =
4601 deleted_data_members_.begin();
4602 i != deleted_data_members_.end();
4619 for (string_decl_base_sptr_map::const_iterator i =
4620 inserted_data_members_.begin();
4621 i != inserted_data_members_.end();
4641 size_t num_filtered= 0;
4642 for (var_diff_sptrs_type::const_iterator i =
4643 sorted_subtype_changed_dm_.begin();
4644 i != sorted_subtype_changed_dm_.end();
4649 if ((*i)->has_changes()
4650 && !(*i)->has_local_changes_to_be_reported())
4655 if ((*i)->is_filtered_out())
4659 return num_filtered;
4673 size_t num_filtered= 0;
4675 for (unsigned_var_diff_sptr_map::const_iterator i = changed_dm_.begin();
4676 i != changed_dm_.end();
4692 return num_filtered;
4701#define SKIP_MEM_FN_IF_VIRTUALITY_DISALLOWED \
4703 if (get_member_function_is_virtual(f) \
4704 || get_member_function_is_virtual(s)) \
4706 if (!(allowed_category | VIRTUAL_MEMBER_CHANGE_CATEGORY)) \
4711 if (!(allowed_category | NON_VIRT_MEM_FUN_CHANGE_CATEGORY)) \
4726 diff_category allowed_category = ctxt->get_allowed_category();
4728 for (function_decl_diff_sptrs_type::const_iterator i =
4729 sorted_changed_member_functions_.begin();
4730 i != sorted_changed_member_functions_.end();
4733 method_decl_sptr f =
4734 dynamic_pointer_cast<method_decl>
4735 ((*i)->first_function_decl());
4738 method_decl_sptr s =
4739 dynamic_pointer_cast<method_decl>
4740 ((*i)->second_function_decl());
4746 ctxt->maybe_apply_filters(
diff);
4765 diff_category allowed_category = ctxt->get_allowed_category();
4767 for (string_member_function_sptr_map::const_iterator i =
4768 inserted_member_functions_.begin();
4769 i != inserted_member_functions_.end();
4772 method_decl_sptr f = i->second,
4778 ctxt->maybe_apply_filters(
diff);
4798 diff_category allowed_category = ctxt->get_allowed_category();
4800 for (string_member_function_sptr_map::const_iterator i =
4801 deleted_member_functions_.begin();
4802 i != deleted_member_functions_.end();
4805 method_decl_sptr f = i->second,
4811 ctxt->maybe_apply_filters(
diff);
4828 priv_->deleted_member_types_.clear();
4829 priv_->inserted_member_types_.clear();
4830 priv_->changed_member_types_.clear();
4831 priv_->deleted_data_members_.clear();
4832 priv_->inserted_data_members_.clear();
4833 priv_->subtype_changed_dm_.clear();
4834 priv_->deleted_member_functions_.clear();
4835 priv_->inserted_member_functions_.clear();
4836 priv_->changed_member_functions_.clear();
4837 priv_->deleted_member_class_tmpls_.clear();
4838 priv_->inserted_member_class_tmpls_.clear();
4839 priv_->changed_member_class_tmpls_.clear();
4848 return (priv_->deleted_member_types_.empty()
4849 && priv_->inserted_member_types_.empty()
4850 && priv_->changed_member_types_.empty()
4851 && priv_->deleted_data_members_.empty()
4852 && priv_->inserted_data_members_.empty()
4853 && priv_->subtype_changed_dm_.empty()
4854 && priv_->inserted_member_functions_.empty()
4855 && priv_->deleted_member_functions_.empty()
4856 && priv_->changed_member_functions_.empty()
4857 && priv_->deleted_member_class_tmpls_.empty()
4858 && priv_->inserted_member_class_tmpls_.empty()
4859 && priv_->changed_member_class_tmpls_.empty());
4870 for (vector<deletion>::const_iterator it = e.deletions().begin();
4871 it != e.deletions().end();
4874 unsigned i = it->index();
4878 if (record_type && record_type->get_is_declaration_only())
4880 string name = d->get_name();
4881 priv_->deleted_member_types_[name] = d;
4884 for (vector<insertion>::const_iterator it = e.insertions().begin();
4885 it != e.insertions().end();
4888 for (vector<unsigned>::const_iterator iit =
4889 it->inserted_indexes().begin();
4890 iit != it->inserted_indexes().end();
4897 if (record_type && record_type->get_is_declaration_only())
4899 string name = d->get_name();
4900 string_decl_base_sptr_map::const_iterator j =
4901 priv_->deleted_member_types_.find(name);
4902 if (j != priv_->deleted_member_types_.end())
4904 if (*j->second != *d)
4905 priv_->changed_member_types_[name] =
4908 priv_->deleted_member_types_.erase(j);
4911 priv_->inserted_member_types_[name] = d;
4919 for (vector<deletion>::const_iterator it = e.deletions().begin();
4920 it != e.deletions().end();
4923 unsigned i = it->index();
4926 string name = data_member->get_anon_dm_reliable_name();
4928 ABG_ASSERT(priv_->deleted_data_members_.find(name)
4929 == priv_->deleted_data_members_.end());
4930 priv_->deleted_data_members_[name] = data_member;
4933 for (vector<insertion>::const_iterator it = e.insertions().begin();
4934 it != e.insertions().end();
4937 for (vector<unsigned>::const_iterator iit =
4938 it->inserted_indexes().begin();
4939 iit != it->inserted_indexes().end();
4946 string name = added_dm->get_anon_dm_reliable_name();
4947 ABG_ASSERT(priv_->inserted_data_members_.find(name)
4948 == priv_->inserted_data_members_.end());
4950 bool ignore_added_anonymous_data_member =
false;
4988 bool added_anon_dm_changes_dm =
false;
4991 vector<var_decl_sptr> dms_replaced_by_anon_dm;
5000 for (string_decl_base_sptr_map::const_iterator it =
5001 priv_->deleted_data_members_.begin();
5002 it != priv_->deleted_data_members_.end();
5011 string deleted_dm_name = it->second->get_name();
5027 size_t replaced_dm_offset =
5029 replacing_dm_offset =
5032 if (replaced_dm_offset != replacing_dm_offset)
5040 added_anon_dm_changes_dm =
true;
5044 if (replaced_dm->get_type()->get_size_in_bits()
5045 == replaced_dm->get_type()->get_size_in_bits())
5046 dms_replaced_by_anon_dm.push_back(replaced_dm);
5049 added_anon_dm_changes_dm =
true;
5058 if (!added_anon_dm_changes_dm
5059 && !dms_replaced_by_anon_dm.empty())
5062 type_base_sptr added_dm_type = added_dm->get_type();
5078 ignore_added_anonymous_data_member =
true;
5079 for (vector<var_decl_sptr>::const_iterator i =
5080 dms_replaced_by_anon_dm.begin();
5081 i != dms_replaced_by_anon_dm.end();
5084 string n = (*i)->get_name();
5085 priv_->dms_replaced_by_adms_[n] =
5087 priv_->deleted_data_members_.erase(n);
5093 if (!ignore_added_anonymous_data_member)
5106 string_decl_base_sptr_map::const_iterator j =
5107 priv_->deleted_data_members_.find(name);
5108 if (j != priv_->deleted_data_members_.end())
5110 if (*j->second != *d)
5113 priv_->subtype_changed_dm_[name]=
5116 priv_->deleted_data_members_.erase(j);
5119 priv_->inserted_data_members_[name] = d;
5127 for (string_decl_base_sptr_map::const_iterator i =
5128 priv_->deleted_data_members_.begin();
5129 i != priv_->deleted_data_members_.end();
5133 priv_->deleted_dm_by_offset_[offset] = i->second;
5136 for (string_decl_base_sptr_map::const_iterator i =
5137 priv_->inserted_data_members_.begin();
5138 i != priv_->inserted_data_members_.end();
5142 priv_->inserted_dm_by_offset_[offset] = i->second;
5145 for (unsigned_decl_base_sptr_map::const_iterator i =
5146 priv_->inserted_dm_by_offset_.begin();
5147 i != priv_->inserted_dm_by_offset_.end();
5150 unsigned_decl_base_sptr_map::const_iterator j =
5151 priv_->deleted_dm_by_offset_.find(i->first);
5152 if (j != priv_->deleted_dm_by_offset_.end())
5156 priv_->changed_dm_[i->first] =
5161 for (unsigned_var_diff_sptr_map::const_iterator i =
5162 priv_->changed_dm_.begin();
5163 i != priv_->changed_dm_.end();
5166 priv_->deleted_dm_by_offset_.erase(i->first);
5167 priv_->inserted_dm_by_offset_.erase(i->first);
5168 priv_->deleted_data_members_.erase
5169 (i->second->first_var()->get_anon_dm_reliable_name());
5170 priv_->inserted_data_members_.erase
5171 (i->second->second_var()->get_anon_dm_reliable_name());
5175 priv_->sorted_subtype_changed_dm_);
5177 priv_->sorted_changed_dm_);
5180 edit_script& e = priv_->member_class_tmpls_changes_;
5182 for (vector<deletion>::const_iterator it = e.deletions().begin();
5183 it != e.deletions().end();
5186 unsigned i = it->index();
5190 string name = d->get_name();
5191 ABG_ASSERT(priv_->deleted_member_class_tmpls_.find(name)
5192 == priv_->deleted_member_class_tmpls_.end());
5193 priv_->deleted_member_class_tmpls_[name] = d;
5196 for (vector<insertion>::const_iterator it = e.insertions().begin();
5197 it != e.insertions().end();
5200 for (vector<unsigned>::const_iterator iit =
5201 it->inserted_indexes().begin();
5202 iit != it->inserted_indexes().end();
5209 string name = d->get_name();
5210 ABG_ASSERT(priv_->inserted_member_class_tmpls_.find(name)
5211 == priv_->inserted_member_class_tmpls_.end());
5212 string_decl_base_sptr_map::const_iterator j =
5213 priv_->deleted_member_class_tmpls_.find(name);
5214 if (j != priv_->deleted_member_class_tmpls_.end())
5216 if (*j->second != *d)
5217 priv_->changed_member_types_[name]=
5219 priv_->deleted_member_class_tmpls_.erase(j);
5222 priv_->inserted_member_class_tmpls_[name] = d;
5227 priv_->sorted_changed_member_types_);
5236 priv_.reset(
new priv);
5247 class_or_union_sptr second_scope,
5265const class_or_union_diff::priv_ptr&
5278 return canonical->priv_;
5300{
return get_priv()->member_types_changes_;}
5306{
return get_priv()->member_types_changes_;}
5312{
return get_priv()->data_members_changes_;}
5318{
return get_priv()->data_members_changes_;}
5325{
return get_priv()->inserted_data_members_;}
5332{
return get_priv()->deleted_data_members_;}
5338{
return get_priv()->member_fns_changes_;}
5347{
return get_priv()->sorted_changed_member_functions_;}
5353{
return get_priv()->member_fns_changes_;}
5358{
return get_priv()->deleted_member_functions_;}
5363{
return get_priv()->inserted_member_functions_;}
5371{
return get_priv()->sorted_changed_dm_;}
5379{
return get_priv()->count_filtered_changed_dm(local);}
5386{
return get_priv()->sorted_subtype_changed_dm_;}
5393{
return get_priv()->count_filtered_subtype_changed_dm(local);}
5405{
return get_priv()->dms_replaced_by_adms_;}
5417 if (priv_->dms_replaced_by_adms_ordered_.empty())
5419 for (string_decl_base_sptr_map::const_iterator it =
5420 priv_->dms_replaced_by_adms_.begin();
5421 it != priv_->dms_replaced_by_adms_.end();
5428 priv_->dms_replaced_by_adms_ordered_.push_back(changed_dm);
5433 return priv_->dms_replaced_by_adms_ordered_;
5440{
return get_priv()->member_fn_tmpls_changes_;}
5446{
return get_priv()->member_fn_tmpls_changes_;}
5452{
return get_priv()->member_class_tmpls_changes_;}
5458{
return get_priv()->member_class_tmpls_changes_;}
5474 return ir::NO_CHANGE_KIND;
5487 context()->get_reporter()->report(*
this, out, indent);
5499 for (var_diff_sptrs_type::const_iterator i =
5500 get_priv()->sorted_subtype_changed_dm_.begin();
5501 i !=
get_priv()->sorted_subtype_changed_dm_.end();
5506 for (var_diff_sptrs_type::const_iterator i =
5507 get_priv()->sorted_changed_dm_.begin();
5508 i !=
get_priv()->sorted_changed_dm_.end();
5514 for (diff_sptrs_type::const_iterator i =
5515 get_priv()->sorted_changed_member_types_.begin();
5516 i !=
get_priv()->sorted_changed_member_types_.end();
5522 for (function_decl_diff_sptrs_type::const_iterator i =
5523 get_priv()->sorted_changed_member_functions_.begin();
5524 i !=
get_priv()->sorted_changed_member_functions_.end();
5539class_diff::clear_lookup_tables(
void)
5541 priv_->deleted_bases_.clear();
5542 priv_->inserted_bases_.clear();
5543 priv_->changed_bases_.clear();
5550class_diff::lookup_tables_empty(
void)
const
5552 return (priv_->deleted_bases_.empty()
5553 && priv_->inserted_bases_.empty()
5554 && priv_->changed_bases_.empty());
5564static string_member_function_sptr_map::const_iterator
5567 for (string_member_function_sptr_map::const_iterator i = map.begin();
5581class_diff::ensure_lookup_tables_populated(
void)
const
5585 if (!lookup_tables_empty())
5589 edit_script& e = get_priv()->base_changes_;
5591 for (vector<deletion>::const_iterator it = e.deletions().begin();
5592 it != e.deletions().end();
5595 unsigned i = it->index();
5598 string name = b->get_base_class()->get_qualified_name();
5599 ABG_ASSERT(get_priv()->deleted_bases_.find(name)
5600 == get_priv()->deleted_bases_.end());
5601 get_priv()->deleted_bases_[name] = b;
5604 for (vector<insertion>::const_iterator it = e.insertions().begin();
5605 it != e.insertions().end();
5608 for (vector<unsigned>::const_iterator iit =
5609 it->inserted_indexes().begin();
5610 iit != it->inserted_indexes().end();
5616 string name = b->get_base_class()->get_qualified_name();
5617 ABG_ASSERT(get_priv()->inserted_bases_.find(name)
5618 == get_priv()->inserted_bases_.end());
5619 string_base_sptr_map::const_iterator j =
5620 get_priv()->deleted_bases_.find(name);
5621 if (j != get_priv()->deleted_bases_.end())
5624 get_priv()->changed_bases_[name] =
5630 get_priv()->moved_bases_.push_back(b);
5631 get_priv()->deleted_bases_.erase(j);
5634 get_priv()->inserted_bases_[name] = b;
5640 get_priv()->sorted_deleted_bases_);
5642 get_priv()->sorted_inserted_bases_);
5644 get_priv()->sorted_changed_bases_);
5649 edit_script& e = p->member_fns_changes_;
5651 for (vector<deletion>::const_iterator it = e.deletions().begin();
5652 it != e.deletions().end();
5655 unsigned i = it->index();
5656 method_decl_sptr mem_fn =
5658 string name = mem_fn->get_linkage_name();
5660 name = mem_fn->get_pretty_representation();
5662 if (p->deleted_member_functions_.find(name)
5663 != p->deleted_member_functions_.end())
5665 p->deleted_member_functions_[name] = mem_fn;
5668 for (vector<insertion>::const_iterator it = e.insertions().begin();
5669 it != e.insertions().end();
5672 for (vector<unsigned>::const_iterator iit =
5673 it->inserted_indexes().begin();
5674 iit != it->inserted_indexes().end();
5679 method_decl_sptr mem_fn =
5681 string name = mem_fn->get_linkage_name();
5683 name = mem_fn->get_pretty_representation();
5685 if (p->inserted_member_functions_.find(name)
5686 != p->inserted_member_functions_.end())
5688 string_member_function_sptr_map::const_iterator j =
5689 p->deleted_member_functions_.find(name);
5691 if (j != p->deleted_member_functions_.end())
5693 if (*j->second != *mem_fn)
5694 p->changed_member_functions_[name] =
5695 compute_diff(static_pointer_cast<function_decl>(j->second),
5696 static_pointer_cast<function_decl>(mem_fn),
5698 p->deleted_member_functions_.erase(j);
5701 p->inserted_member_functions_[name] = mem_fn;
5748 vector<string> to_delete;
5749 corpus_sptr f =
context()->get_first_corpus(),
5750 s =
context()->get_second_corpus();
5752 for (string_member_function_sptr_map::const_iterator i =
5771 find_virtual_dtor_in_map(p->inserted_member_functions_);
5772 if (it != p->inserted_member_functions_.end())
5780 (!i->second->get_linkage_name().empty())
5781 ? i->second->get_linkage_name()
5782 : i->second->get_pretty_representation();
5783 to_delete.push_back(name);
5784 p->inserted_member_functions_.erase(it);
5791 if (!i->second->get_symbol()
5792 || s->lookup_function_symbol(*i->second->get_symbol()))
5793 to_delete.push_back(i->first);
5797 for (vector<string>::const_iterator i = to_delete.begin();
5798 i != to_delete.end();
5800 p->deleted_member_functions_.erase(*i);
5805 for (string_member_function_sptr_map::const_iterator i =
5814 if (!i->second->get_symbol()
5815 || f->lookup_function_symbol(*i->second->get_symbol()))
5816 to_delete.push_back(i->first);
5819 for (vector<string>::const_iterator i = to_delete.begin();
5820 i != to_delete.end();
5822 p->inserted_member_functions_.erase(*i);
5825 p->sorted_deleted_member_functions_);
5828 p->sorted_inserted_member_functions_);
5831 (p->changed_member_functions_,
5832 p->sorted_changed_member_functions_);
5839class_diff::allocate_priv_data()
5843 priv_.reset(
new priv);
5856 string qname = d->get_base_class()->get_qualified_name();
5857 string_base_diff_sptr_map::const_iterator it =
5858 changed_bases_.find(qname);
5860 return (it == changed_bases_.end())
5862 : it->second->second_base();
5873 size_t num_filtered = 0;
5874 for (base_diff_sptrs_type::const_iterator i = sorted_changed_bases_.begin();
5875 i != sorted_changed_bases_.end();
5882 return num_filtered;
5896 for (base_diff_sptrs_type::const_iterator i =
5897 get_priv()->sorted_changed_bases_.begin();
5898 i != get_priv()->sorted_changed_bases_.end();
5923class_diff::~class_diff()
5937const class_diff::priv_ptr&
5938class_diff::get_priv()
const
5950 return canonical->priv_;
5958 if (diff::priv_->pretty_representation_.empty())
5960 std::ostringstream o;
5966 diff::priv_->pretty_representation_ = o.str();
5968 return diff::priv_->pretty_representation_;
5987 return ir::NO_CHANGE_KIND;
5991shared_ptr<class_decl>
5998shared_ptr<class_decl>
6005{
return get_priv()->base_changes_;}
6013{
return get_priv()->deleted_bases_;}
6021{
return get_priv()->inserted_bases_;}
6028{
return get_priv()->sorted_changed_bases_;}
6036const vector<class_decl::base_spec_sptr>&
6038{
return get_priv()->moved_bases_;}
6043{
return get_priv()->base_changes_;}
6054 context()->get_reporter()->report(*
this, out, indent);
6079 ctxt->initialize_canonical_diff(changes);
6082 if (!ctxt->get_canonical_diff_for(first, second))
6086 diff_sptr canonical_diff = ctxt->get_canonical_diff_for(changes);
6088 ctxt->set_canonical_diff_for(first, second, canonical_diff);
6104 if (
is_class_diff(changes->get_canonical_diff()) == changes.get())
6107 changes->allocate_priv_data();
6119 f->get_base_specifiers().end(),
6120 s->get_base_specifiers().begin(),
6121 s->get_base_specifiers().end(),
6122 changes->base_changes());
6128 f->get_member_types().end(),
6129 s->get_member_types().begin(),
6130 s->get_member_types().end(),
6131 changes->member_types_changes());
6136 f->get_non_static_data_members().end(),
6137 s->get_non_static_data_members().begin(),
6138 s->get_non_static_data_members().end(),
6139 changes->data_members_changes());
6143 f->get_virtual_mem_fns().end(),
6144 s->get_virtual_mem_fns().begin(),
6145 s->get_virtual_mem_fns().end(),
6146 changes->member_fns_changes());
6149 compute_diff(f->get_member_function_templates().begin(),
6150 f->get_member_function_templates().end(),
6151 s->get_member_function_templates().begin(),
6152 s->get_member_function_templates().end(),
6153 changes->member_fn_tmpls_changes());
6158 f->get_member_class_templates().end(),
6159 s->get_member_class_templates().begin(),
6160 s->get_member_class_templates().end(),
6161 changes->member_class_tmpls_changes());
6164 changes->ensure_lookup_tables_populated();
6194 :
diff(first, second, ctxt),
6195 priv_(new
priv(underlying))
6203{
return dynamic_pointer_cast<class_decl::base_spec>(
first_subject());}
6210{
return dynamic_pointer_cast<class_decl::base_spec>(
second_subject());}
6219{
return priv_->underlying_class_diff_;}
6228{priv_->underlying_class_diff_ = d;}
6235 if (diff::priv_->pretty_representation_.empty())
6237 std::ostringstream o;
6243 diff::priv_->pretty_representation_ = o.str();
6245 return diff::priv_->pretty_representation_;
6264 return ir::NO_CHANGE_KIND;
6275 context()->get_reporter()->report(*
this, out, indent);
6297 second->get_base_class(),
6301 ctxt->initialize_canonical_diff(changes);
6316union_diff::clear_lookup_tables(
void)
6323union_diff::lookup_tables_empty(
void)
const
6329union_diff::ensure_lookup_tables_populated(
void)
const
6335union_diff::allocate_priv_data()
6348 union_decl_sptr second_union,
6371 if (diff::priv_->pretty_representation_.empty())
6373 std::ostringstream o;
6379 diff::priv_->pretty_representation_ = o.str();
6381 return diff::priv_->pretty_representation_;
6393 context()->get_reporter()->report(*
this, out, indent);
6408 const union_decl_sptr second,
6411 union_diff_sptr changes(
new union_diff(first, second, ctxt));
6413 ctxt->initialize_canonical_diff(changes);
6429 if (
is_union_diff(changes->get_canonical_diff()) == changes.get())
6432 changes->allocate_priv_data();
6443 compute_diff(first->get_non_static_data_members().begin(),
6444 first->get_non_static_data_members().end(),
6445 second->get_non_static_data_members().begin(),
6446 second->get_non_static_data_members().end(),
6447 changes->data_members_changes());
6452 first->get_mem_fns().end(),
6453 second->get_mem_fns().begin(),
6454 second->get_mem_fns().end(),
6455 changes->member_fns_changes());
6458 compute_diff(first->get_member_function_templates().begin(),
6459 first->get_member_function_templates().end(),
6460 second->get_member_function_templates().begin(),
6461 second->get_member_function_templates().end(),
6462 changes->member_fn_tmpls_changes());
6465 changes->ensure_lookup_tables_populated();
6479scope_diff::clear_lookup_tables()
6481 priv_->deleted_types_.clear();
6482 priv_->deleted_decls_.clear();
6483 priv_->inserted_types_.clear();
6484 priv_->inserted_decls_.clear();
6485 priv_->changed_types_.clear();
6486 priv_->changed_decls_.clear();
6487 priv_->removed_types_.clear();
6488 priv_->removed_decls_.clear();
6489 priv_->added_types_.clear();
6490 priv_->added_decls_.clear();
6500scope_diff::lookup_tables_empty()
const
6502 return (priv_->deleted_types_.empty()
6503 && priv_->deleted_decls_.empty()
6504 && priv_->inserted_types_.empty()
6505 && priv_->inserted_decls_.empty()
6506 && priv_->changed_types_.empty()
6507 && priv_->changed_decls_.empty()
6508 && priv_->removed_types_.empty()
6509 && priv_->removed_decls_.empty()
6510 && priv_->added_types_.empty()
6511 && priv_->added_decls_.empty());
6517scope_diff::ensure_lookup_tables_populated()
6519 if (!lookup_tables_empty())
6522 edit_script& e = priv_->member_changes_;
6525 for (
const auto& deletion : e.deletions())
6527 unsigned i = deletion.index();
6529 string qname = decl->get_qualified_name();
6533 if (klass_decl && klass_decl->get_is_declaration_only())
6544 == priv_->deleted_types_.end());
6545 priv_->deleted_types_[qname] = decl;
6550 == priv_->deleted_decls_.end());
6551 priv_->deleted_decls_[qname] = decl;
6557 for (vector<insertion>::const_iterator it = e.insertions().begin();
6558 it != e.insertions().end();
6561 for (vector<unsigned>::const_iterator i = it->inserted_indexes().begin();
6562 i != it->inserted_indexes().end();
6566 string qname = decl->get_qualified_name();
6570 dynamic_pointer_cast<class_decl>(decl);
6571 if (klass_decl && klass_decl->get_is_declaration_only())
6581 ABG_ASSERT(priv_->inserted_types_.find(qname)
6582 == priv_->inserted_types_.end());
6583 string_decl_base_sptr_map::const_iterator j =
6584 priv_->deleted_types_.find(qname);
6585 if (j != priv_->deleted_types_.end())
6587 if (*j->second != *decl)
6588 priv_->changed_types_[qname] =
6590 priv_->deleted_types_.erase(j);
6593 priv_->inserted_types_[qname] = decl;
6597 ABG_ASSERT(priv_->inserted_decls_.find(qname)
6598 == priv_->inserted_decls_.end());
6599 string_decl_base_sptr_map::const_iterator j =
6600 priv_->deleted_decls_.find(qname);
6601 if (j != priv_->deleted_decls_.end())
6603 if (*j->second != *decl)
6604 priv_->changed_decls_[qname] =
6606 priv_->deleted_decls_.erase(j);
6609 priv_->inserted_decls_[qname] = decl;
6615 priv_->sorted_changed_decls_);
6617 priv_->sorted_changed_types_);
6620 for (string_decl_base_sptr_map::const_iterator i =
6621 priv_->deleted_types_.begin();
6622 i != priv_->deleted_types_.end();
6625 string_decl_base_sptr_map::const_iterator r =
6626 priv_->inserted_types_.find(i->first);
6627 if (r == priv_->inserted_types_.end())
6628 priv_->removed_types_[i->first] = i->second;
6630 for (string_decl_base_sptr_map::const_iterator i =
6631 priv_->deleted_decls_.begin();
6632 i != priv_->deleted_decls_.end();
6635 string_decl_base_sptr_map::const_iterator r =
6636 priv_->inserted_decls_.find(i->first);
6637 if (r == priv_->inserted_decls_.end())
6638 priv_->removed_decls_[i->first] = i->second;
6642 for (string_decl_base_sptr_map::const_iterator i =
6643 priv_->inserted_types_.begin();
6644 i != priv_->inserted_types_.end();
6647 string_decl_base_sptr_map::const_iterator r =
6648 priv_->deleted_types_.find(i->first);
6649 if (r == priv_->deleted_types_.end())
6650 priv_->added_types_[i->first] = i->second;
6652 for (string_decl_base_sptr_map::const_iterator i =
6653 priv_->inserted_decls_.begin();
6654 i != priv_->inserted_decls_.end();
6657 string_decl_base_sptr_map::const_iterator r =
6658 priv_->deleted_decls_.find(i->first);
6659 if (r == priv_->deleted_decls_.end())
6660 priv_->added_decls_[i->first] = i->second;
6672 for (diff_sptrs_type::const_iterator i =
changed_types().begin();
6678 for (diff_sptrs_type::const_iterator i =
changed_decls().begin();
6698 :
diff(first_scope, second_scope, ctxt),
6736{
return priv_->member_changes_;}
6758{
return priv_->member_changes_;}
6773 return scope->get_member_decls()[i];
6804 return scope->get_member_decls()[i];
6825{
return priv_->sorted_changed_types_;}
6831{
return priv_->sorted_changed_decls_;}
6834scope_diff::removed_types()
const
6835{
return priv_->removed_types_;}
6838scope_diff::removed_decls()
const
6839{
return priv_->removed_decls_;}
6842scope_diff::added_types()
const
6843{
return priv_->added_types_;}
6846scope_diff::added_decls()
const
6847{
return priv_->added_decls_;}
6854 if (diff::priv_->pretty_representation_.empty())
6856 std::ostringstream o;
6862 diff::priv_->pretty_representation_ = o.str();
6864 return diff::priv_->pretty_representation_;
6886 return ir::NO_CHANGE_KIND;
6897 context()->get_reporter()->report(*
this, out, indent);
6923 ABG_ASSERT(d->first_scope() == first && d->second_scope() == second);
6926 first->get_member_decls().end(),
6927 second->get_member_decls().begin(),
6928 second->get_member_decls().end(),
6929 d->member_changes());
6931 d->ensure_lookup_tables_populated();
6957 ctxt->initialize_canonical_diff(d);
6981 ABG_ASSERT(first->get_index() == second->get_index());
6994{
return dynamic_pointer_cast<function_decl::parameter>(
first_subject());}
7002{
return dynamic_pointer_cast<function_decl::parameter>(
second_subject());}
7012{
return priv_->type_diff;}
7022 if (diff::priv_->pretty_representation_.empty())
7024 std::ostringstream o;
7025 o <<
"function_parameter_diff["
7030 diff::priv_->pretty_representation_ = o.str();
7032 return diff::priv_->pretty_representation_;
7053 return ir::NO_CHANGE_KIND;
7064 context()->get_reporter()->report(*
this, out, indent);
7098 if (!first || !second)
7102 ctxt->initialize_canonical_diff(result);
7111function_type_diff::ensure_lookup_tables_populated()
7113 priv_->return_type_diff_ =
7120 for (vector<deletion>::const_iterator i =
7121 priv_->parm_changes_.deletions().begin();
7122 i != priv_->parm_changes_.deletions().end();
7127 parm_name = parm->get_name_id();
7131 priv_->deleted_parms_[parm_name] = parm;
7132 priv_->deleted_parms_by_id_[parm->get_index()] = parm;
7135 for (vector<insertion>::const_iterator i =
7136 priv_->parm_changes_.insertions().begin();
7137 i != priv_->parm_changes_.insertions().end();
7140 for (vector<unsigned>::const_iterator j =
7141 i->inserted_indexes().begin();
7142 j != i->inserted_indexes().end();
7146 parm_name = parm->get_name_id();
7151 string_parm_map::const_iterator k =
7152 priv_->deleted_parms_.find(parm_name);
7153 if (k != priv_->deleted_parms_.end())
7155 if (*k->second != *parm)
7156 priv_->subtype_changed_parms_[parm_name] =
7158 priv_->deleted_parms_.erase(parm_name);
7161 priv_->added_parms_[parm_name] = parm;
7164 unsigned_parm_map::const_iterator k =
7165 priv_->deleted_parms_by_id_.find(parm->get_index());
7166 if (k != priv_->deleted_parms_by_id_.end())
7168 if (*k->second != *parm
7169 && (k->second->get_name_id() != parm_name))
7170 priv_->changed_parms_by_id_[parm->get_index()] =
7172 priv_->added_parms_.erase(parm_name);
7173 priv_->deleted_parms_.erase(k->second->get_name_id());
7174 priv_->deleted_parms_by_id_.erase(parm->get_index());
7177 priv_->added_parms_by_id_[parm->get_index()] = parm;
7183 priv_->sorted_subtype_changed_parms_);
7185 priv_->sorted_changed_parms_by_id_);
7187 priv_->sorted_deleted_parms_);
7190 priv_->sorted_added_parms_);
7200function_type_diff::deleted_parameter_at(
int i)
const
7206const vector<function_decl::parameter_sptr>&
7208{
return priv_->sorted_deleted_parms_;}
7213const vector<function_decl::parameter_sptr>&
7215{
return priv_->sorted_added_parms_;}
7224function_type_diff::inserted_parameter_at(
int i)
const
7252{
return dynamic_pointer_cast<function_type>(
first_subject());}
7268{
return priv_->return_type_diff_;}
7275{
return priv_->subtype_changed_parms_;}
7282{
return priv_->deleted_parms_;}
7289{
return priv_->added_parms_;}
7299 if (diff::priv_->pretty_representation_.empty())
7301 std::ostringstream o;
7302 o <<
"function_type_diff["
7307 diff::priv_->pretty_representation_ = o.str();
7309 return diff::priv_->pretty_representation_;
7333 return ir::NO_CHANGE_KIND;
7345 context()->get_reporter()->report(*
this, out, indent);
7359 for (vector<fn_parm_diff_sptr>::const_iterator i =
7360 priv_->sorted_subtype_changed_parms_.begin();
7361 i != priv_->sorted_subtype_changed_parms_.end();
7366 for (vector<fn_parm_diff_sptr>::const_iterator i =
7367 priv_->sorted_changed_parms_by_id_.begin();
7368 i != priv_->sorted_changed_parms_by_id_.end();
7391 if (!first || !second)
7400 first->get_parameters().end(),
7401 second->get_first_parm(),
7402 second->get_parameters().end(),
7403 result->priv_->parm_changes_);
7405 result->ensure_lookup_tables_populated();
7407 ctxt->initialize_canonical_diff(result);
7417function_decl_diff::ensure_lookup_tables_populated()
7454{
return dynamic_pointer_cast<function_decl>(
first_subject());}
7462function_decl_diff::type_diff()
const
7463{
return priv_->type_diff_;}
7470 if (diff::priv_->pretty_representation_.empty())
7472 std::ostringstream o;
7473 o <<
"function_diff["
7478 diff::priv_->pretty_representation_ = o.str();
7480 return diff::priv_->pretty_representation_;
7499 return ir::NO_CHANGE_KIND;
7511 context()->get_reporter()->report(*
this, out, indent);
7531 if (!first || !second)
7543 result->priv_->type_diff_ = type_diff;
7545 result->ensure_lookup_tables_populated();
7547 ctxt->initialize_canonical_diff(result);
7591 if (diff::priv_->pretty_representation_.empty())
7593 std::ostringstream o;
7594 o <<
"type_decl_diff["
7599 diff::priv_->pretty_representation_ = o.str();
7601 return diff::priv_->pretty_representation_;
7619 return ir::NO_CHANGE_KIND;
7630 context()->get_reporter()->report(*
this, out, indent);
7668 ctxt->initialize_canonical_diff(result);
7705 priv_(new
priv(underlying))
7713{
return dynamic_pointer_cast<typedef_decl>(
first_subject());}
7729{
return priv_->underlying_type_diff_;}
7738{priv_->underlying_type_diff_ = d;}
7745 if (diff::priv_->pretty_representation_.empty())
7747 std::ostringstream o;
7748 o <<
"typedef_diff["
7753 diff::priv_->pretty_representation_ = o.str();
7755 return diff::priv_->pretty_representation_;
7777 return ir::NO_CHANGE_KIND;
7789 context()->get_reporter()->report(*
this, out, indent);
7809 diff_sptr d = compute_diff_for_types(first->get_underlying_type(),
7810 second->get_underlying_type(),
7814 ctxt->initialize_canonical_diff(result);
7866 priv_(new
priv(first, second))
7875{
return priv_->first_;}
7882{
return priv_->second_;}
7896{
return ir::NO_CHANGE_KIND;}
7935 compute_diff(static_pointer_cast<scope_decl>(first->get_global_scope()),
7936 static_pointer_cast<scope_decl>(second->get_global_scope()),
7940 ctxt->initialize_canonical_diff(tu_diff);
7950struct diff_maps::priv
7973diff_maps::~diff_maps() =
default;
7980{
return priv_->type_decl_diff_map_;}
7987{
return priv_->type_decl_diff_map_;}
7994{
return priv_->enum_diff_map_;}
8001{
return priv_->enum_diff_map_;}
8008{
return priv_->class_diff_map_;}
8015{
return priv_->class_diff_map_;}
8022{
return priv_->union_diff_map_;}
8029{
return priv_->union_diff_map_;}
8036{
return priv_->typedef_diff_map_;}
8043{
return priv_->typedef_diff_map_;}
8050{
return priv_->subrange_diff_map_;}
8057{
return priv_->subrange_diff_map_;}
8064{
return priv_->array_diff_map_;}
8071{
return priv_->array_diff_map_;}
8078{
return priv_->reference_diff_map_;}
8085{{
return priv_->reference_diff_map_;}}
8092{
return priv_->fn_parm_diff_map_;}
8099{
return priv_->fn_parm_diff_map_;}
8106{
return priv_->function_type_diff_map_;}
8113{
return priv_->function_type_diff_map_;}
8120{
return priv_->function_decl_diff_map_;}
8127{
return priv_->function_decl_diff_map_;}
8134{
return priv_->var_decl_diff_map_;}
8141{
return priv_->var_decl_diff_map_;}
8148{
return priv_->distinct_diff_map_;}
8155{
return priv_->distinct_diff_map_;}
8213 diff_artifact_set_map_type::iterator i =
8214 priv_->impacted_artifacts_map_.find(dif);
8216 if (i == priv_->impacted_artifacts_map_.end())
8219 set.insert(impacted_iface);
8220 priv_->impacted_artifacts_map_[dif] = set;
8223 i->second.insert(impacted_iface);
8237 diff_artifact_set_map_type::iterator i =
8238 priv_->impacted_artifacts_map_.find(d);
8240 if (i == priv_->impacted_artifacts_map_.end())
8256 : priv_(new
priv(ctxt))
8264{
return priv_->num_func_removed;}
8271{priv_->num_func_removed = n;}
8281 if (priv_->ctxt() && !priv_->ctxt()->show_deleted_fns())
8282 return num_func_removed();
8283 return priv_->num_removed_func_filtered_out;
8292{priv_->num_removed_func_filtered_out = t;}
8303 ABG_ASSERT(num_func_removed() >= num_removed_func_filtered_out());
8304 return num_func_removed() - num_removed_func_filtered_out();
8312{
return priv_->num_func_added;}
8319{priv_->num_func_added = n;}
8327 if (priv_->ctxt() && !priv_->ctxt()->show_added_fns())
8328 return num_func_added();
8329 return priv_->num_added_func_filtered_out;
8338{priv_->num_added_func_filtered_out = n;}
8350 ABG_ASSERT(num_func_added() >= num_added_func_filtered_out());
8351 return num_func_added() - num_added_func_filtered_out();
8361{
return priv_->num_func_changed;}
8370{priv_->num_func_changed = n;}
8379{
return priv_->num_changed_func_filtered_out;}
8388{priv_->num_changed_func_filtered_out = n;}
8396{
return priv_->num_func_with_virt_offset_changes;}
8405{priv_->num_func_with_virt_offset_changes = n;}
8416{
return num_func_changed() - num_changed_func_filtered_out();}
8423{
return priv_->num_vars_removed;}
8430{priv_->num_vars_removed = n;}
8439 if (priv_->ctxt() && !priv_->ctxt()->show_deleted_vars())
8440 return num_vars_removed();
8441 return priv_->num_removed_vars_filtered_out;
8450{priv_->num_removed_vars_filtered_out = n;}
8462 ABG_ASSERT(num_vars_removed() >= num_removed_vars_filtered_out());
8463 return num_vars_removed() - num_removed_vars_filtered_out();
8471{
return priv_->num_vars_added;}
8478{priv_->num_vars_added = n;}
8487 if (priv_->ctxt() && !priv_->ctxt()->show_added_vars())
8488 return num_vars_added();
8489 return priv_->num_added_vars_filtered_out;
8498{priv_->num_added_vars_filtered_out = n;}
8510 ABG_ASSERT(num_vars_added() >= num_added_vars_filtered_out());
8511 return num_vars_added() - num_added_vars_filtered_out();
8521{
return priv_->num_vars_changed;}
8530{priv_->num_vars_changed = n;}
8539{
return priv_->num_changed_vars_filtered_out;}
8548{priv_->num_changed_vars_filtered_out = n;}
8559{
return num_vars_changed() - num_changed_vars_filtered_out();}
8568{
return priv_->num_func_syms_removed;}
8577{priv_->num_func_syms_removed = n;}
8588 && !priv_->ctxt()->show_symbols_unreferenced_by_debug_info())
8589 return num_func_syms_removed();
8590 return priv_->num_removed_func_syms_filtered_out;
8600{priv_->num_removed_func_syms_filtered_out = n;}
8615 ABG_ASSERT(num_func_syms_removed() >= num_removed_func_syms_filtered_out());
8616 return num_func_syms_removed() - num_removed_func_syms_filtered_out();
8626{
return priv_->num_func_syms_added;}
8635{priv_->num_func_syms_added = n;}
8646 && !(priv_->ctxt()->show_added_symbols_unreferenced_by_debug_info()
8647 && priv_->ctxt()->show_symbols_unreferenced_by_debug_info()))
8648 return num_func_syms_added();
8649 return priv_->num_added_func_syms_filtered_out;
8659{priv_->num_added_func_syms_filtered_out = n;}
8674 ABG_ASSERT(num_func_syms_added() >= num_added_func_syms_filtered_out());
8675 return num_func_syms_added()- num_added_func_syms_filtered_out();
8685{
return priv_->num_var_syms_removed;}
8694{priv_->num_var_syms_removed = n;}
8705 && !priv_->ctxt()->show_symbols_unreferenced_by_debug_info())
8706 return num_var_syms_removed();
8707 return priv_->num_removed_var_syms_filtered_out;
8717{priv_->num_removed_var_syms_filtered_out = n;}
8732 ABG_ASSERT(num_var_syms_removed() >= num_removed_var_syms_filtered_out());
8733 return num_var_syms_removed() - num_removed_var_syms_filtered_out();
8743{
return priv_->num_var_syms_added;}
8752{priv_->num_var_syms_added = n;}
8763 && !(priv_->ctxt()->show_added_symbols_unreferenced_by_debug_info()
8764 && priv_->ctxt()->show_symbols_unreferenced_by_debug_info()))
8765 return num_var_syms_added();
8766 return priv_->num_added_var_syms_filtered_out;
8776{priv_->num_added_var_syms_filtered_out = n;}
8791 ABG_ASSERT(num_var_syms_added() >= num_added_var_syms_filtered_out());
8792 return num_var_syms_added() - num_added_var_syms_filtered_out();
8800{
return priv_->num_leaf_changes;}
8807{priv_->num_leaf_changes = n;}
8815{
return priv_->num_leaf_changes_filtered_out;}
8824{priv_->num_leaf_changes_filtered_out = n;}
8837 ABG_ASSERT(num_leaf_changes() >= num_leaf_changes_filtered_out());
8838 return num_leaf_changes() - num_leaf_changes_filtered_out();
8846{
return priv_->num_leaf_type_changes;}
8853{priv_->num_leaf_type_changes = n;}
8860{
return priv_->num_leaf_type_changes_filtered_out;}
8866{priv_->num_leaf_type_changes_filtered_out = n;}
8876{
return num_leaf_type_changes() - num_leaf_type_changes_filtered_out();}
8883{
return priv_->num_leaf_func_changes;}
8890{priv_->num_leaf_func_changes = n;}
8899{
return priv_->num_leaf_func_changes_filtered_out;}
8908{priv_->num_leaf_func_changes_filtered_out = n;}
8919{
return num_leaf_func_changes() - num_leaf_func_changes_filtered_out();}
8926{
return priv_->num_leaf_var_changes;}
8933{priv_->num_leaf_var_changes = n;}
8945{
return priv_->num_added_unreachable_types;}
8958{priv_->num_added_unreachable_types = n;}
8969{
return priv_->num_added_unreachable_types_filtered_out;}
8980{priv_->num_added_unreachable_types_filtered_out = n;}
8994 num_added_unreachable_types_filtered_out());
8996 return (num_added_unreachable_types()
8998 num_added_unreachable_types_filtered_out());
9011{
return priv_->num_removed_unreachable_types;}
9023{priv_->num_removed_unreachable_types = n;}
9034{
return priv_->num_removed_unreachable_types_filtered_out;}
9045{priv_->num_removed_unreachable_types_filtered_out = n;}
9059 num_removed_unreachable_types_filtered_out());
9061 return (num_removed_unreachable_types()
9063 num_removed_unreachable_types_filtered_out());
9076{
return priv_->num_changed_unreachable_types;}
9088{priv_->num_changed_unreachable_types = n;}
9099{
return priv_->num_changed_unreachable_types_filtered_out;}
9110{priv_->num_changed_unreachable_types_filtered_out = n;}
9124 num_changed_unreachable_types_filtered_out());
9126 return (num_changed_unreachable_types()
9128 num_changed_unreachable_types_filtered_out());
9138{
return priv_->num_leaf_var_changes_filtered_out;}
9147{priv_->num_leaf_var_changes_filtered_out = n;}
9158{
return num_leaf_var_changes() - num_leaf_var_changes_filtered_out();}
9168{
return ctxt_.lock();}
9176 return (deleted_fns_.empty()
9177 && added_fns_.empty()
9178 && changed_fns_map_.empty()
9179 && deleted_vars_.empty()
9180 && added_vars_.empty()
9181 && changed_vars_map_.empty());
9188 deleted_fns_.clear();
9190 changed_fns_map_.clear();
9191 deleted_vars_.clear();
9192 added_vars_.clear();
9193 changed_vars_map_.clear();
9201 if (!lookup_tables_empty())
9209 for (vector<deletion>::const_iterator it = e.deletions().begin();
9210 it != e.deletions().end();
9213 unsigned i = it->index();
9214 ABG_ASSERT(i < first_->get_functions().size());
9223 deleted_fns_[n] = deleted_fn;
9226 for (vector<insertion>::const_iterator it = e.insertions().begin();
9227 it != e.insertions().end();
9230 for (vector<unsigned>::const_iterator iit =
9231 it->inserted_indexes().begin();
9232 iit != it->inserted_indexes().end();
9243 string_function_ptr_map::const_iterator j =
9244 deleted_fns_.find(n);
9245 if (j != deleted_fns_.end())
9250 if (*j->second != *added_fn)
9251 changed_fns_map_[j->first] = d;
9252 deleted_fns_.erase(j);
9255 added_fns_[n] = added_fn;
9264 vector<string> to_delete;
9265 for (string_function_ptr_map::const_iterator i = deleted_fns_.begin();
9266 i != deleted_fns_.end();
9268 if (second_->lookup_function_symbol(*i->second->get_symbol()))
9269 to_delete.push_back(i->first);
9271 for (vector<string>::const_iterator i = to_delete.begin();
9272 i != to_delete.end();
9274 deleted_fns_.erase(*i);
9279 for (string_function_ptr_map::const_iterator i = added_fns_.begin();
9280 i != added_fns_.end();
9283 if (first_->lookup_function_symbol(*i->second->get_symbol()))
9284 to_delete.push_back(i->first);
9285 else if (! i->second->get_symbol()->get_version().is_empty()
9286 && i->second->get_symbol()->get_version().is_default())
9294 if (first_->lookup_function_symbol(i->second->get_symbol()->get_name(),
9296 to_delete.push_back(i->first);
9300 for (vector<string>::const_iterator i = to_delete.begin();
9301 i != to_delete.end();
9303 added_fns_.erase(*i);
9309 for (vector<deletion>::const_iterator it = e.deletions().begin();
9310 it != e.deletions().end();
9313 unsigned i = it->index();
9314 ABG_ASSERT(i < first_->get_variables().size());
9316 var_decl* deleted_var = first_->get_variables()[i];
9317 string n = deleted_var->
get_id();
9319 ABG_ASSERT(deleted_vars_.find(n) == deleted_vars_.end());
9320 deleted_vars_[n] = deleted_var;
9323 for (vector<insertion>::const_iterator it = e.insertions().begin();
9324 it != e.insertions().end();
9327 for (vector<unsigned>::const_iterator iit =
9328 it->inserted_indexes().begin();
9329 iit != it->inserted_indexes().end();
9333 var_decl* added_var = second_->get_variables()[i];
9334 string n = added_var->
get_id();
9337 string_var_ptr_map::const_iterator k = added_vars_.find(n);
9338 if ( k != added_vars_.end())
9345 string_var_ptr_map::const_iterator j =
9346 deleted_vars_.find(n);
9347 if (j != deleted_vars_.end())
9349 if (*j->second != *added_var)
9355 deleted_vars_.erase(j);
9358 added_vars_[n] = added_var;
9362 sorted_changed_vars_);
9368 vector<string> to_delete;
9369 for (string_var_ptr_map::const_iterator i = deleted_vars_.begin();
9370 i != deleted_vars_.end();
9372 if (second_->lookup_variable_symbol(*i->second->get_symbol()))
9373 to_delete.push_back(i->first);
9375 for (vector<string>::const_iterator i = to_delete.begin();
9376 i != to_delete.end();
9378 deleted_vars_.erase(*i);
9383 for (string_var_ptr_map::const_iterator i = added_vars_.begin();
9384 i != added_vars_.end();
9386 if (first_->lookup_variable_symbol(*i->second->get_symbol()))
9387 to_delete.push_back(i->first);
9388 else if (! i->second->get_symbol()->get_version().is_empty()
9389 && i->second->get_symbol()->get_version().is_default())
9397 if (first_->lookup_variable_symbol(i->second->get_symbol()->get_name(),
9399 to_delete.push_back(i->first);
9402 for (vector<string>::const_iterator i = to_delete.begin();
9403 i != to_delete.end();
9405 added_vars_.erase(*i);
9413 for (vector<deletion>::const_iterator it = e.deletions().begin();
9414 it != e.deletions().end();
9417 unsigned i = it->index();
9418 ABG_ASSERT(i < first_->get_unreferenced_function_symbols().size());
9420 first_->get_unreferenced_function_symbols()[i];
9421 if (!second_->lookup_function_symbol(*deleted_sym))
9422 deleted_unrefed_fn_syms_[deleted_sym->get_id_string()] = deleted_sym;
9425 for (vector<insertion>::const_iterator it = e.insertions().begin();
9426 it != e.insertions().end();
9429 for (vector<unsigned>::const_iterator iit =
9430 it->inserted_indexes().begin();
9431 iit != it->inserted_indexes().end();
9435 ABG_ASSERT(i < second_->get_unreferenced_function_symbols().size());
9437 second_->get_unreferenced_function_symbols()[i];
9438 if ((deleted_unrefed_fn_syms_.find(added_sym->get_id_string())
9439 == deleted_unrefed_fn_syms_.end()))
9441 if (!first_->lookup_function_symbol(*added_sym))
9444 if (! added_sym->get_version().is_empty()
9445 && added_sym->get_version().is_default())
9453 if (first_->lookup_function_symbol(added_sym->get_name(),
9459 added_unrefed_fn_syms_[added_sym->get_id_string()] =
9464 deleted_unrefed_fn_syms_.erase(added_sym->get_id_string());
9474 for (vector<deletion>::const_iterator it = e.deletions().begin();
9475 it != e.deletions().end();
9478 unsigned i = it->index();
9479 ABG_ASSERT(i < first_->get_unreferenced_variable_symbols().size());
9481 first_->get_unreferenced_variable_symbols()[i];
9482 if (!second_->lookup_variable_symbol(*deleted_sym))
9483 deleted_unrefed_var_syms_[deleted_sym->get_id_string()] = deleted_sym;
9486 for (vector<insertion>::const_iterator it = e.insertions().begin();
9487 it != e.insertions().end();
9490 for (vector<unsigned>::const_iterator iit =
9491 it->inserted_indexes().begin();
9492 iit != it->inserted_indexes().end();
9496 ABG_ASSERT(i < second_->get_unreferenced_variable_symbols().size());
9498 second_->get_unreferenced_variable_symbols()[i];
9499 if (deleted_unrefed_var_syms_.find(added_sym->get_id_string())
9500 == deleted_unrefed_var_syms_.end())
9502 if (!first_->lookup_variable_symbol(*added_sym))
9505 if (! added_sym->get_version().is_empty()
9506 && added_sym->get_version().is_default())
9514 if (first_->lookup_variable_symbol(added_sym->get_name(),
9520 added_unrefed_var_syms_[added_sym->get_id_string()] =
9525 deleted_unrefed_var_syms_.erase(added_sym->get_id_string());
9536 for (vector<deletion>::const_iterator it = e.deletions().begin();
9537 it != e.deletions().end();
9540 unsigned i = it->index();
9542 (first_->get_types_not_reachable_from_public_interfaces()[i]);
9548 deleted_unreachable_types_[repr] = t;
9553 for (vector<insertion>::const_iterator it = e.insertions().begin();
9554 it != e.insertions().end();
9557 for (vector<unsigned>::const_iterator iit =
9558 it->inserted_indexes().begin();
9559 iit != it->inserted_indexes().end();
9564 (second_->get_types_not_reachable_from_public_interfaces()[i]);
9582 string_type_base_sptr_map::const_iterator j =
9583 deleted_unreachable_types_.find(repr);
9584 if (j != deleted_unreachable_types_.end())
9589 decl_base_sptr old_type =
is_decl(j->second);
9590 decl_base_sptr new_type =
is_decl(t);
9591 if (old_type != new_type)
9599 changed_unreachable_types_[repr]= d;
9605 deleted_unreachable_types_.erase(j);
9610 added_unreachable_types_[repr] = t;
9640 return fn_suppr->suppresses_function(fn, k, ctxt);
9659variable_is_suppressed(
const var_decl* var,
9667 return var_suppr->suppresses_variable(var, k, ctxt);
9679 for (suppressions_type::const_iterator i = suppressions.begin();
9680 i != suppressions.end();
9687 for (string_function_ptr_map::const_iterator e = added_fns_.begin();
9688 e != added_fns_.end();
9690 if (function_is_suppressed(e->second, fn_suppr,
9693 suppressed_added_fns_[e->first] = e->second;
9696 for (string_function_ptr_map::const_iterator e = deleted_fns_.begin();
9697 e != deleted_fns_.end();
9699 if (function_is_suppressed(e->second, fn_suppr,
9702 suppressed_deleted_fns_[e->first] = e->second;
9705 for (string_elf_symbol_map::const_iterator e =
9706 added_unrefed_fn_syms_.begin();
9707 e != added_unrefed_fn_syms_.end();
9709 if (fn_suppr->suppresses_function_symbol(e->second,
9712 suppressed_added_unrefed_fn_syms_[e->first] = e->second;
9715 for (string_elf_symbol_map::const_iterator e =
9716 deleted_unrefed_fn_syms_.begin();
9717 e != deleted_unrefed_fn_syms_.end();
9719 if (fn_suppr->suppresses_function_symbol(e->second,
9722 suppressed_deleted_unrefed_fn_syms_[e->first] = e->second;
9730 for (string_function_ptr_map::const_iterator e = added_fns_.begin();
9731 e != added_fns_.end();
9740 if (type_suppr->suppresses_type(c, ctxt))
9741 suppressed_added_fns_[e->first] = e->second;
9744 for (string_function_ptr_map::const_iterator e = deleted_fns_.begin();
9745 e != deleted_fns_.end();
9754 if (type_suppr->suppresses_type(c, ctxt))
9755 suppressed_deleted_fns_[e->first] = e->second;
9760 for (string_type_base_sptr_map::const_iterator e =
9761 deleted_unreachable_types_.begin();
9762 e != deleted_unreachable_types_.end();
9764 if (type_suppr->suppresses_type(e->second, ctxt))
9765 suppressed_deleted_unreachable_types_[e->first] = e->second;
9769 for (string_type_base_sptr_map::const_iterator e =
9770 added_unreachable_types_.begin();
9771 e != added_unreachable_types_.end();
9773 if (type_suppr->suppresses_type(e->second, ctxt))
9774 suppressed_added_unreachable_types_[e->first] = e->second;
9781 for (string_var_ptr_map::const_iterator e = added_vars_.begin();
9782 e != added_vars_.end();
9784 if (variable_is_suppressed(e->second, var_suppr,
9787 suppressed_added_vars_[e->first] = e->second;
9790 for (string_var_ptr_map::const_iterator e = deleted_vars_.begin();
9791 e != deleted_vars_.end();
9793 if (variable_is_suppressed(e->second, var_suppr,
9796 suppressed_deleted_vars_[e->first] = e->second;
9799 for (string_elf_symbol_map::const_iterator e =
9800 added_unrefed_var_syms_.begin();
9801 e != added_unrefed_var_syms_.end();
9803 if (var_suppr->suppresses_variable_symbol(e->second,
9806 suppressed_added_unrefed_var_syms_[e->first] = e->second;
9809 for (string_elf_symbol_map::const_iterator e =
9810 deleted_unrefed_var_syms_.begin();
9811 e != deleted_unrefed_var_syms_.end();
9813 if (var_suppr->suppresses_variable_symbol(e->second,
9816 suppressed_deleted_unrefed_var_syms_[e->first] = e->second;
9834 string_function_ptr_map::const_iterator i =
9835 suppressed_deleted_fns_.find(fn->
get_id());
9837 return (i != suppressed_deleted_fns_.end());
9854 string_type_base_sptr_map::const_iterator i =
9855 suppressed_added_unreachable_types_.find(repr);
9856 if (i == suppressed_added_unreachable_types_.end())
9876 string_type_base_sptr_map::const_iterator i =
9877 suppressed_deleted_unreachable_types_.find(repr);
9878 if (i == suppressed_deleted_unreachable_types_.end())
9897 string_function_ptr_map::const_iterator i =
9898 suppressed_added_fns_.find(fn->
get_id());
9900 return (i != suppressed_added_fns_.end());
9916 string_var_ptr_map::const_iterator i =
9917 suppressed_deleted_vars_.find(var->
get_id());
9919 return (i != suppressed_deleted_vars_.end());
9935 string_var_ptr_map::const_iterator i =
9936 suppressed_added_vars_.find(var->
get_id());
9938 return (i != suppressed_added_vars_.end());
9954 string_elf_symbol_map::const_iterator i =
9955 suppressed_deleted_unrefed_fn_syms_.find(s->
get_id_string());
9957 return (i != suppressed_deleted_unrefed_fn_syms_.end());
9973 string_elf_symbol_map::const_iterator i =
9976 return (i != suppressed_added_unrefed_fn_syms_.end());
9992 string_elf_symbol_map::const_iterator i =
9993 suppressed_deleted_unrefed_var_syms_.find(s->
get_id_string());
9995 return (i != suppressed_deleted_unrefed_var_syms_.end());
10011 string_elf_symbol_map::const_iterator i =
10012 suppressed_added_unrefed_var_syms_.find(s->
get_id_string());
10014 return (i != suppressed_added_unrefed_var_syms_.end());
10017#ifdef do_count_diff_map_changes
10018#undef do_count_diff_map_changes
10020#define do_count_diff_map_changes(diff_map, n_changes, n_filtered) \
10022 string_diff_ptr_map::const_iterator i; \
10023 for (i = diff_map.begin(); \
10024 i != diff_map.end(); \
10027 if (const var_diff* d = is_var_diff(i->second)) \
10028 if (is_data_member(d->first_var())) \
10031 if (i->second->has_local_changes()) \
10033 if (!i->second->get_canonical_diff()->to_be_reported()) \
10049 count_leaf_type_changes(num_changes, num_filtered);
10052 do_count_diff_map_changes(leaf_diffs_.get_function_decl_diff_map(),
10053 num_changes, num_filtered);
10054 do_count_diff_map_changes(leaf_diffs_.get_var_decl_diff_map(),
10055 num_changes, num_filtered);
10068 size_t &num_filtered)
10070 do_count_diff_map_changes(leaf_diffs_.get_type_decl_diff_map(),
10071 num_changes, num_filtered);
10072 do_count_diff_map_changes(leaf_diffs_.get_enum_diff_map(),
10073 num_changes, num_filtered);
10074 do_count_diff_map_changes(leaf_diffs_.get_class_diff_map(),
10075 num_changes, num_filtered);
10076 do_count_diff_map_changes(leaf_diffs_.get_union_diff_map(),
10077 num_changes, num_filtered);
10078 do_count_diff_map_changes(leaf_diffs_.get_typedef_diff_map(),
10079 num_changes, num_filtered);
10080 do_count_diff_map_changes(leaf_diffs_.get_subrange_diff_map(),
10081 num_changes, num_filtered);
10082 do_count_diff_map_changes(leaf_diffs_.get_array_diff_map(),
10083 num_changes, num_filtered);
10084 do_count_diff_map_changes(leaf_diffs_.get_distinct_diff_map(),
10085 num_changes, num_filtered);
10086 do_count_diff_map_changes(leaf_diffs_.get_fn_parm_diff_map(),
10087 num_changes, num_filtered);
10115 size_t &num_deleted,
10116 size_t &num_changed,
10117 size_t &num_filtered_added,
10118 size_t &num_filtered_deleted,
10119 size_t &num_filtered_changed)
10121 num_added = added_unreachable_types_.size();
10122 num_deleted = deleted_unreachable_types_.size();
10123 num_changed = changed_unreachable_types_.size();
10124 num_filtered_added = suppressed_added_unreachable_types_.size();
10125 num_filtered_deleted = suppressed_deleted_unreachable_types_.size();
10127 for (vector<diff_sptr>::const_iterator i =
10131 if (!(*i)->to_be_reported())
10132 ++num_filtered_changed;
10144const vector<diff_sptr>&
10147if (changed_unreachable_types_sorted_.empty())
10148 if (!changed_unreachable_types_.empty())
10150 changed_unreachable_types_sorted_);
10152 return changed_unreachable_types_sorted_;
10187 if (ctxt->perform_change_categorization())
10189 if (get_context()->
do_log())
10191 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10192 <<
"applying filters to "
10193 << changed_fns_.size()
10194 <<
" changed fns ...\n";
10200 for (function_decl_diff_sptrs_type::const_iterator i =
10201 changed_fns_.begin();
10202 i != changed_fns_.end();
10206 ctxt->maybe_apply_filters(
diff);
10209 if (get_context()->
do_log())
10212 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10213 <<
"filters to changed fn applied!:" << t <<
"\n";
10215 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10216 <<
"applying filters to "
10217 << sorted_changed_vars_.size()
10218 <<
" changed vars ...\n";
10224 for (var_diff_sptrs_type::const_iterator i = sorted_changed_vars_.begin();
10225 i != sorted_changed_vars_.end();
10229 ctxt->maybe_apply_filters(
diff);
10232 if (get_context()->
do_log())
10235 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10236 <<
"filters to changed vars applied!:" << t <<
"\n";
10238 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10239 <<
"applying filters to unreachable types ...\n";
10245 for (diff_sptrs_type::const_iterator i =
10251 ctxt->maybe_apply_filters(
diff);
10254 if (get_context()->do_log())
10257 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10258 <<
"filters to unreachable types applied!:" << t <<
"\n";
10260 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10261 <<
"categorizing redundant changed sub nodes ...\n";
10265 categorize_redundant_changed_sub_nodes();
10267 if (get_context()->
do_log())
10270 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10271 <<
"redundant changed sub nodes categorized!:" << t <<
"\n";
10273 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10274 <<
"count changed fns ...\n";
10282 for (function_decl_diff_sptrs_type::const_iterator i =
10283 changed_fns_.begin();
10284 i != changed_fns_.end();
10287 if ((*i)->is_filtered_out())
10292 if ((*i)->has_local_changes())
10303 if ((*i)->has_local_changes())
10308 if (get_context()->
do_log())
10311 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10312 <<
"changed fn counted!:" << t <<
"\n";
10314 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10315 <<
"count changed vars ...\n";
10321 for (var_diff_sptrs_type ::const_iterator i = sorted_changed_vars_.begin();
10322 i != sorted_changed_vars_.end();
10325 if ((*i)->is_filtered_out())
10330 if ((*i)->has_local_changes())
10334 if ((*i)->has_local_changes())
10339 if (get_context()->
do_log())
10342 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10343 <<
"changed vars counted!:" << t <<
"\n";
10345 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10346 <<
"count leaf changed types ...\n";
10361 size_t num_type_changes = 0, num_type_filtered = 0;
10362 count_leaf_type_changes(num_type_changes, num_type_filtered);
10368 if (get_context()->
do_log())
10371 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10372 <<
"changed leaf types counted!:" << t <<
"\n";
10374 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10375 <<
"count leaf changed artefacts ...\n";
10381 size_t num_changes = 0, num_filtered = 0;
10382 count_leaf_changes(num_changes, num_filtered);
10388 if (get_context()->
do_log())
10391 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10392 <<
"changed leaf artefacts counted!:" << t <<
"\n";
10394 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10395 <<
"count unreachable types ...\n";
10401 size_t num_added_unreachable_types = 0,
10402 num_changed_unreachable_types = 0,
10403 num_deleted_unreachable_types = 0,
10404 num_added_unreachable_types_filtered = 0,
10405 num_changed_unreachable_types_filtered = 0,
10406 num_deleted_unreachable_types_filtered = 0;
10408 count_unreachable_types(num_added_unreachable_types,
10409 num_deleted_unreachable_types,
10410 num_changed_unreachable_types,
10411 num_added_unreachable_types_filtered,
10412 num_deleted_unreachable_types_filtered,
10413 num_changed_unreachable_types_filtered);
10415 if (get_context()->
do_log())
10418 std::cerr <<
"in apply_filters_and_compute_diff_stats:"
10419 <<
"unreachable types counted!:" << t <<
"\n";
10426 (num_added_unreachable_types_filtered);
10428 (num_deleted_unreachable_types_filtered);
10430 (num_changed_unreachable_types_filtered);
10446 const string& indent)
10449 size_t net_num_leaf_changes =
10462 if (!sonames_equal_)
10463 out << indent <<
"ELF SONAME changed\n";
10465 if (!architectures_equal_)
10466 out << indent <<
"ELF architecture changed\n";
10470 if (ctxt->show_leaf_changes_only())
10472 out <<
"Leaf changes summary: ";
10473 out << net_num_leaf_changes <<
" artifact";
10474 if (net_num_leaf_changes > 1)
10479 out <<
" (" << num_filtered <<
" filtered out)";
10482 out << indent <<
"Changed leaf types summary: "
10486 <<
" filtered out)";
10487 out <<
" leaf type";
10490 out <<
" changed\n";
10493 out << indent <<
"Removed/Changed/Added functions summary: ";
10498 <<
" filtered out)";
10505 <<
" filtered out)";
10512 out <<
"functions";
10518 out << indent <<
"Removed/Changed/Added variables summary: ";
10522 <<
" filtered out)";
10529 <<
" filtered out)";
10536 out <<
"variables";
10539 <<
" filtered out)";
10548 out << indent <<
"Functions changes summary: ";
10553 <<
" filtered out)";
10564 if (total_nb_function_changes <= 1)
10565 out <<
" function";
10567 out <<
" functions";
10574 out << indent <<
"Variables changes summary: ";
10578 <<
" filtered out)";
10589 <<
" filtered out)";
10590 if (total_nb_variable_changes <= 1)
10591 out <<
" variable";
10593 out <<
" variables";
10599 if (ctxt->show_unreachable_types())
10601 size_t total_nb_unreachable_type_changes =
10607 out << indent <<
"Unreachable types summary: "
10612 <<
" filtered out)";
10619 <<
" filtered out)";
10626 <<
" filtered out)";
10627 if (total_nb_unreachable_type_changes <= 1)
10634 if (ctxt->show_symbols_unreferenced_by_debug_info()
10642 if (!ctxt->show_added_symbols_unreferenced_by_debug_info()
10652 <<
"Function symbols changes summary: "
10656 <<
" filtered out)";
10661 <<
" filtered out)";
10662 out <<
" function symbol";
10665 out <<
" not referenced by debug info\n";
10670 if (!ctxt->show_added_symbols_unreferenced_by_debug_info()
10680 <<
"Variable symbols changes summary: "
10684 <<
" filtered out)";
10689 <<
" filtered out)";
10690 out <<
" variable symbol";
10693 out <<
" not referenced by debug info\n";
10707 ctxt->forget_visited_diffs();
10708 for (function_decl_diff_sptrs_type::const_iterator i =
10709 changed_fns_.begin();
10710 i!= changed_fns_.end();
10717 for (var_diff_sptrs_type::const_iterator i = sorted_changed_vars_.begin();
10718 i!= sorted_changed_vars_.end();
10725 for (diff_sptrs_type::const_iterator i =
10741 for (function_decl_diff_sptrs_type::const_iterator i = changed_fns_.begin();
10742 i!= changed_fns_.end();
10749 for (var_diff_sptrs_type::const_iterator i = sorted_changed_vars_.begin();
10750 i!= sorted_changed_vars_.end();
10768 if (!ctxt->dump_diff_tree()
10769 || ctxt->error_output_stream() == 0)
10772 if (!changed_fns_.empty())
10774 *ctxt->error_output_stream() <<
"changed functions diff tree: \n\n";
10775 for (function_decl_diff_sptrs_type::const_iterator i =
10776 changed_fns_.begin();
10777 i != changed_fns_.end();
10785 if (!sorted_changed_vars_.empty())
10787 *ctxt->error_output_stream() <<
"\nchanged variables diff tree: \n\n";
10788 for (var_diff_sptrs_type::const_iterator i =
10789 sorted_changed_vars_.begin();
10790 i != sorted_changed_vars_.end();
10800 *ctxt->error_output_stream() <<
"\nchanged unreachable "
10801 "types diff tree: \n\n";
10802 for (vector<diff_sptr>::const_iterator i =
10820 for (function_decl_diff_sptrs_type::const_iterator i =
10839 corpus_sptr second,
10841 : priv_(new
priv(first, second, ctxt))
10844corpus_diff::~corpus_diff() =
default;
10850 if (priv_->finished_)
10853 priv_->finished_ =
true;
10873{
return priv_->first_;}
10878{
return priv_->second_;}
10881const vector<diff*>&
10883{
return priv_->children_;}
10901 bool inserted =
false;
10902 for (vector<diff*>::iterator i = priv_->children_.begin();
10903 i != priv_->children_.end();
10906 if (!is_less_than(d.get(), *i))
10908 context()->keep_diff_alive(d);
10909 priv_->children_.insert(i, d.get());
10918 context()->keep_diff_alive(d);
10922 priv_->children_.push_back(d.get());
10930{
return priv_->fns_edit_script_;}
10936{
return priv_->vars_edit_script_;}
10943{
return !priv_->sonames_equal_;}
10950{
return !priv_->architectures_equal_;}
10957{
return priv_->deleted_fns_;}
10964{
return priv_->added_fns_;}
10976{
return priv_->changed_fns_map_;}
10985{
return priv_->changed_fns_;}
10993{
return priv_->deleted_vars_;}
11000{
return priv_->added_vars_;}
11008{
return priv_->changed_vars_map_;}
11016{
return priv_->sorted_changed_vars_;}
11025{
return priv_->deleted_unrefed_fn_syms_;}
11034{
return priv_->added_unrefed_fn_syms_;}
11043{
return priv_->deleted_unrefed_var_syms_;}
11052{
return priv_->added_unrefed_var_syms_;}
11061{
return priv_->deleted_unreachable_types_;}
11069const vector<type_base_sptr>&
11072 if (priv_->deleted_unreachable_types_sorted_.empty())
11073 if (!priv_->deleted_unreachable_types_.empty())
11075 priv_->deleted_unreachable_types_sorted_);
11077 return priv_->deleted_unreachable_types_sorted_;
11087{
return priv_->added_unreachable_types_;}
11095const vector<type_base_sptr>&
11098 if (priv_->added_unreachable_types_sorted_.empty())
11099 if (!priv_->added_unreachable_types_.empty())
11101 priv_->added_unreachable_types_sorted_);
11103 return priv_->added_unreachable_types_sorted_;
11113{
return priv_->changed_unreachable_types_;}
11121const vector<diff_sptr>&
11123{
return priv_->changed_unreachable_types_sorted();}
11130{
return priv_->get_context();}
11137 if (priv_->pretty_representation_.empty())
11139 std::ostringstream o;
11140 o <<
"corpus_diff["
11145 priv_->pretty_representation_ = o.str();
11147 return priv_->pretty_representation_;
11158 || !(priv_->deleted_fns_.empty()
11159 && priv_->added_fns_.empty()
11160 && priv_->changed_fns_map_.empty()
11161 && priv_->deleted_vars_.empty()
11162 && priv_->added_vars_.empty()
11163 && priv_->changed_vars_map_.empty()
11164 && priv_->added_unrefed_fn_syms_.empty()
11165 && priv_->deleted_unrefed_fn_syms_.empty()
11166 && priv_->added_unrefed_var_syms_.empty()
11167 && priv_->deleted_unrefed_var_syms_.empty()
11168 && priv_->deleted_unreachable_types_.empty()
11169 && priv_->added_unreachable_types_.empty()
11170 && priv_->changed_unreachable_types_.empty()));
11242{
return context()->get_reporter()->diff_has_net_changes(
this);}
11267 if (priv_->diff_stats_)
11268 return *priv_->diff_stats_;
11273 std::cerr <<
"Applying suppressions ...\n";
11282 std::cerr <<
"suppressions applied!:" << t <<
"\n";
11289 std::cerr <<
"Marking leaf nodes ...\n";
11298 std::cerr <<
"leaf nodes marked!:" << t <<
"\n";
11299 std::cerr <<
"Applying filters and computing diff stats ...\n";
11303 priv_->apply_filters_and_compute_diff_stats(*priv_->diff_stats_);
11308 std::cerr <<
"Filters applied and diff stats computed!: " << t <<
"\n";
11311 return *priv_->diff_stats_;
11333 visit_begin(
diff *d)
11378 const corpus_diff *corpus_diff_node = ctxt->get_corpus_diff().get();
11381 if (
diff *iface_diff = get_current_topmost_iface_diff())
11388 get_leaf_diffs().insert_diff_node(d, iface);
11406 if (!
context()->show_leaf_changes_only())
11409 leaf_diff_node_marker_visitor v;
11410 context()->forget_visited_diffs();
11411 bool s =
context()->visiting_a_node_twice_is_forbidden();
11412 context()->forbid_visiting_a_node_twice(
true);
11413 if (
context()->show_impacted_interfaces())
11414 context()->forbid_visiting_a_node_twice_per_interface(
true);
11416 context()->forbid_visiting_a_node_twice(s);
11417 context()->forbid_visiting_a_node_twice_per_interface(
false);
11427{
return priv_->leaf_diffs_;}
11436{
return priv_->leaf_diffs_;}
11447 context()->get_reporter()->report(*
this, out, indent);
11462 if (!v.
visit(
this,
true))
11468 for (function_decl_diff_sptrs_type::const_iterator i =
11476 if (ctxt->visiting_a_node_twice_is_forbidden_per_interface())
11477 ctxt->forget_visited_diffs();
11490 for (var_diff_sptrs_type::const_iterator i =
11498 if (ctxt->visiting_a_node_twice_is_forbidden_per_interface())
11499 ctxt->forget_visited_diffs();
11516 for (vector<diff_sptr>::const_iterator i =
11524 if (ctxt->visiting_a_node_twice_is_forbidden_per_interface())
11525 ctxt->forget_visited_diffs();
11553 const corpus_sptr s,
11556 typedef corpus::functions::const_iterator fns_it_type;
11557 typedef corpus::variables::const_iterator vars_it_type;
11558 typedef elf_symbols::const_iterator symbols_it_type;
11560 typedef vector<type_base_wptr>::const_iterator type_base_wptr_it_type;
11569 ctxt->set_corpus_diff(r);
11571 if(ctxt->show_soname_change())
11572 r->priv_->sonames_equal_ = f->get_soname() == s->get_soname();
11574 r->priv_->sonames_equal_ =
true;
11576 r->priv_->architectures_equal_ =
11577 f->get_architecture_name() == s->get_architecture_name();
11580 diff_utils::compute_diff<fns_it_type, eq_type>(f->get_functions().begin(),
11581 f->get_functions().end(),
11582 s->get_functions().begin(),
11583 s->get_functions().end(),
11584 r->priv_->fns_edit_script_);
11587 diff_utils::compute_diff<vars_it_type, eq_type>
11588 (f->get_variables().begin(), f->get_variables().end(),
11589 s->get_variables().begin(), s->get_variables().end(),
11590 r->priv_->vars_edit_script_);
11594 diff_utils::compute_diff<symbols_it_type, eq_type>
11595 (f->get_unreferenced_function_symbols().begin(),
11596 f->get_unreferenced_function_symbols().end(),
11597 s->get_unreferenced_function_symbols().begin(),
11598 s->get_unreferenced_function_symbols().end(),
11599 r->priv_->unrefed_fn_syms_edit_script_);
11603 diff_utils::compute_diff<symbols_it_type, eq_type>
11604 (f->get_unreferenced_variable_symbols().begin(),
11605 f->get_unreferenced_variable_symbols().end(),
11606 s->get_unreferenced_variable_symbols().begin(),
11607 s->get_unreferenced_variable_symbols().end(),
11608 r->priv_->unrefed_var_syms_edit_script_);
11610 if (ctxt->show_unreachable_types())
11613 diff_utils::compute_diff<type_base_wptr_it_type, eq_type>
11614 (f->get_types_not_reachable_from_public_interfaces().begin(),
11615 f->get_types_not_reachable_from_public_interfaces().end(),
11616 s->get_types_not_reachable_from_public_interfaces().begin(),
11617 s->get_types_not_reachable_from_public_interfaces().end(),
11618 r->priv_->unreachable_types_edit_script_);
11620 r->priv_->ensure_lookup_tables_populated();
11641 const corpus_group_sptr& s,
11645 corpus_sptr c1 = f;
11646 corpus_sptr c2 = s;
11657struct diff_node_visitor::priv
11659 diff* topmost_interface_diff;
11663 : topmost_interface_diff(),
11668 : topmost_interface_diff(),
11678diff_node_visitor::~diff_node_visitor() =
default;
11684 : priv_(new priv(k))
11694{
return priv_->kind;}
11714{priv_->kind = priv_->kind | v;}
11722{priv_->topmost_interface_diff = d;}
11730{
return priv_->topmost_interface_diff;}
11957 bool already_visited = d->
context()->diff_has_been_visited(d);
11965 bool update_canonical = !already_visited && canonical;
11967 for (vector<diff*>::const_iterator i = d->
children_nodes().begin();
12000 if (!already_visited && canonical)
12001 if (update_canonical)
12002 canonical->add_to_category(c);
12016 category_propagation_visitor v;
12017 bool s = diff_tree->
context()->visiting_a_node_twice_is_forbidden();
12018 diff_tree->
context()->forbid_visiting_a_node_twice(
true);
12019 diff_tree->
context()->forget_visited_diffs();
12021 diff_tree->
context()->forbid_visiting_a_node_twice(s);
12043 category_propagation_visitor v;
12044 bool s = diff_tree->
context()->visiting_a_node_twice_is_forbidden();
12045 diff_tree->
context()->forbid_visiting_a_node_twice(
false);
12047 diff_tree->
context()->forbid_visiting_a_node_twice(s);
12072 visit_begin(
diff* d)
12074 bool is_private_type =
false;
12085 if (canonical_diff != d)
12141 bool has_non_suppressed_child =
false;
12142 bool has_non_empty_child =
false;
12143 bool has_suppressed_child =
false;
12144 bool has_non_private_child =
false;
12145 bool has_private_child =
false;
12146 bool has_descendant_with_allowed_change =
false;
12179 && (!d->has_local_changes()
12204 for (vector<diff*>::const_iterator i = d->children_nodes().begin();
12205 i != d->children_nodes().end();
12209 if (child->has_changes())
12211 has_non_empty_child =
true;
12213 has_suppressed_child =
true;
12214 else if (child->get_class_of_equiv_category()
12220 has_non_suppressed_child =
true;
12222 if (child->get_class_of_equiv_category()
12224 has_private_child =
true;
12225 else if (child->get_class_of_equiv_category()
12231 has_non_private_child =
true;
12235 if (has_non_empty_child
12236 && has_suppressed_child
12237 && !has_non_suppressed_child)
12243 if (canonical_diff != d)
12259 if (has_non_empty_child
12260 && has_private_child
12261 && !has_non_private_child)
12267 if (canonical_diff != d)
12277 && has_private_child
12278 && has_non_empty_child)
12284 if (canonical_diff != d)
12301 if (fn_type_diff->is_suppressed())
12307 if (canonical_diff != d)
12316 for (
auto child_node : d->children_nodes())
12322 has_descendant_with_allowed_change =
true;
12324 if (has_descendant_with_allowed_change)
12327 d->add_to_category(c);
12328 d->get_canonical_diff()->add_to_category(c);
12342 if (diff_tree && !diff_tree->
context()->suppressions().empty())
12346 suppression_categorization_visitor v;
12347 diff_tree->
context()->forget_visited_diffs();
12348 bool s = diff_tree->
context()->visiting_a_node_twice_is_forbidden();
12349 diff_tree->
context()->forbid_visiting_a_node_twice(
true);
12351 diff_tree->
context()->forbid_visiting_a_node_twice(s);
12374 if (diff_tree && !diff_tree->
context()->suppressions().empty())
12379 suppression_categorization_visitor v;
12380 diff_tree->
context()->forget_visited_diffs();
12381 bool s = diff_tree->
context()->visiting_a_node_twice_is_forbidden();
12382 diff_tree->
context()->forbid_visiting_a_node_twice(
true);
12383 const_cast<corpus_diff*
>(diff_tree)->traverse(v);
12384 diff_tree->
context()->forbid_visiting_a_node_twice(s);
12390 apply_supprs_to_added_removed_fns_vars_unreachable_types();
12420 do_indent(
unsigned level)
12422 for (
unsigned i = 0; i < level; ++i)
12426 diff_node_printer(ostream& out)
12445 visit_begin(corpus_diff*)
12451 visit_end(corpus_diff*)
12457 visit(diff* d,
bool pre)
12466 out_ << d->get_pretty_representation();
12470 do_indent(level_ + 1);
12471 out_ <<
"category: "<< d->get_category() <<
"\n";
12472 do_indent(level_ + 1);
12473 out_ <<
"@: " << std::hex << d << std::dec <<
"\n";
12474 do_indent(level_ + 1);
12475 out_ <<
"@-canonical: " << std::hex
12476 << d->get_canonical_diff()
12477 << std::dec <<
"\n";
12485 visit(corpus_diff* d,
bool pre)
12494 for (
unsigned i = 0; i < level_; ++i)
12496 out_ << d->get_pretty_representation();
12515 diff_node_printer p(out);
12516 bool s = diff_tree->
context()->visiting_a_node_twice_is_forbidden();
12517 diff_tree->
context()->forbid_visiting_a_node_twice(
false);
12519 diff_tree->
context()->forbid_visiting_a_node_twice(s);
12533 diff_node_printer p(out);
12534 bool s = diff_tree->
context()->visiting_a_node_twice_is_forbidden();
12535 diff_tree->
context()->forbid_visiting_a_node_twice(
false);
12537 diff_tree->
context()->forbid_visiting_a_node_twice(s);
12576 bool skip_children_nodes_;
12578 redundancy_marking_visitor()
12579 : skip_children_nodes_()
12583 visit_begin(diff* d)
12585 if (d->to_be_reported())
12591 if ((d->context()->diff_has_been_visited(d)
12592 || d->get_canonical_diff()->is_traversing())
12593 && d->has_changes())
12608 bool redundant_with_sibling_node =
false;
12613 if (p &&
dynamic_cast<const fn_parm_diff*
>(p))
12617 for (vector<diff*>::const_iterator s =
12618 p->children_nodes().begin();
12619 s != p->children_nodes().end();
12627 if (fn_parm_diff* f =
dynamic_cast<fn_parm_diff*
>(*s))
12628 sib = f->type_diff().get();
12631 if (sib->get_canonical_diff() == d->get_canonical_diff()
12636 redundant_with_sibling_node =
true;
12640 if (!redundant_with_sibling_node
12661 && (!d->get_canonical_diff()->is_filtered_out()
12662 || (d->get_canonical_diff()->get_category()
12669 && d->context()->diff_has_been_visited(d) != d
12691 skip_children_nodes_ =
true;
12699 skip_children_nodes_ =
true;
12704 visit_begin(corpus_diff*)
12711 if (skip_children_nodes_)
12718 skip_children_nodes_ =
false;
12726 && (!d->has_local_changes_to_be_reported()
12752 && (!(d->has_local_changes()
12763 && (!(d->has_local_changes()
12770 && (!(d->has_local_changes()
12774 bool has_non_redundant_child =
false;
12775 bool has_non_empty_child =
false;
12776 for (vector<diff*>::const_iterator i =
12777 d->children_nodes().begin();
12778 i != d->children_nodes().end();
12781 if ((*i)->has_changes())
12783 has_non_empty_child =
true;
12790 if ((*i)->to_be_reported()
12792 has_non_redundant_child =
true;
12794 if (has_non_redundant_child)
12801 if (has_non_empty_child
12802 && !has_non_redundant_child)
12809 visit_end(corpus_diff*)
12818 visit(corpus_diff*,
bool)
12826struct redundancy_clearing_visitor :
public diff_node_visitor
12829 visit(corpus_diff*,
bool)
12833 visit(diff* d,
bool)
12837 c &= ~REDUNDANT_CATEGORY;
12838 d->set_category(c);
12850 if (diff_tree->
context()->show_redundant_changes())
12852 redundancy_marking_visitor v;
12853 bool s = diff_tree->
context()->visiting_a_node_twice_is_forbidden();
12854 diff_tree->
context()->forbid_visiting_a_node_twice(
false);
12856 diff_tree->
context()->forbid_visiting_a_node_twice(s);
12874 redundancy_marking_visitor v;
12875 diff_tree->
context()->forget_visited_diffs();
12876 bool s = diff_tree->
context()->visiting_a_node_twice_is_forbidden();
12877 diff_tree->
context()->forbid_visiting_a_node_twice(
false);
12879 diff_tree->
context()->forbid_visiting_a_node_twice(s);
12899 redundancy_clearing_visitor v;
12900 bool s = diff_tree->
context()->visiting_a_node_twice_is_forbidden();
12901 diff_tree->
context()->forbid_visiting_a_node_twice(
false);
12903 diff_tree->
context()->forbid_visiting_a_node_twice(s);
12904 diff_tree->
context()->forget_visited_diffs();
12922 redundancy_clearing_visitor v;
12923 bool s = diff_tree->
context()->visiting_a_node_twice_is_forbidden();
12924 diff_tree->
context()->forbid_visiting_a_node_twice(
false);
12926 diff_tree->
context()->forbid_visiting_a_node_twice(s);
12927 diff_tree->
context()->forget_visited_diffs();
12948 diff_tree->context()->maybe_apply_filters(diff_tree);
12966 if (t && t->get_environment().is_variadic_parameter_type(t))
12970 if (t && t->get_environment().is_variadic_parameter_type(t))
13035 if (allow_indirect_type)
13236has_local_type_change_only(
const diff *d)
13264 return (has_local_type_change_only(v)
13267 return (has_local_type_change_only(p)
13271 return (has_local_type_change_only(f)
The private data and functions of the abigail::ir::comparison types.
#define SKIP_MEM_FN_IF_VIRTUALITY_DISALLOWED
Skip the processing of the current member function if its virtual-ness is disallowed by the user.
#define ABG_ASSERT(cond)
This is a wrapper around the 'assert' glibc call. It allows for its argument to have side effects,...
The abstraction of a diff between two arrays.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of array_diff.
const diff_sptr & element_type_diff() const
Getter for the diff between the two types of array elements.
array_diff(const array_type_def_sptr first, const array_type_def_sptr second, diff_sptr element_type_diff, diff_context_sptr ctxt=diff_context_sptr())
Constructor for array_diff.
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.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
virtual void report(ostream &, const string &indent="") const
Report the diff in a serialized form.
An abstraction of a diff between two instances of class_decl::base_spec.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of base_diff.
void set_underlying_class_diff(class_diff_sptr d)
Setter for the diff object for the diff of the underlyng base classes.
class_decl::base_spec_sptr second_base() const
Getter for the second base spec of the diff object.
base_diff(class_decl::base_spec_sptr first, class_decl::base_spec_sptr second, class_diff_sptr underlying, diff_context_sptr ctxt=diff_context_sptr())
const class_diff_sptr get_underlying_class_diff() const
Getter for the diff object for the diff of the underlying base classes.
class_decl::base_spec_sptr first_base() const
Getter for the first base spec of the diff object.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
virtual void report(ostream &, const string &indent="") const
Generates a report for the current instance of base_diff.
This type abstracts changes for a class_decl.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of class_diff.
class_decl_sptr first_class_decl() const
const base_diff_sptrs_type & changed_bases()
Getter for the changed base classes of the diff.
const vector< class_decl::base_spec_sptr > & moved_bases() const
Getter for the vector of bases that "moved". That is, the vector of base types which position changed...
const string_base_sptr_map & inserted_bases() const
Getter for the inserted base classes of the diff.
const string_base_sptr_map & deleted_bases() const
Getter for the deleted base classes of the diff.
virtual enum change_kind has_local_changes() const
const edit_script & base_changes() const
virtual const string & get_pretty_representation() const
class_diff(class_decl_sptr first_scope, class_decl_sptr second_scope, diff_context_sptr ctxt=diff_context_sptr())
Constructor of class_diff.
friend class_diff_sptr compute_diff(const class_decl_sptr first, const class_decl_sptr second, diff_context_sptr ctxt)
Compute the set of changes between two instances of class_decl.
class_decl_sptr second_class_decl() const
Getter of the second class involved in the diff.
virtual void report(ostream &, const string &indent="") const
Produce a basic report about the changes between two class_decl.
This is the base class of class_diff and union_diff.
virtual bool has_changes() const
Test if the current diff node carries a change.
const edit_script & member_fn_tmpls_changes() const
size_t count_filtered_subtype_changed_data_members(bool local_only=false) const
Count the number of /filtered/ data members with a sub-type change.
const class_or_union_diff::priv_ptr & get_priv() const
Getter of the private data of the class_or_union_diff type.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of class_or_un...
const edit_script & member_class_tmpls_changes() const
void allocate_priv_data()
Allocate the memory for the priv_ pimpl data member of the class_or_union_diff class.
class_or_union_diff(class_or_union_sptr first_scope, class_or_union_sptr second_scope, diff_context_sptr ctxt=diff_context_sptr())
Constructor for the class_or_union_diff class.
const edit_script & member_types_changes() const
const string_member_function_sptr_map & deleted_member_fns() const
class_or_union_sptr first_class_or_union() const
const var_diff_sptrs_type & sorted_subtype_changed_data_members() const
Getter of the sorted vector of data members with a (sub-)type change.
bool lookup_tables_empty(void) const
Tests if the lookup tables are empty.
const string_decl_base_sptr_map & data_members_replaced_by_adms() const
Get the map of data members that got replaced by anonymous data members.
void clear_lookup_tables(void)
Clear the lookup tables useful for reporting.
const string_decl_base_sptr_map & deleted_data_members() const
Getter for the data members that got deleted.
virtual ~class_or_union_diff()
Destructor of class_or_union_diff.
const string_decl_base_sptr_map & inserted_data_members() const
Getter for the data members that got inserted.
void ensure_lookup_tables_populated(void) const
If the lookup tables are not yet built, walk the differences and fill them.
const string_member_function_sptr_map & inserted_member_fns() const
const function_decl_diff_sptrs_type & changed_member_fns() const
Getter for the virtual members functions that have had a change in a sub-type, without having a chang...
const edit_script & data_members_changes() const
const changed_var_sptrs_type & ordered_data_members_replaced_by_adms() const
Get an ordered vector of of data members that got replaced by anonymous data members.
virtual enum change_kind has_local_changes() const
size_t count_filtered_changed_data_members(bool local_only=false) const
Count the number of /filtered/ data members that got replaced by another data member.
const edit_script & member_fns_changes() const
class_or_union_sptr second_class_or_union() const
const var_diff_sptrs_type & sorted_changed_data_members() const
Getter of the sorted vector of data members that got replaced by another data member.
virtual void report(ostream &, const string &indent="") const
Report the changes carried by the current class_or_union_diff node in a textual format.
This is a document class that aims to capture statistics about the changes carried by a corpus_diff t...
size_t num_changed_unreachable_types_filtered_out() const
Getter of the number of changed types that are unreachable from public interfaces and that have been ...
size_t num_func_removed() const
Getter for the number of functions removed.
size_t num_removed_unreachable_types_filtered_out() const
Getter of the number of removed types that are not reachable from public interfaces and that have bee...
size_t num_vars_changed() const
Getter for the number of variables that have a change in one of their sub-types.
size_t net_num_leaf_var_changes() const
Getter for the net number of leaf variable change diff nodes.
size_t num_vars_added() const
Getter for the number of variables added.
size_t num_removed_unreachable_types() const
Getter of the number of removed types that are unreachable from the public interface of the ABI corpu...
size_t num_changed_vars_filtered_out() const
Getter for the number of variables that have a change in one of their sub-types, and that have been f...
size_t num_changed_func_filtered_out() const
Getter for the number of functions that have a change in one of their sub-types, and that have been f...
size_t num_removed_vars_filtered_out() const
Getter for the number removed variables that have been filtered out.
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 num_removed_var_syms_filtered_out() const
Getter for the number of removed variable symbols, not referenced by any debug info,...
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 num_added_var_syms_filtered_out() const
Getter for the number of added variable symbols, not referenced by any debug info,...
size_t num_added_unreachable_types() const
Getter of the number of added types that are unreachable from the public interface of the ABI corpus.
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 num_var_syms_added() const
Getter for the number of variable symbols (not referenced by any debug info) that got added.
size_t num_leaf_var_changes() const
Getter for the number of leaf variable change diff nodes.
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_changes() const
Getter of the net number of leaf change diff nodes.
size_t num_removed_func_syms_filtered_out() const
Getter for the number of removed function symbols, not referenced by debug info, that have been filte...
size_t num_added_unreachable_types_filtered_out() const
Getter of the number of added types that are unreachable from public interfaces and that are filtered...
size_t num_added_func_filtered_out() const
Getter for the number of added function that have been filtered out.
size_t num_func_syms_added() const
Getter for the number of function symbols (not referenced by any debug info) that got added.
size_t net_num_leaf_type_changes() const
Getter for the net number of leaf type change diff nodes.
size_t num_func_added() const
Getter for the number of functions added.
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 num_leaf_type_changes() const
Getter for the number of leaf type change diff nodes.
size_t num_leaf_var_changes_filtered_out() const
Getter for the number of leaf variable changes diff nodes that have been filtered out.
size_t num_added_vars_filtered_out() const
Getter for the number of added variables that have been filtered out.
size_t num_func_with_virtual_offset_changes() const
Getter for the number of functions that carry virtual member offset changes.
size_t num_func_changed() const
Getter for the number of functions that have a change in one of their sub-types.
size_t num_removed_func_filtered_out() const
Getter for the number of removed functions that have been filtered out.
size_t net_num_vars_added() const
Getter for the net number of added variables.
size_t num_leaf_changes() const
Getter of the number of leaf type change diff nodes.
size_t num_leaf_func_changes_filtered_out() const
Getter for the number of leaf function change diff nodes that were filtered out.
size_t num_added_func_syms_filtered_out() const
Getter for the number of added function symbols, not referenced by any debug info,...
size_t num_leaf_type_changes_filtered_out() const
Getter for the number of filtered out leaf type change diff nodes.
size_t num_changed_unreachable_types() const
Getter of the number of changed types that are unreachable from the public interface of the ABI corpu...
size_t net_num_leaf_func_changes() const
Getter for the net number of leaf function change diff nodes.
size_t num_leaf_func_changes() const
Getter for the 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*...
size_t num_func_syms_removed() const
Getter for the number of function symbols (not referenced by any debug info) that got removed.
size_t num_leaf_changes_filtered_out() const
Getter of the number of leaf type change diff nodes that have been filtered out.
size_t num_vars_removed() const
Getter for the number of variables removed.
size_t num_var_syms_removed() const
Getter for the number of variable symbols (not referenced by any debug info) that got removed.
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 has_incompatible_changes() const
Test if the current instance of corpus_diff carries changes that we are sure are incompatible....
bool has_changes() const
Return true iff the current corpus_diff node carries a change.
void finish_diff_type()
Finish building the current instance of corpus_diff.
virtual void chain_into_hierarchy()
Populate the vector of children node of the corpus_diff type.
const string_var_ptr_map & deleted_variables() const
Getter for the variables that got deleted from the first subject of the diff.
const vector< diff_sptr > & changed_unreachable_types_sorted() const
Getter of a sorted vector of changed types that are not reachable from global functions/variables.
bool soname_changed() const
Test if the soname of the underlying corpus has changed.
friend corpus_diff_sptr compute_diff(const corpus_sptr f, const corpus_sptr s, diff_context_sptr ctxt)
Compute the diff between two instances of corpus.
const vector< type_base_sptr > & deleted_unreachable_types_sorted() const
Getter of a sorted vector of deleted types that are not reachable from global functions/variables.
edit_script & function_changes() const
edit_script & variable_changes() const
const vector< diff * > & children_nodes() const
const string_diff_sptr_map & changed_unreachable_types() const
Getter for a map of changed types that are not reachable from global functions/variables.
const var_diff_sptrs_type & changed_variables_sorted()
Getter for the sorted vector of variables which signature didn't change but which do have some indire...
const string_elf_symbol_map & deleted_unrefed_function_symbols() const
Getter for function symbols not referenced by any debug info and that got deleted.
const string_elf_symbol_map & deleted_unrefed_variable_symbols() const
Getter for variable symbols not referenced by any debug info and that got deleted.
corpus_diff(corpus_sptr first, corpus_sptr second, diff_context_sptr ctxt=diff_context_sptr())
Constructor for corpus_diff.
corpus_sptr second_corpus() const
bool do_log() const
Test if logging was requested.
const string_elf_symbol_map & added_unrefed_function_symbols() const
Getter for function symbols not referenced by any debug info and that got added.
bool has_net_subtype_changes() const
Test if the current instance of corpus_diff carries subtype changes whose reports are not suppressed ...
const string_var_ptr_map & added_variables() const
Getter for the added variables of the diff.
diff_maps & get_leaf_diffs()
Get the set of maps that contain leaf nodes. A leaf node being a node with a local change.
const diff_context_sptr context() const
Getter of the diff context of this diff.
bool has_net_changes() const
Test if the current instance of corpus_diff carries changes whose reports are not suppressed by any s...
virtual bool traverse(diff_node_visitor &v)
Traverse the diff sub-tree under the current instance corpus_diff.
const diff_stats & apply_filters_and_suppressions_before_reporting()
Apply the different filters that are registered to be applied to the diff tree; that includes the cat...
const string_var_diff_sptr_map & changed_variables()
Getter for the non-sorted map of variables which signature didn't change but which do have some indir...
const string_function_ptr_map & added_functions()
Getter for the added functions of the diff.
void mark_leaf_diff_nodes()
Walks the diff nodes associated to the current corpus diff and mark those that carry local changes....
const string_type_base_sptr_map & deleted_unreachable_types() const
Getter for a map of deleted types that are not reachable from global functions/variables.
corpus_sptr first_corpus() const
const vector< type_base_sptr > & added_unreachable_types_sorted() const
Getter of a sorted vector of added types that are not reachable from global functions/variables.
virtual void report(ostream &out, const string &indent="") const
Report the diff in a serialized form.
const string_elf_symbol_map & added_unrefed_variable_symbols() const
Getter for variable symbols not referenced by any debug info and that got added.
const function_decl_diff_sptrs_type & changed_functions_sorted()
Getter for a sorted vector of functions which signature didn't change, but which do have some indirec...
const string & get_pretty_representation() const
const string_function_ptr_map & deleted_functions() const
Getter for the deleted functions of the diff.
void append_child_node(diff_sptr)
Append a new child node to the vector of children nodes for the current instance of corpus_diff node.
friend void apply_suppressions(const corpus_diff *diff_tree)
Walk a corpus_diff tree and appply the suppressions carried by the context. If the suppression applie...
const string_type_base_sptr_map & added_unreachable_types() const
Getter for a map of added types that are not reachable from global functions/variables.
const string_function_decl_diff_sptr_map & changed_functions()
Getter for the functions which signature didn't change, but which do have some indirect changes in th...
bool architecture_changed() const
Test if the architecture of the underlying corpus has changed.
The base class of diff between decls.
decl_diff_base(decl_base_sptr first_subject, decl_base_sptr second_subject, diff_context_sptr ctxt)
Constructor of decl_diff_base.
The default, initial, reporter of the libabigail comparison engine.
The context of the diff. This type holds various bits of information that is going to be used through...
bool show_deleted_vars() const
void add_suppressions(const suppr::suppressions_type &supprs)
Add new suppression specifications that specify which diff node reports should be dropped on the floo...
diff_category get_allowed_category() const
Getter for the bitmap that represents the set of categories that the user wants to see reported.
void forget_visited_diffs()
Unmark all the diff nodes that were marked as being traversed.
corpus_sptr get_first_corpus() const
Getter for the first corpus of the corpus diff of the current context.
bool show_architecture_change() const
Getter for the property that says if the comparison module should show the architecture changes in it...
bool show_offsets_sizes_in_bits() const
Get the flag that indicates if diff reports using this context should show sizes and offsets in bits,...
void forbid_visiting_a_node_twice(bool f)
This sets a flag that, if it's true, then during the traversing of a diff nodes tree each node is vis...
bool show_changed_fns() const
void initialize_canonical_diff(const diff_sptr diff)
Set the canonical diff node property of a given diff node appropriately.
bool show_redundant_changes() const
A getter for the flag that says if we should report about functions or variables diff nodes that have...
void forbid_visiting_a_node_twice_per_interface(bool)
This function sets a flag os that if forbid_visiting_a_node_twice() returns true, then each time the ...
void keep_diff_alive(diff_sptr &)
Add a diff node to the set of diff nodes that are kept alive for the life time of the current instanc...
diff * diff_has_been_visited(const diff *) const
Test if a diff node has been traversed.
bool visiting_a_node_twice_is_forbidden_per_interface() const
Return a flag that, if true, then during the traversing of a diff nodes tree each node is visited at ...
void set_corpus_diff(const corpus_diff_sptr &)
Set the corpus diff relevant to this context.
bool show_leaf_changes_only() const
Get the flag that indicates if the diff using this context should show only leaf changes or not.
bool perform_change_categorization() const
Test if it's requested to perform diff node categorization.
bool show_impacted_interfaces() const
Getter of the flag that indicates if the leaf reporter should display a summary of the interfaces imp...
bool show_soname_change() const
Getter for the property that says if the comparison module should show the soname changes in its repo...
reporter_base_sptr get_reporter() const
Getter of the reporter to be used in this context.
void add_diff_filter(filtering::filter_base_sptr)
Setter for the diff filters to apply to a given diff sub-tree.
bool do_log() const
Test if logging was requested.
const suppr::suppressions_type & direct_suppressions() const
Getter of the direct suppression specification (those that are not negated) comprised in the general ...
void maybe_apply_filters(diff_sptr diff)
Apply the diff filters to a given diff sub-tree.
bool show_added_fns() const
const suppr::suppressions_type & suppressions() const
Getter for the vector of suppressions that specify which diff node reports should be dropped on the f...
bool show_relative_offset_changes(void)
Get the flag saying if offset changes should be reported in a relative way. That is,...
bool visiting_a_node_twice_is_forbidden() const
Return a flag that, if true, then during the traversing of a diff nodes tree each node is visited at ...
void do_dump_diff_tree(const diff_sptr) const
Emit a textual representation of a diff tree to the error output stream of the current context,...
const suppr::suppressions_type & negated_suppressions() const
Getter of the negated suppression specifications that are comprised in the general vector of suppress...
void add_suppression(const suppr::suppression_sptr suppr)
Add a new suppression specification that specifies which diff node reports should be dropped on the f...
bool show_hex_values() const
Get the flag that indicates if the diff reports using this context should show sizes and offsets in a...
bool show_deleted_fns() const
void switch_categories_off(diff_category c)
Setter for the bitmap that represents the set of categories that the user wants to see reported.
bool show_stats_only() const
Test if the comparison module should only show the diff stats.
bool show_added_vars() const
const filtering::filters & diff_filters() const
Getter for the diff tree nodes filters to apply to diff sub-trees.
bool show_unreachable_types()
Getter for the flag that indicates if changes on types unreachable from global functions and variable...
const corpus_diff_sptr & get_corpus_diff() const
Get the corpus diff for the current context.
void mark_diff_as_visited(const diff *)
Mark a diff node as traversed by a traversing algorithm.
diff_sptr get_canonical_diff_for(const type_or_decl_base_sptr first, const type_or_decl_base_sptr second) const
Getter for the canonical diff node for the diff represented by their two subjects.
bool show_changed_vars() const
void switch_categories_on(diff_category c)
Setter for the bitmap that represents the set of categories that the user wants to see reported.
ostream * default_output_stream()
Getter for the default output stream used by code of the comparison engine. By default the default ou...
bool dump_diff_tree() const
Test if the comparison engine should dump the diff tree for the changed functions and variables it ha...
bool show_symbols_unreferenced_by_debug_info() const
Getter for the flag that indicates if symbols not referenced by any debug info are to be compared and...
bool show_added_symbols_unreferenced_by_debug_info() const
Getter for the flag that indicates if symbols not referenced by any debug info and that got added are...
corpus_sptr get_second_corpus() const
Getter for the second corpus of the corpus diff of the current context.
void set_allowed_category(diff_category c)
Setter for the bitmap that represents the set of categories that the user wants to see reported.
void set_reporter(reporter_base_sptr &)
Setter of the reporter to be used in this context.
ostream * error_output_stream() const
Getter for the errror output stream used by code of the comparison engine. By default the error outpu...
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.
const string_diff_ptr_map & get_enum_diff_map() const
Getter of the map that contains enum type diffs.
bool insert_diff_node(const diff *d, const type_or_decl_base_sptr &impacted_iface)
Insert a new diff node into the current instance of diff_maps.
diff_maps()
Default constructor of the diff_maps type.
const string_diff_ptr_map & get_union_diff_map() const
Getter of the map that contains union type diffs.
artifact_sptr_set_type * lookup_impacted_interfaces(const diff *d) const
Lookup the interfaces that are impacted by a given leaf diff node.
const string_diff_ptr_map & get_function_type_diff_map() const
Getter of the map that contains function type diffs.
const string_diff_ptr_map & get_typedef_diff_map() const
Getter of the map that contains typedef type diffs.
const string_diff_ptr_map & get_distinct_diff_map() const
Getter of the map that contains distinct diffs.
const string_diff_ptr_map & get_subrange_diff_map() const
Getter of the map that contains subrange type diffs.
const string_diff_ptr_map & get_reference_diff_map() const
Getter of the map that contains reference type diffs.
const string_diff_ptr_map & get_array_diff_map() const
Getter of the map that contains array type diffs.
const string_diff_ptr_map & get_type_decl_diff_map() const
Getter of the map that contains basic type diffs.
const string_diff_ptr_map & get_fn_parm_diff_map() const
Getter of the map that contains function parameter diffs.
const string_diff_ptr_map & get_class_diff_map() const
Getter of the map that contains class type diffs.
The base class for the node visitors. These are the types used to visit each node traversed by the di...
void or_visiting_kind(visiting_kind v)
Setter for the visiting policy of the traversing code while invoking this visitor....
virtual bool visit(diff *, bool)
Default visitor implementation.
virtual bool visit(distinct_diff *, bool)
Default visitor implementation.
virtual void visit_end(corpus_diff *)
This is called by the traversing code on a corpus_diff node just after visiting it....
void set_current_topmost_iface_diff(diff *)
Setter of the diff current topmost interface which is impacted by the current diff node being visited...
virtual void visit_begin(diff *)
This is called by the traversing code on a diff node just before visiting it. That is,...
visiting_kind get_visiting_kind() const
Getter for the visiting policy of the traversing code while invoking this visitor.
virtual void visit_end(diff *)
This is called by the traversing code on a diff node just after visiting it. That is after visiting i...
diff_node_visitor()
Default constructor of the diff_node_visitor type.
void set_visiting_kind(visiting_kind v)
Setter for the visiting policy of the traversing code while invoking this visitor.
diff * get_current_topmost_iface_diff() const
Getter of the diff current topmost interface which is impacted by the current diff node being visited...
virtual bool traverse(diff_node_visitor &v)
The default traverse function.
The abstraction of a change between two ABI artifacts, a.k.a an artifact change.
void begin_traversing()
Flag a given diff node as being traversed.
void set_category(diff_category c)
Set the category of the current diff node. This category includes the categories inherited from the c...
virtual void finish_diff_type()
Finish the insertion of a diff tree node into the diff graph.
virtual void chain_into_hierarchy()
This constructs the relation between this diff node and its detail diff nodes, in the generic view of...
diff_category remove_from_category(diff_category c)
Remove the current diff tree node from an a existing sef of categories. The categories include those ...
type_or_decl_base_sptr second_subject() const
Getter of the second subject of the diff.
bool is_traversing() const
Tell if a given node is being traversed or not.
type_or_decl_base_sptr first_subject() const
Getter of the first subject of the diff.
bool is_suppressed() const
Test if the current diff node has been suppressed by a user-provided suppression specification.
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...
diff * get_canonical_diff() const
Getter for the canonical diff of the current instance of diff.
bool has_parent_allowed_by_specific_negated_suppression() const
Test if the current diff node has a parent node which is specifically allowed by a negated suppressio...
bool has_local_changes_to_be_reported() const
Test if this diff tree node should be reported when considering the categories that were *NOT* inheri...
const vector< diff * > & children_nodes() const
Getter for the children nodes of the current diff node.
diff_category get_category() const
Getter for the category of the current diff tree node.
bool is_allowed_by_specific_negated_suppression() const
Test if this diff node is allowed (prevented from being suppressed) by at least one negated suppressi...
diff_category remove_from_local_category(diff_category c)
Remove the current diff tree node from the categories resulting from the local changes.
void add_to_local_and_inherited_categories(diff_category c)
Adds the current diff tree node to the categories resulting from the local and inherited changes of t...
bool do_log() const
Test if logging was requested.
diff_category get_local_category() const
Getter for the local category of the current diff tree node.
diff_category add_to_category(diff_category c)
Adds the current diff tree node to an additional set of categories. Note that the categories include ...
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...
virtual bool traverse(diff_node_visitor &v)
The generic traversing code that walks a given diff sub-tree.
bool currently_reporting() const
Tests if we are currently in the middle of emitting a report for this diff.
virtual bool has_changes() const =0
Pure interface to get the length of the changes encapsulated by this diff. A length of zero means tha...
bool has_descendant_allowed_by_specific_negated_suppression() const
Test if the current diff node has a descendant node which is specifically allowed by a negated suppre...
bool to_be_reported() const
Test if this diff tree node should be reported.
const diff * parent_node() const
Getter for the parent node of the current diff node.
diff_category get_class_of_equiv_category() const
Getter of the category of the class of equivalence of the current diff tree node.
void set_canonical_diff(diff *)
Setter for the canonical diff of the current instance of diff.
bool is_filtered_out_wrt_non_inherited_categories() const
Test if this diff tree node is to be filtered out for reporting purposes, but by considering only the...
diff_category add_to_local_category(diff_category c)
Adds the current diff tree node to the categories resulting from the local changes of the current dif...
void set_local_category(diff_category c)
Set the local category of the current diff node.
virtual const string & get_pretty_representation() const
Get a pretty representation of the current diff node.
void append_child_node(diff_sptr)
Add a new child node to the vector of children nodes for the current diff node.
bool is_filtered_out() const
Test if this diff tree node is to be filtered out for reporting purposes.
void end_traversing()
Flag a given diff node as not being traversed anymore.
bool reported_once() const
Tests if a report has already been emitted for the current diff.
An abstraction of a diff between entities that are of a different kind (disctinct).
virtual bool has_changes() const
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of @distinct_d...
const diff_sptr compatible_child_diff() const
Getter for the child diff of this distinct_diff instance.
distinct_diff(type_or_decl_base_sptr first, type_or_decl_base_sptr second, diff_context_sptr ctxt=diff_context_sptr())
Constructor for distinct_diff.
static bool entities_are_of_distinct_kinds(type_or_decl_base_sptr first, type_or_decl_base_sptr second)
Test if the two arguments are of different kind, or that are both NULL.
virtual void report(ostream &out, const string &indent="") const
Emit a report about the current diff instance.
const type_or_decl_base_sptr first() const
Getter for the first subject of the diff.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
const type_or_decl_base_sptr second() const
Getter for the second subject of the diff.
Abstraction of a diff between two enums.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of enum_diff.
enum_diff(const enum_type_decl_sptr, const enum_type_decl_sptr, const diff_sptr, diff_context_sptr ctxt=diff_context_sptr())
Constructor for enum_diff.
diff_sptr underlying_type_diff() const
const string_changed_enumerator_map & changed_enumerators() const
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
const enum_type_decl_sptr first_enum() const
const string_enumerator_map & deleted_enumerators() const
const enum_type_decl_sptr second_enum() const
const string_enumerator_map & inserted_enumerators() const
virtual void report(ostream &, const string &indent="") const
Report the differences between the two enums.
A filter that walks the diff nodes tree and tags relevant diff nodes into categories considered to re...
Abstraction of a diff between two function parameters.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children nodes of the diff base type sub-object of this instance of fn_parm_di...
const function_decl::parameter_sptr first_parameter() const
Getter for the first subject of this diff node.
virtual enum change_kind has_local_changes() const
Check if the current diff node carries a local change.
virtual const string & get_pretty_representation() const
Build and return a textual representation of the current instance of fn_parm_diff.
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...
virtual void report(ostream &, const string &indent="") const
Emit a textual report about the current fn_parm_diff instance.
Abstraction of a diff between two function_decl.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of function_de...
const function_decl_sptr second_function_decl() const
function_decl_diff(const function_decl_sptr first, const function_decl_sptr second, diff_context_sptr ctxt)
Constructor for function_decl_diff.
virtual enum change_kind has_local_changes() const
const function_decl_sptr first_function_decl() const
virtual const string & get_pretty_representation() const
virtual void report(ostream &, const string &indent="") const
Serialize a report of the changes encapsulated in the current instance of function_decl_diff over to ...
Abstraction of a diff between two function types.
virtual bool has_changes() const
Test if the current diff node carries changes.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of function_ty...
const string_fn_parm_diff_sptr_map & subtype_changed_parms() const
Getter for the map of function parameter changes of the current diff.
const diff_sptr return_type_diff() const
Getter for the diff of the return types of the two function types of the current diff.
const string_parm_map & removed_parms() const
Getter for the map of parameters that got removed.
const string_parm_map & added_parms() const
Getter for the map of parameters that got added.
friend function_type_diff_sptr compute_diff(const function_type_sptr first, const function_type_sptr second, diff_context_sptr ctxt)
Compute the diff between two instances of function_type.
const vector< function_decl::parameter_sptr > & sorted_added_parms() const
Getter for the sorted vector of added parameters .
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.
function_type_diff(const function_type_sptr first, const function_type_sptr second, diff_context_sptr ctxt)
Consutrctor of the function_type type.
virtual enum change_kind has_local_changes() const
Test if the current diff node carries local changes.
virtual const string & get_pretty_representation() const
Build and return a copy of a pretty representation of the current instance of function_type_diff.
const vector< function_decl::parameter_sptr > & sorted_deleted_parms() const
Getter for the sorted vector of deleted parameters.
virtual void report(ostream &, const string &indent="") const
Build and emit a textual report about the current function_type_diff instance.
A reporter that only reports leaf changes.
The abstraction of a diff between two pointers.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
const pointer_type_def_sptr first_pointer() const
Getter for the first subject of a pointer diff.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of pointer_dif...
const pointer_type_def_sptr second_pointer() const
Getter for the second subject of a pointer diff.
diff_sptr underlying_type_diff() const
Getter for the diff between the pointed-to types of the pointers of this diff.
pointer_diff(pointer_type_def_sptr first, pointer_type_def_sptr second, diff_sptr underlying_type_diff, diff_context_sptr ctxt=diff_context_sptr())
Constructor for a pointer_diff.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
virtual void report(ostream &, const string &indent="") const
Report the diff in a serialized form.
Abstraction of a diff between two qualified types.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of qualified_t...
diff_sptr leaf_underlying_type_diff() const
Getter for the diff between the most underlying non-qualified types of two qualified types.
diff_sptr underlying_type_diff() const
Getter for the diff between the underlying types of the two qualified types.
qualified_type_diff(qualified_type_def_sptr first, qualified_type_def_sptr second, diff_sptr underling, diff_context_sptr ctxt=diff_context_sptr())
Constructor for qualified_type_diff.
const qualified_type_def_sptr second_qualified_type() const
Getter for the second qualified type of the diff.
virtual enum change_kind has_local_changes() const
const qualified_type_def_sptr first_qualified_type() const
Getter for the first qualified type of the diff.
virtual const string & get_pretty_representation() const
virtual void report(ostream &, const string &indent="") const
Report the diff in a serialized form.
The abstraction of a diff between two references.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of reference_d...
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.
reference_diff(const reference_type_def_sptr first, const reference_type_def_sptr second, diff_sptr underlying, diff_context_sptr ctxt=diff_context_sptr())
Constructor for reference_diff.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
const diff_sptr & underlying_type_diff() const
Getter for the diff between the two referred-to types.
virtual void report(ostream &, const string &indent="") const
Report the diff in a serialized form.
An abstractions of the changes between two scopes.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of scope_diff.
const diff_sptrs_type & changed_types() const
const scope_decl_sptr second_scope() const
Getter for the second scope of the diff.
const scope_decl_sptr first_scope() const
Getter for the first scope of the diff.
const decl_base_sptr deleted_member_at(unsigned index) const
Accessor that eases the manipulation of the edit script associated to this instance....
const diff_sptrs_type & changed_decls() const
scope_diff(scope_decl_sptr first_scope, scope_decl_sptr second_scope, diff_context_sptr ctxt=diff_context_sptr())
Constructor for scope_diff.
friend scope_diff_sptr compute_diff(const scope_decl_sptr first, const scope_decl_sptr second, scope_diff_sptr d, diff_context_sptr ctxt)
Compute the diff between two scopes.
const decl_base_sptr inserted_member_at(unsigned i)
Accessor that eases the manipulation of the edit script associated to this instance....
virtual void report(ostream &out, const string &indent="") const
Report the changes of one scope against another.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
const edit_script & member_changes() const
Accessor of the edit script of the members of a scope.
The abstraction of the diff between two subrange types.
virtual bool has_changes() const
Test if the current subrange_diff node carries any change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of subrange_di...
const array_type_def::subrange_sptr second_subrange() const
Getter of the second subrange of the current instance subrange_diff.
subrange_diff(const array_type_def::subrange_sptr &first, const array_type_def::subrange_sptr &second, const diff_sptr &underlying_type_diff, const diff_context_sptr ctxt=diff_context_sptr())
Constructor of the subrange_diff diff node type.
const array_type_def::subrange_sptr first_subrange() const
Getter of the first subrange of the current instance subrange_diff.
const diff_sptr underlying_type_diff() const
Getter of the diff node of the underlying types of the current subrange_diff diff node.
virtual enum change_kind has_local_changes() const
Test if the current subrange_diff node carries any local change.
virtual const string & get_pretty_representation() const
Getter the pretty representation of the subrange_diff diff node.
virtual void report(ostream &, const string &indent="") const
Report about the changes carried by this node.
An abstraction of a diff between two translation units.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
const translation_unit_sptr second_translation_unit() const
Getter for the second translation unit of this diff.
translation_unit_diff(translation_unit_sptr first, translation_unit_sptr second, diff_context_sptr ctxt=diff_context_sptr())
Constructor for translation_unit_diff.
virtual void report(ostream &out, const string &indent="") const
Report the diff in a serialized form.
virtual enum change_kind has_local_changes() const
const translation_unit_sptr first_translation_unit() const
Getter for the first translation unit of this diff.
Abstraction of a diff between two basic type declarations.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
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.
virtual void report(ostream &out, const string &indent="") const
Ouputs a report of the differences between of the two type_decl involved in the type_decl_diff.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
The base class of diff between types.
Abstraction of a diff between two typedef_decl.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of typedef_dif...
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.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
virtual void report(ostream &, const string &indent="") const
Reports the difference between the two subjects of the diff in a serialized form.
union_diff(union_decl_sptr first_union, union_decl_sptr second_union, diff_context_sptr ctxt=diff_context_sptr())
Constructor for the union_diff type.
union_decl_sptr first_union_decl() const
union_decl_sptr second_union_decl() const
virtual ~union_diff()
Destructor of the union_diff node.
virtual const string & get_pretty_representation() const
virtual void report(ostream &, const string &indent="") const
Report the changes carried by the current union_diff node in a textual format.
Abstracts a diff between two instances of var_decl.
virtual bool has_changes() const
Return true iff the diff node has a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of var_diff.
var_diff(var_decl_sptr first, var_decl_sptr second, diff_sptr type_diff, diff_context_sptr ctxt=diff_context_sptr())
Constructor for var_diff.
var_decl_sptr first_var() const
Getter for the first var_decl of the diff.
virtual void report(ostream &out, const string &indent="") const
Report the diff in a serialized form.
virtual enum change_kind has_local_changes() const
friend var_diff_sptr compute_diff(const var_decl_sptr first, const var_decl_sptr second, diff_context_sptr ctxt)
Compute the diff between two instances of var_decl.
virtual const string & get_pretty_representation() const
diff_sptr type_diff() const
Getter for the diff of the types of the instances of var_decl.
var_decl_sptr second_var() const
Getter for the second var_decl of the diff.
The abstraction of an edit script for transforming a sequence A into a sequence B.
shared_ptr< subrange_type > subrange_sptr
Convenience typedef for a shared pointer on a function_decl::subrange.
shared_ptr< base_spec > base_spec_sptr
Convenience typedef.
vector< base_spec_sptr > base_specs
Convenience typedef.
vector< method_decl_sptr > member_functions
Convenience typedef.
The abstraction of the version of an ELF symbol.
Abstraction of an elf symbol.
const string & get_id_string() const
Get a string that is representative of a given elf_symbol.
std::vector< enumerator > enumerators
Convenience typedef for a list of enumerator.
Abstraction for a function declaration.
shared_ptr< parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
const function_type_sptr get_type() const
Return the type of the current instance of function_decl.
interned_string get_id() const
Return an ID that tries to uniquely identify the function inside a program or a library.
An abstraction helper for type declarations.
The base class of both types and declarations.
Abstracts a variable declaration.
interned_string get_id() const
Return an ID that tries to uniquely identify the variable inside a program or a library.
change_kind
The kind of change the current function suppression should apply to.
@ ADDED_FUNCTION_CHANGE_KIND
The function was added to the second subject of the diff.
@ DELETED_FUNCTION_CHANGE_KIND
The function was deleted from the second subject of the diff.
change_kind
The kind of change the current variable suppression should apply to.
@ ADDED_VARIABLE_CHANGE_KIND
The variable was added to the second second subject of the diff.
@ DELETED_VARIABLE_CHANGE_KIND
The variable was deleted from the second subject of the diff.
std::vector< filter_base_sptr > filters
Convenience typedef for a vector of filter_base_sptr.
bool is_decl_only_class_with_size_change(const class_or_union &first, const class_or_union &second)
Test if two classes that are decl-only (have the decl-only flag and carry no data members) but are di...
shared_ptr< filter_base > filter_base_sptr
Convenience typedef for a shared pointer to filter_base.
bool has_harmful_name_change(const decl_base_sptr &f, const decl_base_sptr &s)
Test if two decls represents a harmful name change.
bool has_decl_only_def_change(const decl_base_sptr &first, const decl_base_sptr &second)
Test if two decl_base_sptr are different just by the fact that one is decl-only and the other one is ...
bool has_basic_or_class_type_name_change(const diff *d)
Test if a diff node carries a basic or class type name change.
void apply_filter(filter_base &filter, corpus_diff_sptr d)
Walk the diff sub-trees of a a corpus_diff and apply a filter to the nodes visted....
bool is_mostly_distinct_diff(const diff *d)
Test if a diff node carries a distinct type change or a pointer/reference/typedef to distinct type ch...
shared_ptr< diff > diff_sptr
Convenience typedef for a shared_ptr for the diff class.
visiting_kind operator~(visiting_kind l)
The overloaded 'bit inversion' operator for visiting_kind.
const decl_diff_base * is_decl_diff(const diff *diff)
Test if a diff node is about differences between declarations.
const diff * peel_qualified_diff(const diff *dif)
If a diff node is about changes between two qualified types, get the diff node about changes between ...
const diff * peel_pointer_or_qualified_type_diff(const diff *dif)
If a diff node is about changes between two pointer, reference or qualified types,...
void categorize_redundancy(diff *diff_tree)
Walk a given diff sub-tree to categorize each of the nodes with respect to the REDUNDANT_CATEGORY.
vector< diff * > diff_ptrs_type
Convenience typedef for a vector of diff*.
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...
diff_category
An enum for the different categories that a diff tree node falls into, regarding the kind of changes ...
@ ACCESS_CHANGE_CATEGORY
This means the diff node (or at least one of its descendant nodes) carries access related changes,...
@ HARMLESS_DATA_MEMBER_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless data member change....
@ SUPPRESSED_CATEGORY
This means that a diff node was marked as suppressed by a user-provided suppression specification.
@ VIRTUAL_MEMBER_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an incompatible change to a vtable.
@ REDUNDANT_CATEGORY
A diff node in this category is redundant. That means it's present as a child of a other nodes in the...
@ SIZE_OR_OFFSET_CHANGE_CATEGORY
This means the diff node (or at least one of its descendant nodes) carries a change that modifies the...
@ NON_VIRT_MEM_FUN_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an addition or removal of a non-virtual member fu...
@ HAS_DESCENDANT_WITH_ALLOWED_CHANGE_CATEGORY
A diff node in this category has a descendant node that is in the HAS_ALLOWED_CHANGE_CATEGORY categor...
@ HARMLESS_ENUM_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an addition of enumerator to an enum type.
@ FN_PARM_ADD_REMOVE_CHANGE_CATEGORY
A diff node in this category is a function (or function type) with at least one parameter added or re...
@ VOID_PTR_TO_PTR_CHANGE_CATEGORY
A diff node in this category carries a change from void pointer to non-void pointer.
@ 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...
@ COMPATIBLE_TYPE_CHANGE_CATEGORY
This means the diff node (or at least one of its descendant nodes) carries a change involving two com...
@ TYPE_DECL_ONLY_DEF_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a type that was declaration-only and that is now ...
@ STATIC_DATA_MEMBER_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an addition or removal of a static data member.
@ HARMLESS_DECL_NAME_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless declaration name change....
@ EVERYTHING_CATEGORY
A special enumerator that is the logical 'or' all the enumerators above.
@ NO_CHANGE_CATEGORY
This means the diff node does not carry any (meaningful) change, or that it carries changes that have...
@ HARMLESS_UNION_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless union change.
@ HAS_PARENT_WITH_ALLOWED_CHANGE_CATEGORY
A diff node in this category has a parent node that is in the HAS_ALLOWED_CHANGE_CATEGORY category....
@ BENIGN_INFINITE_ARRAY_CHANGE_CATEGORY
A diff node in this category carries a change in the size of the array type of a global variable,...
@ VAR_TYPE_CV_CHANGE_CATEGORY
A diff node in this category is for a variable which type holds a cv-qualifier change.
@ HAS_ALLOWED_CHANGE_CATEGORY
A diff node in this category carries a change that must be reported, even if the diff node is also in...
@ FN_PARM_TYPE_CV_CHANGE_CATEGORY
A diff node in this category has a function parameter type with a cv-qualifiers change.
@ FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY
A diff node in this category is a function parameter type which top cv-qualifiers change.
@ FN_RETURN_TYPE_CV_CHANGE_CATEGORY
A diff node in this category is a function return type with a cv-qualifier change.
@ HARMLESS_SYMBOL_ALIAS_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an a symbol alias change that is harmless.
shared_ptr< reporter_base > reporter_base_sptr
A convenience typedef for a shared pointer to a reporter_base.
void sort_string_var_diff_sptr_map(const string_var_diff_sptr_map &map, var_diff_sptrs_type &sorted)
Sort of an instance of string_var_diff_sptr_map map.
unordered_map< string, var_diff_sptr > string_var_diff_sptr_map
Convenience typedef for a map whose key is a string and whose value is a changed variable of type var...
const class_or_union_diff * is_diff_of_class_or_union_type(const diff *d)
Test if a diff node represents a diff between two class or union types.
const pointer_diff * is_pointer_diff(const diff *diff)
Test if a diff node is about differences between two pointers.
vector< var_diff_sptr > var_diff_sptrs_type
Convenience typedef for a vector of var_diff_sptr.
unordered_map< string, class_decl::base_spec_sptr > string_base_sptr_map
Convenience typedef for a map of string and class_decl::basse_spec_sptr.
diff_sptr try_to_diff(const type_or_decl_base_sptr first, const type_or_decl_base_sptr second, diff_context_sptr ctxt)
</distinct_diff>
bool has_basic_type_change_only(const diff *d)
Test if a diff node is a decl diff that only carries a basic type change on its type diff sub-node.
void propagate_categories(diff *diff_tree)
Visit all the nodes of a given sub-tree. For each node that has a particular category set,...
const subrange_diff * is_subrange_diff(const diff *diff)
Test if a diff node is a subrange_diff node.
unordered_map< unsigned, fn_parm_diff_sptr > unsigned_fn_parm_diff_sptr_map
Convenience typedef for a map which key is an integer and which value is a changed parameter.
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 sort_string_base_sptr_map(const string_base_sptr_map &m, class_decl::base_specs &sorted)
Lexicographically sort base specifications found in instances of string_base_sptr_map.
diff_category get_default_harmless_categories_bitmap()
Getter of a bitmap made of the set of change categories that are considered harmless.
vector< diff_sptr > diff_sptrs_type
Convenience typedef for a vector of diff_sptr.
distinct_diff_sptr compute_diff_for_distinct_kinds(const type_or_decl_base_sptr first, const type_or_decl_base_sptr second, diff_context_sptr ctxt)
Try to diff entities that are of distinct kinds.
void sort_changed_data_members(changed_var_sptrs_type &input)
Sort (in place) a vector of changed data members.
unordered_map< string, type_base_sptr > string_type_base_sptr_map
Convenience typedef for a map which key is a string and which value is a type_base_sptr.
diff_sptr try_to_diff< class_decl >(const type_or_decl_base_sptr first, const type_or_decl_base_sptr second, diff_context_sptr ctxt)
This is a specialization of try_to_diff() template to diff instances of class_decl.
shared_ptr< type_decl_diff > type_decl_diff_sptr
Convenience typedef for a shared pointer on a type_decl_diff type.
bool is_diff_of_variadic_parameter(const diff *d)
Test if a diff node represents the difference between a variadic parameter and something else.
shared_ptr< diff_context > diff_context_sptr
Convenience typedef for a shared pointer of diff_context.
bool is_diff_of_global_decls(const diff *)
Tests if a given diff node is to represent the changes between two gobal decls.
shared_ptr< subrange_diff > subrange_diff_sptr
A convenience typedef for a shared pointer to subrange_diff type.
bool is_diff_of_variadic_parameter_type(const diff *d)
Test if a diff node represents the difference between a variadic parameter type and something else.
diff_category get_default_harmful_categories_bitmap()
Getter of a bitmap made of the set of change categories that are considered harmful.
unordered_map< string, function_decl::parameter_sptr > string_parm_map
Convenience typedef for a map which value is a function parameter. The key is the name of the functio...
unordered_map< string, enum_type_decl::enumerator > string_enumerator_map
Convenience typedef for a map which value is an enumerator. The key is the name of the enumerator.
shared_ptr< var_diff > var_diff_sptr
Convenience typedef for a shared pointer to a var_diff type.
unordered_map< string, method_decl_sptr > string_member_function_sptr_map
Convenience typedef for a hash map of strings and member functions.
const diff * peel_typedef_diff(const diff *dif)
If a diff node is about changes between two typedef types, get the diff node about changes between th...
shared_ptr< reference_diff > reference_diff_sptr
Convenience typedef for a shared pointer on a reference_diff type.
vector< base_diff_sptr > base_diff_sptrs_type
Convenience typedef for a vector of base_diff_sptr.
unordered_map< string, function_decl * > string_function_ptr_map
Convenience typedef for a map which key is a string and which value is a pointer to decl_base.
shared_ptr< function_decl_diff > function_decl_diff_sptr
Convenience typedef for a shared pointer to a function_decl type.
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.
const function_decl_diff * is_function_decl_diff(const diff *diff)
Test if a diff node is about differences between functions.
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...
shared_ptr< fn_parm_diff > fn_parm_diff_sptr
Convenience typedef for a shared pointer to a fn_parm_diff type.
unordered_map< string, function_decl_diff_sptr > string_function_decl_diff_sptr_map
Convenience typedef for a map which key is a string and which value is a function_decl_diff_sptr.
void clear_redundancy_categorization(diff *diff_tree)
Walk a given diff sub-tree to clear the REDUNDANT_CATEGORY out of the category of the nodes.
void sort_unsigned_data_member_diff_sptr_map(const unsigned_var_diff_sptr_map map, var_diff_sptrs_type &sorted)
Sort the values of a unsigned_var_diff_sptr_map map and store the result into a vector of var_diff_sp...
void sort_string_fn_parm_diff_sptr_map(const unsigned_fn_parm_diff_sptr_map &map, vector< fn_parm_diff_sptr > &sorted)
Sort a map of fn_parm_diff by the indexes of the function parameters.
bool is_child_node_of_base_diff(const diff *diff)
Test if a diff node is a child node of a base diff node.
visiting_kind
An enum for the different ways to visit a diff tree node.
@ SKIP_CHILDREN_VISITING_KIND
This says that the traversing code should avoid visiting the children nodes of the current node being...
@ DO_NOT_MARK_VISITED_NODES_AS_VISITED
This says that the traversing code should not mark visited nodes as having been traversed....
visiting_kind operator&(visiting_kind l, visiting_kind r)
The overloaded and operator for visiting_kind.
unordered_map< string, var_decl * > string_var_ptr_map
Convenience typedef for a map which key is a string and which value is a point to var_decl.
const diff * peel_fn_parm_diff(const diff *dif)
If a diff node is about changes between two function parameters get the diff node about changes betwe...
const function_type_diff * is_function_type_diff(const diff *diff)
Test if a diff node is a function_type_diff node.
const distinct_diff * is_distinct_diff(const diff *diff)
Test if a diff node is about differences between two diff nodes of different kinds.
unordered_map< string, changed_enumerator > string_changed_enumerator_map
Convenience typedef for a map which value is a changed enumerator. The key is the name of the changed...
visiting_kind operator|(visiting_kind l, visiting_kind r)
The overloaded or operator for visiting_kind.
const array_diff * is_array_diff(const diff *diff)
Test if a diff node is a array_diff node.
const diff * peel_reference_diff(const diff *dif)
If a diff node is about changes between two reference types, get the diff node about changes between ...
unordered_map< string, fn_parm_diff_sptr > string_fn_parm_diff_sptr_map
Convenience typedef for a map which value is a changed function parameter and which key is the name o...
string get_pretty_representation(diff *d)
Get a copy of the pretty representation of a diff node.
void sort_artifacts_set(const artifact_sptr_set_type &set, vector< type_or_decl_base_sptr > &sorted)
Sort the set of ABI artifacts contained in a artifact_sptr_set_type.
unordered_map< string, decl_base_sptr > string_decl_base_sptr_map
Convenience typedef for a map which key is a string and which value is a decl_base_sptr.
const class_or_union_diff * is_anonymous_class_or_union_diff(const diff *d)
Test if a diff node is a class_or_union_diff between two anonymous classes or unions.
shared_ptr< base_diff > base_diff_sptr
Convenience typedef for a shared pointer to a base_diff type.
shared_ptr< scope_diff > scope_diff_sptr
Convenience typedef for a shared pointer on a scope_diff.
shared_ptr< class_diff > class_diff_sptr
Convenience typedef for a shared pointer on a class_diff type.
const base_diff * is_base_diff(const diff *diff)
Test if a diff node is about differences between two base class specifiers.
const fn_parm_diff * is_fn_parm_diff(const diff *diff)
Test if a diff node is about differences between two function parameters.
void sort_string_member_function_sptr_map(const string_member_function_sptr_map &map, class_or_union::member_functions &sorted)
Sort a map that's an instance of string_member_function_sptr_map and fill a vector of member function...
const union_diff * is_union_diff(const diff *diff)
Test if a diff node is a union_diff node.
vector< changed_var_sptr > changed_var_sptrs_type
Convenience typedef for a vector of @changed_var_sptr.gg381.
shared_ptr< pointer_diff > pointer_diff_sptr
Convenience typedef for a shared pointer on a pointer_diff type.
const diff * peel_pointer_diff(const diff *dif)
If a diff node is about changes between two pointer types, get the diff node about changes between th...
void apply_suppressions(diff *diff_tree)
Walk a given diff-sub tree and appply the suppressions carried by the context. If the suppression app...
void sort_string_parm_map(const string_parm_map &map, vector< function_decl::parameter_sptr > &sorted)
Sort a map of string -> function parameters.
void sort_string_type_base_sptr_map(string_type_base_sptr_map &map, vector< type_base_sptr > &sorted)
Sort a map of string to type_base_sptr entities.
const enum_diff * is_enum_diff(const diff *diff)
Test if a diff node is a enum_diff node.
unordered_map< string, base_diff_sptr > string_base_diff_sptr_map
Convenience typedef for a map of string and base_diff_sptr.
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.
const class_or_union_diff * is_class_or_union_diff(const diff *d)
Test if a diff node is a class_or_union_diff node.
const corpus_diff * is_corpus_diff(const diff *diff)
Test if a diff node is a corpus_diff node.
const diff * get_typedef_diff_underlying_type_diff(const diff *diff)
Return the leaf underlying diff node of a typedef_diff node.
const typedef_diff * is_typedef_diff(const diff *diff)
Test if a diff node is a typedef_diff node.
unordered_map< unsigned, var_diff_sptr > unsigned_var_diff_sptr_map
Convenience typedef for a map whose key is an unsigned int and whose value is a changed variable of t...
type_base_sptr get_leaf_type(qualified_type_def_sptr t)
Return the first underlying type that is not a qualified type.
const diff * peel_typedef_qualified_type_or_parameter_diff(const diff *dif)
If a diff node is about changes between two typedefs or qualified types, get the diff node about chan...
shared_ptr< array_diff > array_diff_sptr
Convenience typedef for a shared pointer on a array_diff type.
bool is_reference_or_ptr_diff_to_non_basic_nor_distinct_types(const diff *diff)
Test if a diff node is a reference or pointer diff node to a change that is neither basic type change...
const class_diff * is_class_diff(const diff *diff)
Test if a diff node is a class_diff node.
const type_decl_diff * is_diff_of_basic_type(const diff *d)
Test if a diff node represents a diff between two basic types.
unordered_map< string, diff_sptr > string_diff_sptr_map
Convenience typedef for a map which value is a diff_sptr. The key of the map is the qualified name of...
unordered_map< const diff *, artifact_sptr_set_type, diff_hash, diff_equal > diff_artifact_set_map_type
A convenience typedef for an unordered_map which key is a diff* and which value is a artifact_sptr_se...
const qualified_type_diff * is_qualified_type_diff(const diff *diff)
Test if a diff node is about differences between two qualified types.
diff_sptr compute_diff(const decl_base_sptr first, const decl_base_sptr second, diff_context_sptr ctxt)
Compute the difference between two decls. The decls can represent either type declarations,...
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...
void sort_string_base_diff_sptr_map(const string_base_diff_sptr_map &map, base_diff_sptrs_type &sorted)
Sort a map of string -> base_diff_sptr into a sorted vector of base_diff_sptr. The base_diff_sptr are...
void sort_changed_enumerators(const string_changed_enumerator_map &enumerators_map, changed_enumerators_type &sorted)
Sort a map of changed enumerators.
void print_diff_tree(diff *diff_tree, ostream &out)
Emit a textual representation of a diff sub-tree to an output stream.
vector< changed_enumerator > changed_enumerators_type
Convenience typedef for a vector of changed enumerators.
vector< function_decl_diff_sptr > function_decl_diff_sptrs_type
Convenience typedef for a vector of function_decl_diff_sptr.
bool is_child_node_of_function_parm_diff(const diff *diff)
Test if a diff node is a child node of a function parameter diff node.
void sort_string_virtual_member_function_diff_sptr_map(const string_function_decl_diff_sptr_map &map, function_decl_diff_sptrs_type &sorted)
Sort an map of string -> virtual member function into a vector of virtual member functions....
shared_ptr< function_type_diff > function_type_diff_sptr
A convenience typedef for a shared pointer to function_type_type_diff.
const function_type_diff * is_function_type_diff_with_local_changes(const diff *diff)
Test if a given diff node carries a function type change with local changes.
const var_diff * is_var_diff(const diff *diff)
Test if a diff node is about differences between variables.
const type_diff_base * is_type_diff(const diff *diff)
Test if a diff node is about differences between types.
unordered_map< string, elf_symbol_sptr > string_elf_symbol_map
Convenience typedef for a map whose key is a string and whose value is an elf_symbol_sptr.
void sort_string_diff_sptr_map(const string_diff_sptr_map &map, diff_sptrs_type &sorted)
Sort a map ofg string -> diff_sptr into a vector of diff_sptr. The diff_sptr are sorted lexicographic...
const reference_diff * is_reference_diff(const diff *diff)
Test if a diff node is about differences between two references.
void sort_string_data_member_diff_sptr_map(const string_var_diff_sptr_map &map, var_diff_sptrs_type &sorted)
Sort the values of a string_var_diff_sptr_map and store the result in a vector of var_diff_sptr.
void apply_filters(corpus_diff_sptr diff_tree)
Apply the diff tree filters that have been associated to the context of the a given corpus_diff tree....
shared_ptr< distinct_diff > distinct_diff_sptr
Convenience typedef for a shared pointer to distinct_types_diff.
shared_ptr< corpus_diff > corpus_diff_sptr
A convenience typedef for a shared pointer to corpus_diff.
std::pair< var_decl_sptr, var_decl_sptr > changed_var_sptr
Convenience typedef for a pair of var_decl_sptr representing a var_decl change. The first member of t...
shared_ptr< typedef_diff > typedef_diff_sptr
Convenience typedef for a shared pointer on a typedef_diff type.
const diff * peel_typedef_or_qualified_type_diff(const diff *dif)
If a diff node is about changes between two typedefs or qualified types, get the diff node about chan...
void sort_enumerators(const string_enumerator_map &enumerators_map, enum_type_decl::enumerators &sorted)
Sort a map of enumerators by their value.
ostream & operator<<(ostream &o, diff_category c)
Serialize an instance of diff_category to an output stream.
shared_ptr< translation_unit_diff > translation_unit_diff_sptr
Convenience typedef for a shared pointer on a translation_unit_diff type.
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...
void compute_diff(RandomAccessOutputIterator a_base, RandomAccessOutputIterator a_begin, RandomAccessOutputIterator a_end, RandomAccessOutputIterator b_base, RandomAccessOutputIterator b_begin, RandomAccessOutputIterator b_end, vector< point > &lcs, edit_script &ses, int &ses_len)
Compute the longest common subsequence of two (sub-regions of) sequences as well as the shortest edit...
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.
unordered_set< type_or_decl_base_sptr, type_or_decl_hash, type_or_decl_equal > artifact_sptr_set_type
A convenience typedef for a hash set of type_or_decl_base_sptr.
bool is_type(const type_or_decl_base &tod)
Test whether a declaration is a type.
bool is_anonymous_data_member(const decl_base &d)
Test if a decl is an anonymous data member.
array_type_def::subrange_type * is_subrange_type(const type_or_decl_base *type)
Test if a type is an array_type_def::subrange_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 ...
@ LOCAL_TYPE_CHANGE_KIND
This means that a given IR artifact has a local type change.
@ ALL_LOCAL_CHANGES_MASK
Testing (anding) against this mask means that a given IR artifact has local differences,...
@ LOCAL_NON_TYPE_CHANGE_KIND
This means that a given IR artifact has a local non-type change. That is a change that is carried by ...
bool is_user_defined_type(const type_base *t)
Test if a type is user-defined.
bool is_class_type(const type_or_decl_base &t)
Test whether a type is a class.
shared_ptr< array_type_def > array_type_def_sptr
Convenience typedef for a shared pointer on a array_type_def.
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...
class_or_union * is_class_or_union_type(const type_or_decl_base *t)
Test if a type is a class_or_union.
const var_decl_sptr get_next_data_member(const class_or_union *klass, const var_decl_sptr &data_member)
In the context of a given class or union, this function returns the data member that is located after...
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.
var_decl_sptr find_data_member_from_anonymous_data_member(const var_decl_sptr &anon_dm, const string &name)
Find a data member inside an anonymous data member.
const global_scope * get_global_scope(const decl_base &decl)
return the global scope as seen by a given declaration.
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
shared_ptr< scope_decl > scope_decl_sptr
Convenience typedef for a shared pointer on a scope_decl.
shared_ptr< type_or_decl_base > type_or_decl_base_sptr
A convenience typedef for a shared_ptr to type_or_decl_base.
shared_ptr< translation_unit > translation_unit_sptr
Convenience typedef for a shared pointer on a translation_unit type.
bool equals(const decl_base &l, const decl_base &r, change_kind *k)
Compares two instances of decl_base.
shared_ptr< pointer_type_def > pointer_type_def_sptr
Convenience typedef for a shared pointer on a pointer_type_def.
uint64_t get_absolute_data_member_offset(const var_decl &m)
Get the absolute offset of a data member.
bool is_member_function(const function_decl &f)
Test whether a function_decl is a member function.
var_decl * is_var_decl(const type_or_decl_base *tod)
Tests if a declaration is a variable declaration.
decl_base * is_decl(const type_or_decl_base *d)
Test if an ABI artifact is a declaration.
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 ...
uint64_t get_data_member_offset(const var_decl &m)
Get the offset of a data member.
bool get_member_function_is_virtual(const function_decl &f)
Test if a given member function is virtual.
class_or_union * look_through_decl_only_class(class_or_union *the_class)
If a class (or union) is a decl-only class, get its definition. Otherwise, just return the initial cl...
bool is_union_type(const type_or_decl_base &t)
Test if a type is a union_decl.
bool is_data_member(const var_decl &v)
Test if a var_decl is a data member.
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.
bool is_unique_type(const type_base_sptr &t)
Test if a type is unique in the entire environment.
method_type_sptr is_method_type(const type_or_decl_base_sptr &t)
Test whether a type is a method_type.
interned_string get_function_id_or_pretty_representation(function_decl *fn)
Get the ID of a function, or, if the ID can designate several different functions,...
bool is_at_global_scope(const decl_base &decl)
Tests whether a given declaration is at global scope.
bool is_member_decl(const decl_base_sptr d)
Tests if a declaration is a class member.
shared_ptr< variable_suppression > variable_suppression_sptr
A convenience typedef for a shared pointer to variable_suppression.
vector< suppression_sptr > suppressions_type
Convenience typedef for a vector of suppression_sptr.
shared_ptr< function_suppression > function_suppression_sptr
Convenience typedef for a shared pointer to function_suppression.
variable_suppression_sptr is_variable_suppression(const suppression_sptr s)
Test if an instance of suppression is an instance of variable_suppression.
bool is_private_type_suppr_spec(const type_suppression &s)
Test if a type suppression specification represents a private type suppression automatically generate...
shared_ptr< type_suppression > type_suppression_sptr
Convenience typedef for a shared pointer to type_suppression.
function_suppression_sptr is_function_suppression(const suppression_sptr suppr)
Test if an instance of suppression is an instance of function_suppression.
type_suppression_sptr is_type_suppression(suppression_sptr suppr)
Test if an instance of suppression is an instance of type_suppression.
shared_ptr< suppression_base > suppression_sptr
Convenience typedef for a shared pointer to a suppression.
bool is_negated_suppression(const suppression_base &s)
Test if a suppression specification is a negated suppression.
Toplevel namespace for libabigail.
A comparison function for instances of base_diff.
A functor to compare instances of class_decl::base_spec.
A functor to compare two changed enumerators, based on their initial value.
size_t count_filtered_bases()
Count the number of bases classes whose changes got filtered out.
class_decl::base_spec_sptr base_has_changed(class_decl::base_spec_sptr) const
Test whether a given base class has changed. A base class has changed if it's in both in deleted *and...
The type of private data of class_or_union_diff.
size_t count_filtered_changed_dm(bool local_only=false)
Get the number of data member changes carried by the current diff node that were filtered out.
size_t count_filtered_subtype_changed_dm(bool local_only=false)
Get the number of data member sub-type changes carried by the current diff node that were filtered ou...
size_t get_deleted_non_static_data_members_number() const
Get the number of non static data members that were deleted.
size_t count_filtered_changed_mem_fns(const diff_context_sptr &)
Get the number of member functions changes carried by the current diff node that were filtered out.
decl_base_sptr subtype_changed_dm(decl_base_sptr) const
Test if the current diff node carries a data member change for a data member which name is the same a...
type_or_decl_base_sptr member_type_has_changed(decl_base_sptr) const
Test if the current diff node carries a member type change for a member type which name is the same a...
decl_base_sptr member_class_tmpl_has_changed(decl_base_sptr) const
Test if the current diff node carries a member class template change for a member class template whic...
size_t count_filtered_inserted_mem_fns(const diff_context_sptr &)
Get the number of member functions insertions carried by the current diff node that were filtered out...
size_t count_filtered_deleted_mem_fns(const diff_context_sptr &)
Get the number of member functions deletions carried by the current diff node that were filtered out.
size_t get_inserted_non_static_data_members_number() const
Get the number of non static data members that were inserted.
The type of the private data of corpus_diff::diff_stats.
bool added_unreachable_type_is_suppressed(const type_base *t) const
Test if an added type that is unreachable from public interface has been suppressed by a suppression ...
void ensure_lookup_tables_populated()
If the lookup tables are not yet built, walk the differences and fill the lookup tables.
const vector< diff_sptr > & changed_unreachable_types_sorted() const
Get the sorted vector of diff nodes representing changed unreachable types.
diff_context_sptr get_context()
Getter of the context associated with this corpus.
void categorize_redundant_changed_sub_nodes()
Walk the changed functions and variables diff nodes to categorize redundant nodes.
bool added_unrefed_var_sym_is_suppressed(const elf_symbol *) const
Test if the change reports for a given added variable symbol (that is not referenced by any debug inf...
bool lookup_tables_empty() const
Tests if the lookup tables are empty.
bool deleted_unrefed_fn_sym_is_suppressed(const elf_symbol *) const
Test if the change reports for a given deleted function symbol (that is not referenced by any debug i...
void apply_filters_and_compute_diff_stats(corpus_diff::diff_stats &)
Compute the diff stats.
bool added_variable_is_suppressed(const var_decl *var) const
Test if the change reports for a given added variable have been suppressed.
bool deleted_unreachable_type_is_suppressed(const type_base *t) const
Test if a deleted type that is unreachable from public interface has been suppressed by a suppression...
bool deleted_variable_is_suppressed(const var_decl *var) const
Test if the change reports for a give given deleted variable has been deleted.
bool deleted_unrefed_var_sym_is_suppressed(const elf_symbol *) const
Test if the change reports for a given deleted variable symbol (that is not referenced by any debug i...
void maybe_dump_diff_tree()
If the user asked to dump the diff tree node (for changed variables and functions) on the error outpu...
void count_unreachable_types(size_t &num_added, size_t &num_removed, size_t &num_changed, size_t &num_filtered_added, size_t &num_filtered_removed, size_t &num_filtered_changed)
Count the number of types not reachable from the interface (i.e, not reachable from global functions ...
void clear_redundancy_categorization()
Walk the changed functions and variables diff nodes and clear the redundancy categorization they migh...
void count_leaf_changes(size_t &num_changes, size_t &num_filtered)
Count the number of leaf changes as well as the number of the changes that have been filtered out.
void count_leaf_type_changes(size_t &num_type_changes, size_t &num_type_changes_filtered)
Count the number of leaf *type* changes as well as the number of the leaf type changes that have been...
bool added_unrefed_fn_sym_is_suppressed(const elf_symbol *) const
Test if the change reports for a given added function symbol (that is not referenced by any debug inf...
bool deleted_function_is_suppressed(const function_decl *fn) const
Test if the change reports for a given deleted function have been deleted.
void apply_supprs_to_added_removed_fns_vars_unreachable_types()
Apply suppression specifications for this corpus diff to the set of added/removed functions/variables...
void emit_diff_stats(const diff_stats &stats, ostream &out, const string &indent)
Emit the summary of the functions & variables that got removed/changed/added.
bool added_function_is_suppressed(const function_decl *fn) const
Test if the change reports for a give given added function has been deleted.
void clear_lookup_tables()
Clear the lookup tables useful for reporting an enum_diff.
A comparison functor to compare two data members based on their offset.
A comparison functor to compare two instances of var_diff that represent changed data members based o...
A comparison functor for instances of diff.
A functor to compare two instances of diff_sptr.
The private data structure for distinct_diff.
A functor to compare instances of elf_symbol base on their names.
A functor to compare two enumerators based on their value. This implements the "less than" operator.
A comparison functor to compare two instances of fn_parm_diff based on their indexes.
"Less than" functor to compare instances of function_decl.
A "Less Than" functor to compare instance of function_decl_diff.
Functor that compares two function parameters for the purpose of sorting them.
The internal type for the impl idiom implementation of pointer_diff.
The internal type for the impl idiom implementation of subrange_diff.
A functor to compare instances of var_decl base on their qualified names.
The internal type for the impl idiom implementation of var_diff.
Functor to sort instances of var_diff_sptr.
A comparison functor for instances of function_decl_diff that represent changes between two virtual m...
An equality functor to deeply compare pointers.
A comparison functor to compare pointer to instances of type_or_decl_base.
A deleter for shared pointers that ... doesn't delete the object managed by the shared pointer.