libabigail
abg-comparison.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2// -*- Mode: C++ -*-
3//
4// Copyright (C) 2013-2025 Red Hat, Inc.
5//
6// Author: Dodji Seketeli
7
8#ifndef __ABG_COMPARISON_H__
9#define __ABG_COMPARISON_H__
10
11/// @file
12
13#include <memory>
14#include <ostream>
15#include <unordered_map>
16#include <unordered_set>
17#include "abg-corpus.h"
18#include "abg-diff-utils.h"
19#include "abg-reporter.h"
20#include "abg-suppression.h"
21
22namespace abigail
23{
24
25/// @brief utilities to compare abi artifacts
26///
27/// The main entry points of the namespace are the compute_diff()
28/// overloads used to compute the difference between two abi artifacts.
29namespace comparison
30{
31
32namespace filtering
33{
34struct filter_base;
35typedef shared_ptr<filter_base> filter_base_sptr;
36typedef std::vector<filter_base_sptr> filters;
37}
38
39// Inject types we need into this namespace.
40using std::ostream;
41using std::vector;
42using std::unordered_map;
43using std::unordered_set;
44using std::pair;
45
46using diff_utils::insertion;
47using diff_utils::deletion;
48using diff_utils::edit_script;
49
50/// Hasher for @ref diff_sptr.
52{
53 /// The actual hashing functor.
54 size_t
55 operator()(const diff_sptr& t) const
56 {return reinterpret_cast<size_t>(t.get());}
57}; // end struct diff_sptr_hasher
58
59/// Convenience typedef for a vector of @ref diff_sptr.
60typedef vector<diff_sptr> diff_sptrs_type;
61
62/// Convenience typedef for a vector of @ref diff*.
63typedef vector<diff*> diff_ptrs_type;
64
65/// Convenience typedef for an unoredered set of @ref diff_sptr
66typedef unordered_set<diff_sptr, diff_sptr_hasher> unordered_diff_sptr_set;
67
68class decl_diff_base;
69
70/// Convenience typedef for a shared_ptr of @ref decl_diff_base.
71typedef shared_ptr<decl_diff_base> decl_diff_base_sptr;
72
73/// Convenience typedef for a vector of @ref decl_diff_base_sptr.
74typedef vector<decl_diff_base_sptr> decl_diff_base_sptrs_type;
75
76class type_diff_base;
77/// Convenience pointer for a shared pointer to a type_diff_base
78typedef shared_ptr<type_diff_base> type_diff_base_sptr;
79
80/// Convenience typedef for a vector of @ref type_diff_base_sptr
81typedef vector<type_diff_base_sptr> type_diff_base_sptrs_type;
82
84
85/// Convenience typedef for a shared pointer to a @ref function_decl type.
86typedef shared_ptr<function_decl_diff> function_decl_diff_sptr;
87
88/// Convenience typedef for a vector of @ref function_decl_diff_sptr
89typedef vector<function_decl_diff_sptr> function_decl_diff_sptrs_type;
90
91class fn_parm_diff;
92
93/// Convenience typedef for a shared pointer to a @ref fn_parm_diff
94/// type.
95typedef shared_ptr<fn_parm_diff> fn_parm_diff_sptr;
96
97class var_diff;
98
99/// Convenience typedef for a shared pointer to a @ref var_diff type.
100typedef shared_ptr<var_diff> var_diff_sptr;
101
102/// Convenience typedef for a vector of @ref var_diff_sptr.
103typedef vector<var_diff_sptr> var_diff_sptrs_type;
104
105class base_diff;
106
107/// Convenience typedef for a shared pointer to a @ref base_diff type.
108typedef shared_ptr<base_diff> base_diff_sptr;
109
110/// Convenience typedef for a vector of @ref base_diff_sptr.
111typedef vector<base_diff_sptr> base_diff_sptrs_type;
112
113class class_diff;
114
115/// Convenience typedef for a shared pointer on a @ref class_diff type.
116typedef shared_ptr<class_diff> class_diff_sptr;
117
118/// Convenience typedef for a map of pointer values. The Key is a
119/// pointer value and the value is potentially another pointer value
120/// associated to the first one.
121typedef unordered_map<size_t, size_t> pointer_map;
122
123/// Convenience typedef for a map which key is a string and which
124/// value is a @ref type_base_sptr.
125typedef unordered_map<string, type_base_sptr> string_type_base_sptr_map;
126
127/// Convenience typedef for a map which key is an unsigned integer and
128/// which value is a @ref decl_base_sptr
129typedef unordered_map<unsigned, decl_base_sptr> unsigned_decl_base_sptr_map;
130
131/// Convenience typedef for a map of string and class_decl::basse_spec_sptr.
132typedef unordered_map<string, class_decl::base_spec_sptr> string_base_sptr_map;
133
134/// Convenience typedef for a map of string and @ref base_diff_sptr.
135typedef unordered_map<string, base_diff_sptr> string_base_diff_sptr_map;
136
137/// Convenience typedef for a map which value is a changed function
138/// parameter and which key is the name of the function parameter.
139typedef unordered_map<string, fn_parm_diff_sptr> string_fn_parm_diff_sptr_map;
140
141/// Convenience typedef for a map which key is an integer and which
142/// value is a changed parameter.
143typedef unordered_map<unsigned, fn_parm_diff_sptr>
145
146/// Convenience typedef for a map which key is an integer and which
147/// value is a parameter.
148typedef unordered_map<unsigned,
150
151/// Convenience typedef for a map which value is a
152/// type_diff_base_sptr. The key of the map is the qualified name of
153/// the changed type.
154typedef unordered_map<string,
156
157/// Convenience typedef for a map which value is a
158/// decl_diff_base_sptr. The key of the map is the qualified name of
159/// the changed type.
160typedef unordered_map<string,
162
163/// Convenience typedef for a map which value is a diff_sptr. The key
164/// of the map is the qualified name of the changed type.
165typedef unordered_map<string, diff_sptr> string_diff_sptr_map;
166
167/// Convenience typedef for a map which value is a diff*. The key of
168/// the map is the qualified name of the changed type.
169typedef unordered_map<string, diff*> string_diff_ptr_map;
170
171/// Convenience typedef for a map whose key is a string and whose
172/// value is a changed variable of type @ref var_diff_sptr.
173typedef unordered_map<string,
175
176
177/// Convenience typedef for a map whose key is an unsigned int and
178/// whose value is a changed variable of type @ref var_diff_sptr.
179typedef unordered_map<unsigned, var_diff_sptr> unsigned_var_diff_sptr_map;
180
181/// Convenience typedef for a map which value is a function
182/// parameter. The key is the name of the function parm.
183typedef unordered_map<string, function_decl::parameter_sptr> string_parm_map;
184
185/// Convenience typedef for a map which value is an enumerator. The
186/// key is the name of the enumerator.
187typedef unordered_map<string, enum_type_decl::enumerator> string_enumerator_map;
188
189/// Convenience typedef for a changed enumerator. The first element
190/// of the pair is the old enumerator and the second one is the new enumerator.
191typedef std::pair<enum_type_decl::enumerator,
193
194/// Convenience typedef for a vector of changed enumerators.
195typedef vector<changed_enumerator> changed_enumerators_type;
196
197/// Convenience typedef for a map which value is a changed enumerator.
198/// The key is the name of the changed enumerator.
199typedef unordered_map<string, changed_enumerator> string_changed_enumerator_map;
200
201/// Convenience typedef for a map which key is a string and which
202/// value is a pointer to @ref decl_base.
203typedef unordered_map<string, const function_decl*> string_function_ptr_map;
204
205/// Convenience typedef for a map which key is a string and which
206/// value is a @ref function_decl_diff_sptr.
207typedef unordered_map<string,
210
211/// Convenience typedef for a pair of class_decl::member_function_sptr
212/// representing a changed member function. The first element of the
213/// pair is the initial member function and the second element is the
214/// changed one.
215typedef pair<method_decl_sptr,
217
218/// Convenience typedef for a hash map of strings and changed member functions.
219typedef unordered_map<string,
222
223/// Convenience typedef for a hash map of strings and member functions.
224typedef unordered_map<string, method_decl_sptr> string_member_function_sptr_map;
225
226/// Convenience typedef for a map which key is a string and which
227/// value is a point to @ref var_decl.
228typedef unordered_map<string, var_decl_sptr> string_var_ptr_map;
229
230/// Convenience typedef for a pair of pointer to @ref var_decl
231/// representing a @ref var_decl change. The first member of the pair
232/// represents the initial variable and the second member represents
233/// the changed variable.
234typedef std::pair<var_decl*, var_decl*> changed_var_ptr;
235
236/// Convenience typedef for a pair of @ref var_decl_sptr representing
237/// a @ref var_decl change. The first member of the pair represents
238/// the initial variable and the second member represents the changed
239/// variable.
240typedef std::pair<var_decl_sptr, var_decl_sptr> changed_var_sptr;
241
242/// Convenience typedef for a vector of @changed_var_sptr.gg381
243typedef vector<changed_var_sptr> changed_var_sptrs_type;
244
245/// Convenience typedef for a map whose key is a string and whose
246/// value is an @ref elf_symbol_sptr.
247typedef unordered_map<string, elf_symbol_sptr> string_elf_symbol_map;
248
249/// Convenience typedef for a map which key is a string and which
250/// value is a @ref var_diff_sptr.
251typedef unordered_map<string, var_diff_sptr> string_var_diff_ptr_map;
252
254
256
257/// Convenience typedef for shared_ptr on diff_traversable_base.
258typedef shared_ptr<diff_traversable_base> diff_traversable_base_sptr;
259
260/// An enum for the different ways to visit a diff tree node.
261///
262/// This is used by the node traversing code, to know when to avoid
263/// visiting children nodes, for instance.
265{
266 /// The default enumerator value of this enum. It doesn't have any
267 /// particular meaning yet.
269
270 /// This says that the traversing code should avoid visiting the
271 /// children nodes of the current node being visited.
273
274 /// This says that the traversing code should not mark visited nodes
275 /// as having been traversed. This is useful, for instance, for
276 /// visitors which have debugging purposes.
279
282
285
288
289/// The base class for the diff classes that are to be traversed.
291{
292public:
293 virtual bool
295}; // end struct diff_traversable_base
296
297/// An enum for the different categories that a diff tree node falls
298/// into, regarding the kind of changes it represents.
299///
300/// Note that if you add an enumerator to this enum, you need to
301/// update a few spots accordingly:
302///
303/// * update the ACCESS_CHANGE_CATEGORY enumerator (which is the
304/// last enumerator of this enum by OR-ing its initializer with
305/// the new enumerator.
306///
307/// * update the categorize_harmless_diff_node or
308/// categorize_harmful_diff_node function depending on if the new
309/// enumerator classifies diff nodes as harmless or harmful.
310///
311/// * update the get_default_harmless_categories_bitmap or
312/// get_default_harmful_categories_bitmap function as well, just
313/// like above.
314///
315/// * update the "operator<<(ostream& o, diff_category c)" streaming
316/// operator so that it can stream the new enumerator to a textual
317/// output stream.
319{
320 /// This means the diff node does not carry any (meaningful) change,
321 /// or that it carries changes that have not yet been categorized.
323
324 /// This means the diff node (or at least one of its descendant
325 /// nodes) carries access related changes, e.g, a private member
326 /// that becomes public.
328
329 /// This means the diff node (or at least one of its descendant
330 /// nodes) carries a change involving two compatible types. For
331 /// instance a type and its typedefs.
333
334 /// This means that a diff node in the sub-tree carries a harmless
335 /// declaration name change. This is set only for name changes for
336 /// data members and typedefs.
338
339 /// This means that a diff node in the sub-tree carries an addition
340 /// or removal of a non-virtual member function.
342
343 /// This means that a diff node in the sub-tree carries an addition
344 /// or removal of a static data member.
346
347 /// This means that a diff node in the sub-tree carries an addition
348 /// of enumerator to an enum type.
350
351 /// This means that a diff node in the sub-tree carries an a symbol
352 /// alias change that is harmless.
354
355 /// This means that a diff node in the sub-tree carries a harmless
356 /// union or class change.
358
359 /// This means that a diff node in the sub-tree carries a harmless
360 /// data member change. An example of harmless data member change
361 /// is an anonymous data member that replaces a given data member
362 /// without locally changing the layout.
364
365 /// This means that a diff node was marked as suppressed by a
366 /// user-provided suppression specification.
368
369 /// This means that a diff node was warked as being for a private
370 /// type. That is, the diff node is meant to be suppressed by a
371 /// suppression specification that was auto-generated to filter out
372 /// changes to private types.
374
375 /// This means the diff node (or at least one of its descendant
376 /// nodes) carries a change that modifies the size of a type or an
377 /// offset of a type member. Removal or changes of enumerators in a
378 /// enum fall in this category too.
380
381 /// This means that a diff node in the sub-tree carries an
382 /// incompatible change to a vtable.
384
385 REFERENCE_LVALUENESS_CHANGE_CATEGORY = 1 << 13,
386
387 /// A change between two non-compatible types of different kinds.
389
390 /// A non-compatible name change between two types.
392
393 /// A diff node in this category is redundant. That means it's
394 /// present as a child of a other nodes in the diff tree.
396
397 /// This means that a diff node in the sub-tree carries a type that
398 /// was declaration-only and that is now defined, or vice versa.
400
401 /// A diff node in this category is a function parameter type which
402 /// top cv-qualifiers change.
404
405 /// A diff node in this category has a function parameter type with a
406 /// cv-qualifiers change.
408
409 /// A diff node in this category is a function return type with a
410 /// cv-qualifier change.
412
413 /// A diff node in this category is a function (or function type)
414 /// with at least one parameter added or removed.
416
417 /// A diff node in this category is for a variable which type holds
418 /// a cv-qualifier change.
420
421 /// A diff node in this category carries a change from void pointer
422 /// to non-void pointer.
424
425 /// A diff node in this category carries a change in the size of the
426 /// array type of a global variable, but the ELF size of the
427 /// variable didn't change.
429
430 /// A diff node in this category carries a change that must be
431 /// reported, even if the diff node is also in the
432 /// SUPPRESSED_CATEGORY or PRIVATE_TYPE_CATEGORY categories.
433 /// Typically, this node matches a suppression specification like
434 /// the [allow_type] directive.
436
437 /// A diff node in this category has a descendant node that is in
438 /// the HAS_ALLOWED_CHANGE_CATEGORY category. Nodes in this
439 /// category must be reported, even if they are also in the
440 /// SUPPRESSED_CATEGORY or PRIVATE_TYPE_CATEGORY categories.
442
443 /// A diff node in this category has a parent node that is in the
444 /// HAS_ALLOWED_CHANGE_CATEGORY category. Nodes in this category
445 /// must be reported, even if they are also in the
446 /// SUPPRESSED_CATEGORY or PRIVATE_TYPE_CATEGORY categories.
448
449 /// A special enumerator that is the logical 'or' all the
450 /// enumerators above.
451 ///
452 /// This one must stay the last enumerator. Please update it each
453 /// time you add a new enumerator above.
468 | REFERENCE_LVALUENESS_CHANGE_CATEGORY
483}; // enum diff_category
484
487
489operator|=(diff_category& c1, diff_category c2);
490
492operator&=(diff_category& c1, diff_category c2);
493
495operator^(diff_category c1, diff_category c2);
496
499
502
505
508
509bool
511
512ostream&
513operator<<(ostream& o, diff_category);
514
515class corpus_diff;
516
517/// This type contains maps. Each map associates a type name to a
518/// diff of that type. Not all kinds of diffs are present; only those
519/// that carry leaf changes are, for now.
521{
522 struct priv;
523 std::unique_ptr<priv> priv_;
524
525public:
526
527 diff_maps();
528
529 ~diff_maps();
530
533
536
538 get_enum_diff_map() const;
539
542
544 get_class_diff_map() const;
545
548
550 get_union_diff_map() const;
551
554
556 get_typedef_diff_map() const;
557
560
562 get_subrange_diff_map() const;
563
566
568 get_array_diff_map() const;
569
572
575
578
580 get_fn_parm_diff_map() const;
581
584
587
590
593
596
598 get_var_decl_diff_map() const;
599
602
604 get_distinct_diff_map() const;
605
608
609 bool
610 insert_diff_node(const diff *d,
611 const type_or_decl_base_sptr& impacted_iface);
612
614 lookup_impacted_interfaces(const diff *d) const;
615}; // end class diff_maps
616
617/// A convenience typedef for a shared pointer to @ref corpus_diff.
618typedef shared_ptr<corpus_diff> corpus_diff_sptr;
619
620/// The context of the diff. This type holds various bits of
621/// information that is going to be used throughout the diffing of two
622/// entities and the reporting that follows.
624{
625 struct priv;
626 std::unique_ptr<priv> priv_;
627
629 has_diff_for(const type_or_decl_base_sptr first,
630 const type_or_decl_base_sptr second) const;
631
633 has_diff_for_types(const type_base_sptr first,
634 const type_base_sptr second) const;
635
636 const diff*
637 has_diff_for(const diff* d) const;
638
640 has_diff_for(const diff_sptr d) const;
641
642 void
643 add_diff(const type_or_decl_base_sptr first,
644 const type_or_decl_base_sptr second,
645 const diff_sptr d);
646
647 void
648 add_diff(const diff_sptr d);
649
650 void
651 add_diff(const diff* d);
652
653 void
654 set_canonical_diff_for(const type_or_decl_base_sptr first,
655 const type_or_decl_base_sptr second,
656 const diff_sptr);
657
659 set_or_get_canonical_diff_for(const type_or_decl_base_sptr first,
660 const type_or_decl_base_sptr second,
661 const diff_sptr canonical_diff);
662
663public:
664 diff_context();
665
667
668 bool
669 do_log() const;
670
671 void
672 do_log(bool);
673
674 void
676
677 const corpus_diff_sptr&
678 get_corpus_diff() const;
679
680 corpus_sptr
681 get_first_corpus() const;
682
683 corpus_sptr
684 get_second_corpus() const;
685
687 get_reporter() const;
688
689 void
691
694 const type_or_decl_base_sptr second) const;
695
697 get_canonical_diff_for(const diff_sptr d) const;
698
699 void
701
702 void
704
705 diff*
706 diff_has_been_visited(const diff*) const;
707
709 diff_has_been_visited(const diff_sptr) const;
710
711 void
713
714 void
716
717 void
718 mark_last_diff_visited_per_class_of_equivalence(const diff*);
719
720 void
721 clear_last_diffs_visited_per_class_of_equivalence();
722
723 const diff*
724 get_last_visited_diff_of_class_of_equivalence(const diff*);
725
726 void
728
729 bool
731
732 void
734
735 bool
737
739 get_allowed_category() const;
740
741 void
743
744 void
746
747 void
749
750 const filtering::filters&
751 diff_filters() const;
752
753 void
755
756 void
758
759 void
761
763 suppressions() const;
764
766 suppressions();
767
769 negated_suppressions() const;
770
772 direct_suppressions() const;
773
774 void
776
777 void
779
780 bool
782
783 void
785
786 void
788
789 bool
791
792 bool
793 show_hex_values() const;
794
795 void
796 show_hex_values(bool f);
797
798 bool
800
801 void
803
804 void
806
807 bool
809
810 void
811 show_stats_only(bool f);
812
813 bool
814 show_stats_only() const;
815
816 void
817 show_soname_change(bool f);
818
819 bool
820 show_soname_change() const;
821
822 void
824
825 bool
827
828 void
829 show_deleted_fns(bool f);
830
831 bool
832 show_deleted_fns() const;
833
834 void
835 show_changed_fns(bool f);
836
837 bool
838 show_changed_fns() const;
839
840 void
841 show_added_fns(bool f);
842
843 bool
844 show_added_fns() const;
845
846 void
847 show_deleted_vars(bool f);
848
849 bool
850 show_deleted_vars() const;
851
852 void
853 show_changed_vars(bool f);
854
855 bool
856 show_changed_vars() const;
857
858 void
859 show_added_vars(bool f);
860
861 bool
862 show_added_vars() const;
863
864 bool
865 show_linkage_names() const;
866
867 void
868 show_linkage_names(bool f);
869
870 bool
871 show_locs() const;
872
873 void
874 show_locs(bool f);
875
876 bool
878
879 void
881
882 bool
884
885 void
887
888 bool
890
891 void
893
894 void show_unreachable_types(bool f);
895
897
898 bool
900
901 void
903
904 void
905 default_output_stream(ostream*);
906
907 ostream*
909
910 void
911 error_output_stream(ostream*);
912
913 ostream*
914 error_output_stream() const;
915
916 bool
917 dump_diff_tree() const;
918
919 void
920 dump_diff_tree(bool f);
921
922 void
923 do_dump_diff_tree(const diff_sptr) const;
924
925 void
927
928 friend class_diff_sptr
929 compute_diff(const class_decl_sptr first,
930 const class_decl_sptr second,
931 diff_context_sptr ctxt);
932};//end struct diff_context.
933
934/// The abstraction of a change between two ABI artifacts, a.k.a an
935/// artifact change.
936///
937/// In the grand scheme of things, a diff is strongly typed; for
938/// instance, a change between two enums is represented by an
939/// enum_diff type. A change between two function_type is represented
940/// by a function_type_diff type and a change between two class_decl
941/// is represented by a class_diff type. All of these types derive
942/// from the @ref diff parent class.
943///
944/// An artifact change D can have one (or more) details named D'. A
945/// detail is an artifact change that "belongs" to another one. Here,
946/// D' belongs to D. Or said otherwise, D' is a child change of D.
947/// Said otherwise, D and D' are related, and the relation is a
948/// "child relation".
949///
950/// For instance, if we consider a change carried by a class_diff, the
951/// detail change might be a change on one data member of the class.
952/// In other word, the class_diff change might have a child diff node
953/// that would be a var_diff node.
954///
955/// There are two ways to get the child var_diff node (for the data
956/// member change detail) of the class_diff.
957///
958/// The first way is through the typed API, that is, through the
959/// class_diff::sorted_changed_data_members() member function which
960/// returns var_diff nodes.
961///
962/// The second way is through the generic API, that is, through the
963/// diff::children_nodes() member function which returns generic diff
964/// nodes. This second way enables us to walk the diff nodes graph in
965/// a generic way, regardless of the types of the diff nodes.
966///
967/// Said otherwise, there are two views for a given diff node. There
968/// is typed view, and there is the generic view. In the typed view,
969/// the details are accessed through the typed API. In the generic
970/// view, the details are gathered through the generic view.
971///
972///
973/// Please read more about the @ref DiffNode "IR" of the comparison
974/// engine to learn more about this.
975///
976/// This type encapsulates an edit script (a set of insertions and
977/// deletions) for two constructs that are to be diff'ed. The two
978/// constructs are called the "subjects" of the diff.
980{
981 friend class diff_context;
982
983 // Forbidden
984 diff();
985
986protected:
987 struct priv;
988 std::unique_ptr<priv> priv_;
989
992
995 diff_context_sptr ctxt);
996
997 bool
998 do_log() const;
999
1000 void
1001 do_log(bool);
1002
1003 void
1005
1006 void
1008
1009 virtual void
1011
1012 void
1014
1015public:
1017 first_subject() const;
1018
1020 second_subject() const;
1021
1022 const vector<diff*>&
1023 children_nodes() const;
1024
1025 const diff*
1026 parent_node() const;
1027
1028 diff* get_canonical_diff() const;
1029
1030 bool
1031 is_traversing() const;
1032
1033 void
1035
1036 const diff_context_sptr
1037 context() const;
1038
1039 void
1041
1042 bool
1043 currently_reporting() const;
1044
1045 void
1046 currently_reporting(bool f) const;
1047
1048 bool
1049 reported_once() const;
1050
1051 void
1052 reported_once(bool f) const;
1053
1055 get_category() const;
1056
1058 get_local_category() const;
1059
1062
1065
1068
1069 void
1071
1074
1077
1078 void
1080
1081 void
1083
1084 bool
1085 is_filtered_out() const;
1086
1087 bool
1089
1090 bool
1092
1093 bool
1094 is_suppressed() const;
1095
1096 bool
1097 is_suppressed(bool &is_private_type) const;
1098
1099 bool
1101
1102 bool
1103 to_be_reported() const;
1104
1105 bool
1107
1108 bool
1110
1111 bool
1113
1114 bool
1116
1117 virtual const string&
1119
1120 /// This constructs the relation between this diff node and its
1121 /// detail diff nodes, in the generic view of the diff node.
1122 ///
1123 /// Each specific typed diff node should implement how the typed
1124 /// view "links" itself to its detail nodes in the generic sense.
1125 virtual void
1127
1128 /// Pure interface to get the length of the changes encapsulated by
1129 /// this diff. A length of zero means that the current instance of
1130 /// @ref diff doesn't carry any change.
1131 ///
1132 /// This is to be implemented by all descendants of this type.
1133 virtual bool
1134 has_changes() const = 0;
1135
1136 /// Pure interface to know if the current instance of @diff carries
1137 /// a local change. A local change is a change that is on the @ref
1138 /// diff object itself, as opposed to a change that is carried by
1139 /// some of its children nodes.
1140 ///
1141 /// This is to be implemented by all descendants of this type.
1142 virtual enum change_kind
1144
1145 /// Pure interface to report the diff in a serialized form that is
1146 /// legible for the user.
1147 ///
1148 /// Note that the serializd report has to leave one empty line at
1149 /// the end of its content.
1150 ///
1151 /// @param out the output stream to serialize the report to.
1152 ///
1153 /// @param indent the indentation string to use.
1154 virtual void
1155 report(ostream& out, const string& indent = "") const = 0;
1156
1157 virtual bool
1159};// end class diff
1160
1162compute_diff(const decl_base_sptr,
1163 const decl_base_sptr,
1164 diff_context_sptr ctxt);
1165
1167compute_diff(const type_base_sptr,
1168 const type_base_sptr,
1169 diff_context_sptr ctxt);
1170
1171/// The base class of diff between types.
1172class type_diff_base : public diff
1173{
1174 struct priv;
1175 std::unique_ptr<priv> priv_;
1176
1178
1179protected:
1180 type_diff_base(type_base_sptr first_subject,
1181 type_base_sptr second_subject,
1182 diff_context_sptr ctxt);
1183
1184public:
1185
1186 virtual enum change_kind
1188
1189 virtual ~type_diff_base();
1190};// end class type_diff_base
1191
1192/// The base class of diff between decls.
1193class decl_diff_base : public diff
1194{
1195 struct priv;
1196 std::unique_ptr<priv> priv_;
1197
1198protected:
1199 decl_diff_base(decl_base_sptr first_subject,
1200 decl_base_sptr second_subject,
1201 diff_context_sptr ctxt);
1202
1203public:
1204
1205 virtual enum change_kind
1207
1208 virtual ~decl_diff_base();
1209};// end class decl_diff_base
1210
1211string
1213
1214class distinct_diff;
1215
1216/// Convenience typedef for a shared pointer to distinct_types_diff
1217typedef shared_ptr<distinct_diff> distinct_diff_sptr;
1218
1219/// An abstraction of a diff between entities that are of a different
1220/// kind (disctinct).
1221class distinct_diff : public diff
1222{
1223 struct priv;
1224 std::unique_ptr<priv> priv_;
1225
1226protected:
1230
1231public:
1232
1234 first() const;
1235
1237 second() const;
1238
1239 const diff_sptr
1240 compatible_child_diff() const;
1241
1242 virtual const string&
1244
1245 virtual bool
1246 has_changes() const;
1247
1248 virtual enum change_kind
1249 has_local_changes() const;
1250
1251 virtual void
1252 report(ostream& out, const string& indent = "") const;
1253
1254 virtual void
1256
1257 static bool
1260
1261 friend distinct_diff_sptr
1264 diff_context_sptr ctxt);
1265};// end class distinct_types_diff
1266
1270 diff_context_sptr ctxt);
1271
1272/// Abstracts a diff between two instances of @ref var_decl
1274{
1275 struct priv;
1276 std::unique_ptr<priv> priv_;
1277
1278protected:
1279 var_diff(var_decl_sptr first,
1280 var_decl_sptr second,
1283
1284public:
1286 first_var() const;
1287
1289 second_var() const;
1290
1291 diff_sptr
1292 type_diff() const;
1293
1294 virtual void
1296
1297 virtual bool
1298 has_changes() const;
1299
1300 virtual enum change_kind
1301 has_local_changes() const;
1302
1303 virtual void
1304 report(ostream& out, const string& indent = "") const;
1305
1306 virtual const string&
1308
1309 friend var_diff_sptr
1310 compute_diff(const var_decl_sptr first,
1311 const var_decl_sptr second,
1312 diff_context_sptr ctxt);
1313};// end class var_diff
1314
1317
1318class pointer_diff;
1319/// Convenience typedef for a shared pointer on a @ref
1320/// pointer_diff type.
1321typedef shared_ptr<pointer_diff> pointer_diff_sptr;
1322
1323/// The abstraction of a diff between two pointers.
1325{
1326 struct priv;
1327 std::unique_ptr<priv> priv_;
1328
1329protected:
1331 pointer_type_def_sptr second,
1334
1335public:
1337 first_pointer() const;
1338
1340 second_pointer() const;
1341
1342 diff_sptr
1343 underlying_type_diff() const;
1344
1345 void
1347
1348 virtual const string&
1350
1351 virtual bool
1352 has_changes() const;
1353
1354 virtual enum change_kind
1355 has_local_changes() const;
1356
1357 virtual void
1358 report(ostream&, const string& indent = "") const;
1359
1360 virtual void
1362
1363 friend pointer_diff_sptr
1365 pointer_type_def_sptr second,
1366 diff_context_sptr ctxt);
1367};// end class pointer_diff
1368
1371 pointer_type_def_sptr second,
1372 diff_context_sptr ctxt);
1373
1374class reference_diff;
1375
1376/// Convenience typedef for a shared pointer on a @ref
1377/// reference_diff type.
1378typedef shared_ptr<reference_diff> reference_diff_sptr;
1379
1380/// The abstraction of a diff between two references.
1382{
1383 struct priv;
1384 std::unique_ptr<priv> priv_;
1385
1386protected:
1388 const reference_type_def_sptr second,
1389 diff_sptr underlying,
1391
1392public:
1394 first_reference() const;
1395
1397 second_reference() const;
1398
1399 const diff_sptr&
1400 underlying_type_diff() const;
1401
1402 diff_sptr&
1404
1405 virtual const string&
1407
1408 virtual bool
1409 has_changes() const;
1410
1411 virtual enum change_kind
1412 has_local_changes() const;
1413
1414 virtual void
1415 report(ostream&, const string& indent = "") const;
1416
1417 virtual void
1419
1420 friend reference_diff_sptr
1423 diff_context_sptr ctxt);
1424};// end class reference_diff
1425
1429 diff_context_sptr ctxt);
1430
1431
1432class ptr_to_mbr_diff;
1433
1434/// Typedef of a shared_ptr to @ref ptr_to_mbr_diff
1435typedef shared_ptr<ptr_to_mbr_diff> ptr_to_mbr_diff_sptr;
1436
1437/// The abstraction of a diff between two @ref ptr_to_mbr_type.
1439{
1440 struct priv;
1441 std::unique_ptr<priv> priv_;
1442
1443 ptr_to_mbr_diff() = default;
1444
1445protected:
1447 const ptr_to_mbr_type_sptr& second,
1450 diff_context_sptr ctxt);
1451
1452public:
1453
1455 first_ptr_to_mbr_type() const;
1456
1458 second_ptr_to_mbr_type() const;
1459
1460 const diff_sptr
1461 member_type_diff() const;
1462
1463 const diff_sptr
1464 containing_type_diff() const;
1465
1466 virtual bool
1467 has_changes() const;
1468
1469 virtual enum change_kind
1470 has_local_changes() const;
1471
1472 virtual const string&
1474
1475 virtual void
1476 report(ostream&, const string& indent = "") const;
1477
1478 virtual void
1480
1481 virtual ~ptr_to_mbr_diff();
1482
1485 const ptr_to_mbr_type_sptr& second,
1486 diff_context_sptr& ctxt);
1487}; // end class ptr_to_mbr_diff
1488
1491 const ptr_to_mbr_type_sptr& second,
1492 diff_context_sptr& ctxt);
1493
1494class subrange_diff;
1495
1496/// A convenience typedef for a shared pointer to subrange_diff type.
1497typedef shared_ptr<subrange_diff> subrange_diff_sptr;
1498
1499/// The abstraction of the diff between two subrange types.
1501{
1502 struct priv;
1503 std::unique_ptr<priv> priv_;
1504
1505protected:
1507 const array_type_def::subrange_sptr& second,
1509 const diff_context_sptr ctxt = diff_context_sptr());
1510
1511public:
1513 first_subrange() const;
1514
1516 second_subrange() const;
1517
1518 const diff_sptr
1519 underlying_type_diff() const;
1520
1521 virtual const string&
1523
1524 virtual bool
1525 has_changes() const;
1526
1527 virtual enum change_kind
1528 has_local_changes() const;
1529
1530 virtual void
1531 report(ostream&, const string& indent = "") const;
1532
1533 virtual void
1535
1536 friend subrange_diff_sptr
1539 diff_context_sptr ctxt);
1540}; // end subrange_diff
1541
1545 diff_context_sptr ctxt);
1546
1547
1548class array_diff;
1549
1550/// Convenience typedef for a shared pointer on a @ref
1551/// array_diff type.
1552typedef shared_ptr<array_diff> array_diff_sptr;
1553
1554/// The abstraction of a diff between two arrays.
1556{
1557 struct priv;
1558 std::unique_ptr<priv> priv_;
1559
1560protected:
1561 array_diff(const array_type_def_sptr first,
1562 const array_type_def_sptr second,
1564 vector<subrange_diff_sptr>& subrange_diffs,
1566
1567public:
1569 first_array() const;
1570
1572 second_array() const;
1573
1574 const diff_sptr&
1575 element_type_diff() const;
1576
1577 const vector<subrange_diff_sptr>&
1578 subrange_diffs() const;
1579
1580 void
1582
1583 void
1584 subrange_diffs(const vector<subrange_diff_sptr>&);
1585
1586 bool
1588
1589 virtual const string&
1591
1592 virtual bool
1593 has_changes() const;
1594
1595 virtual enum change_kind
1596 has_local_changes() const;
1597
1598 virtual void
1599 report(ostream&, const string& indent = "") const;
1600
1601 virtual void
1603
1604 friend array_diff_sptr
1606 array_type_def_sptr second,
1607 diff_context_sptr ctxt);
1608};// end class array_diff
1609
1612 array_type_def_sptr second,
1613 diff_context_sptr ctxt);
1614
1616typedef class shared_ptr<qualified_type_diff> qualified_type_diff_sptr;
1617
1618/// Abstraction of a diff between two qualified types.
1620{
1621 struct priv;
1622 std::unique_ptr<priv> priv_;
1623
1624protected:
1625 qualified_type_diff(qualified_type_def_sptr first,
1626 qualified_type_def_sptr second,
1627 diff_sptr underling,
1629
1630public:
1631 const qualified_type_def_sptr
1632 first_qualified_type() const;
1633
1634 const qualified_type_def_sptr
1635 second_qualified_type() const;
1636
1637 diff_sptr
1638 underlying_type_diff() const;
1639
1640 void
1642
1643 diff_sptr
1645
1646 virtual const string&
1648
1649 virtual bool
1650 has_changes() const;
1651
1652 virtual enum change_kind
1653 has_local_changes() const;
1654
1655 virtual void
1656 report(ostream&, const string& indent = "") const;
1657
1658 virtual void
1660
1661 friend qualified_type_diff_sptr
1662 compute_diff(const qualified_type_def_sptr first,
1663 const qualified_type_def_sptr second,
1664 diff_context_sptr ctxt);
1665};// end class qualified_type_diff.
1666
1667qualified_type_diff_sptr
1668compute_diff(const qualified_type_def_sptr first,
1669 const qualified_type_def_sptr second,
1670 diff_context_sptr ctxt);
1671
1672class enum_diff;
1673typedef shared_ptr<enum_diff> enum_diff_sptr;
1674
1675/// Abstraction of a diff between two enums.
1677{
1678 struct priv;
1679 std::unique_ptr<priv> priv_;
1680
1681 void
1682 clear_lookup_tables();
1683
1684 bool
1685 lookup_tables_empty() const;
1686
1687 void
1688 ensure_lookup_tables_populated();
1689
1690protected:
1692 const enum_type_decl_sptr,
1693 const diff_sptr,
1695
1696public:
1698 first_enum() const;
1699
1701 second_enum() const;
1702
1703 diff_sptr
1704 underlying_type_diff() const;
1705
1707 deleted_enumerators() const;
1708
1710 inserted_enumerators() const;
1711
1713 changed_enumerators() const;
1714
1715 virtual const string&
1717
1718 virtual bool
1719 has_changes() const;
1720
1721 virtual enum change_kind
1722 has_local_changes() const;
1723
1724 virtual void
1725 report(ostream&, const string& indent = "") const;
1726
1727 virtual void
1729
1730 friend enum_diff_sptr
1732 const enum_type_decl_sptr second,
1733 diff_context_sptr ctxt);
1734};//end class enum_diff;
1735
1736enum_diff_sptr
1738 const enum_type_decl_sptr,
1740
1741/// This is the base class of @ref class_diff and @ref union_diff.
1743{
1744protected:
1745 struct priv;
1746 typedef std::unique_ptr<priv> priv_ptr;
1747 priv_ptr priv_;
1748
1749 void
1750 clear_lookup_tables(void);
1751
1752 bool
1753 lookup_tables_empty(void) const;
1754
1755 void
1757
1758 void
1760
1761protected:
1762 class_or_union_diff(class_or_union_sptr first_scope,
1763 class_or_union_sptr second_scope,
1765
1766public:
1767
1768 const class_or_union_diff::priv_ptr&
1769 get_priv() const;
1770
1771 //TODO: add change of the name of the type.
1772
1773 virtual ~class_or_union_diff();
1774
1775 class_or_union_sptr
1776 first_class_or_union() const;
1777
1778 class_or_union_sptr
1779 second_class_or_union() const;
1780
1781 const edit_script&
1782 member_types_changes() const;
1783
1786
1787 const edit_script&
1788 data_members_changes() const;
1789
1792
1794 inserted_data_members() const;
1795
1797 deleted_data_members() const;
1798
1800 changed_data_members() const;
1801
1802 const var_diff_sptrs_type&
1804
1805 const edit_script&
1806 member_fns_changes() const;
1807
1810
1812 changed_member_fns() const;
1813
1815 deleted_member_fns() const;
1816
1818 inserted_member_fns() const;
1819
1820 size_t
1821 count_filtered_changed_data_members(bool local_only = false) const;
1822
1823 const var_diff_sptrs_type&
1825
1826 size_t
1827 count_filtered_subtype_changed_data_members(bool local_only = false) const;
1828
1831
1834
1835 const edit_script&
1837
1840
1841 const edit_script&
1843
1846
1847 virtual bool
1848 has_changes() const;
1849
1850 virtual enum change_kind
1851 has_local_changes() const;
1852
1853 virtual void
1854 report(ostream&, const string& indent = "") const;
1855
1856 virtual void
1858
1859 friend class default_reporter;
1860}; // end class_or_union_diff;
1861
1862/// This type abstracts changes for a class_decl.
1864{
1865 struct priv;
1866 typedef std::unique_ptr<priv> priv_ptr;
1867 priv_ptr priv_;
1868
1869 const priv_ptr& get_priv()const;
1870
1871 void
1872 clear_lookup_tables(void);
1873
1874 bool
1875 lookup_tables_empty(void) const;
1876
1877 void
1878 ensure_lookup_tables_populated(void) const;
1879
1880 void
1881 allocate_priv_data();
1882
1883protected:
1884 class_diff(class_decl_sptr first_scope,
1885 class_decl_sptr second_scope,
1887
1888public:
1889 //TODO: add change of the name of the type.
1890
1891 virtual ~class_diff();
1892
1894 first_class_decl() const;
1895
1897 second_class_decl() const;
1898
1899 const edit_script&
1900 base_changes() const;
1901
1903 base_changes();
1904
1906 deleted_bases() const;
1907
1909 inserted_bases() const;
1910
1912 changed_bases();
1913
1914 const vector<class_decl::base_spec_sptr>&
1915 moved_bases() const;
1916
1917 virtual bool
1918 has_changes() const;
1919
1920 virtual enum change_kind
1921 has_local_changes() const;
1922
1923 virtual const string&
1925
1926 virtual void
1927 report(ostream&, const string& indent = "") const;
1928
1929 virtual void
1931
1932 friend class_diff_sptr
1933 compute_diff(const class_decl_sptr first,
1934 const class_decl_sptr second,
1935 diff_context_sptr ctxt);
1936
1937 friend class default_reporter;
1938};// end class_diff
1939
1941compute_diff(const class_decl_sptr first,
1942 const class_decl_sptr second,
1943 diff_context_sptr ctxt);
1944
1945class union_diff;
1946typedef shared_ptr<union_diff> union_diff_sptr;
1947
1949{
1950 void
1951 clear_lookup_tables(void);
1952
1953 bool
1954 lookup_tables_empty(void) const;
1955
1956 void
1957 ensure_lookup_tables_populated(void) const;
1958
1959 void
1960 allocate_priv_data();
1961
1962protected:
1963 union_diff(union_decl_sptr first_union,
1964 union_decl_sptr second_union,
1966
1967public:
1968
1969 virtual ~union_diff();
1970
1971 union_decl_sptr
1972 first_union_decl() const;
1973
1974 union_decl_sptr
1975 second_union_decl() const;
1976
1977 virtual const string&
1979
1980 virtual void
1981 report(ostream&, const string& indent = "") const;
1982
1983 friend union_diff_sptr
1984 compute_diff(const union_decl_sptr first,
1985 const union_decl_sptr second,
1986 diff_context_sptr ctxt);
1987}; // end class union_diff
1988
1989union_diff_sptr
1990compute_diff(const union_decl_sptr first,
1991 const union_decl_sptr second,
1992 diff_context_sptr ctxt);
1993
1994/// An abstraction of a diff between two instances of class_decl::base_spec.
1995class base_diff : public diff
1996{
1997 struct priv;
1998 std::unique_ptr<priv> priv_;
1999
2000protected:
2003 class_diff_sptr underlying,
2005
2006public:
2008 first_base() const;
2009
2011 second_base() const;
2012
2013 const class_diff_sptr
2015
2016 void
2018
2019 virtual const string&
2021
2022 virtual bool
2023 has_changes() const;
2024
2025 virtual enum change_kind
2026 has_local_changes() const;
2027
2028 virtual void
2029 report(ostream&, const string& indent = "") const;
2030
2031 virtual void
2033
2034 friend base_diff_sptr
2036 const class_decl::base_spec_sptr second,
2037 diff_context_sptr ctxt);
2038};// end class base_diff
2039
2042 const class_decl::base_spec_sptr second,
2043 diff_context_sptr ctxt);
2044
2045class scope_diff;
2046
2047/// Convenience typedef for a shared pointer on a @ref scope_diff.
2048typedef shared_ptr<scope_diff> scope_diff_sptr;
2049
2050/// An abstractions of the changes between two scopes.
2051class scope_diff : public diff
2052{
2053 struct priv;
2054 std::unique_ptr<priv> priv_;
2055
2056 bool
2057 lookup_tables_empty() const;
2058
2059 void
2060 clear_lookup_tables();
2061
2062 void
2063 ensure_lookup_tables_populated();
2064
2065protected:
2069
2070public:
2071
2072 friend scope_diff_sptr
2073 compute_diff(const scope_decl_sptr first,
2074 const scope_decl_sptr second,
2076 diff_context_sptr ctxt);
2077
2078 friend scope_diff_sptr
2081 diff_context_sptr ctxt);
2082
2083 const scope_decl_sptr
2084 first_scope() const;
2085
2086 const scope_decl_sptr
2087 second_scope() const;
2088
2089 const edit_script&
2090 member_changes() const;
2091
2094
2095 const decl_base_sptr
2096 deleted_member_at(unsigned index) const;
2097
2098 const decl_base_sptr
2099 deleted_member_at(vector<deletion>::const_iterator) const;
2100
2101 const decl_base_sptr
2102 inserted_member_at(unsigned i);
2103
2104 const decl_base_sptr
2105 inserted_member_at(vector<unsigned>::const_iterator i);
2106
2107 const diff_sptrs_type&
2108 changed_types() const;
2109
2110 const diff_sptrs_type&
2111 changed_decls() const;
2112
2114 removed_types() const;
2115
2117 removed_decls() const;
2118
2120 added_types() const;
2121
2123 added_decls() const;
2124
2125 virtual const string&
2127
2128 virtual bool
2129 has_changes() const;
2130
2131 virtual enum change_kind
2132 has_local_changes() const;
2133
2134 virtual void
2135 report(ostream& out, const string& indent = "") const;
2136
2137 virtual void
2139
2140 friend class default_reporter;
2141 friend class leaf_reporter;
2142};// end class scope_diff
2143
2145compute_diff(const scope_decl_sptr first,
2146 const scope_decl_sptr second,
2148 diff_context_sptr ctxt);
2149
2151compute_diff(const scope_decl_sptr first_scope,
2152 const scope_decl_sptr second_scope,
2153 diff_context_sptr ctxt);
2154
2155/// Abstraction of a diff between two function parameters.
2157{
2158 struct priv;
2159 std::unique_ptr<priv> priv_;
2160
2162 const function_decl::parameter_sptr second,
2163 diff_context_sptr ctxt);
2164
2165public:
2166 friend fn_parm_diff_sptr
2168 const function_decl::parameter_sptr second,
2169 diff_context_sptr ctxt);
2170
2172 first_parameter() const;
2173
2175 second_parameter() const;
2176
2177 diff_sptr
2178 type_diff() const;
2179
2180 virtual const string&
2182
2183 virtual bool
2184 has_changes() const;
2185
2186 virtual enum change_kind
2187 has_local_changes() const;
2188
2189 virtual void
2190 report(ostream&, const string& indent = "") const;
2191
2192 virtual void
2194}; // end class fn_parm_diff
2195
2198 const function_decl::parameter_sptr second,
2199 diff_context_sptr ctxt);
2200
2201class function_type_diff;
2202
2203/// A convenience typedef for a shared pointer to @ref
2204/// function_type_type_diff
2205typedef shared_ptr<function_type_diff> function_type_diff_sptr;
2206
2207/// Abstraction of a diff between two function types.
2209{
2210 struct priv;
2211 std::unique_ptr<priv> priv_;
2212
2213 void
2214 ensure_lookup_tables_populated();
2215
2217 deleted_parameter_at(int i) const;
2218
2220 inserted_parameter_at(int i) const;
2221
2222protected:
2224 const function_type_sptr second,
2225 diff_context_sptr ctxt);
2226
2227public:
2229 compute_diff(const function_type_sptr first,
2230 const function_type_sptr second,
2231 diff_context_sptr ctxt);
2232
2233 const function_type_sptr
2234 first_function_type() const;
2235
2236 const function_type_sptr
2237 second_function_type() const;
2238
2239 const diff_sptr
2240 return_type_diff() const;
2241
2243 subtype_changed_parms() const;
2244
2245 const string_parm_map&
2246 removed_parms() const;
2247
2248 const string_parm_map&
2249 added_parms() const;
2250
2251 const vector<function_decl::parameter_sptr>&
2252 sorted_deleted_parms() const;
2253
2254 const vector<function_decl::parameter_sptr>&
2255 sorted_added_parms() const;
2256
2257 virtual const string&
2259
2260 virtual bool
2261 has_changes() const;
2262
2263 virtual enum change_kind
2264 has_local_changes() const;
2265
2266 virtual void
2267 report(ostream&, const string& indent = "") const;
2268
2269 virtual void
2271
2272 friend class default_reporter;
2273 friend class leaf_reporter;
2274};// end class function_type_diff
2275
2278 const function_type_sptr second,
2279 diff_context_sptr ctxt);
2280
2281/// Abstraction of a diff between two function_decl.
2283{
2284 struct priv;
2285 std::unique_ptr<priv> priv_;
2286
2287 void
2288 ensure_lookup_tables_populated();
2289
2290
2291protected:
2293 const function_decl_sptr second,
2294 diff_context_sptr ctxt);
2295
2296public:
2297
2300 const function_decl_sptr second,
2301 diff_context_sptr ctxt);
2302
2303 const function_decl_sptr
2304 first_function_decl() const;
2305
2306 const function_decl_sptr
2307 second_function_decl() const;
2308
2310 type_diff() const;
2311
2312 virtual const string&
2314
2315 virtual bool
2316 has_changes() const;
2317
2318 virtual enum change_kind
2319 has_local_changes() const;
2320
2321 virtual void
2322 report(ostream&, const string& indent = "") const;
2323
2324 virtual void
2326}; // end class function_decl_diff
2327
2330 const function_decl_sptr second,
2331 diff_context_sptr ctxt);
2332
2333class type_decl_diff;
2334
2335/// Convenience typedef for a shared pointer on a @ref type_decl_diff type.
2336typedef shared_ptr<type_decl_diff> type_decl_diff_sptr;
2337
2338/// Abstraction of a diff between two basic type declarations.
2340{
2342
2343protected:
2344 type_decl_diff(const type_decl_sptr first,
2345 const type_decl_sptr second,
2347
2348public:
2349 friend type_decl_diff_sptr
2350 compute_diff(const type_decl_sptr first,
2351 const type_decl_sptr second,
2352 diff_context_sptr ctxt);
2353
2354 const type_decl_sptr
2355 first_type_decl() const;
2356
2357 const type_decl_sptr
2358 second_type_decl() const;
2359
2360 virtual const string&
2362
2363 virtual bool
2364 has_changes() const;
2365
2366 virtual enum change_kind
2367 has_local_changes() const;
2368
2369 virtual void
2370 report(ostream& out, const string& indent = "") const;
2371};// end type_decl_diff
2372
2375 const type_decl_sptr,
2377
2378class typedef_diff;
2379
2380/// Convenience typedef for a shared pointer on a typedef_diff type.
2381typedef shared_ptr<typedef_diff> typedef_diff_sptr;
2382
2383/// Abstraction of a diff between two typedef_decl.
2385{
2386 struct priv;
2387 std::unique_ptr<priv> priv_;
2388
2389 typedef_diff();
2390
2391protected:
2392 typedef_diff(const typedef_decl_sptr first,
2393 const typedef_decl_sptr second,
2396
2397public:
2398 friend typedef_diff_sptr
2399 compute_diff(const typedef_decl_sptr first,
2400 const typedef_decl_sptr second,
2401 diff_context_sptr ctxt);
2402
2403 const typedef_decl_sptr
2404 first_typedef_decl() const;
2405
2406 const typedef_decl_sptr
2407 second_typedef_decl() const;
2408
2409 const diff_sptr
2410 underlying_type_diff() const;
2411
2412 void
2414
2415 virtual const string&
2417
2418 virtual bool
2419 has_changes() const;
2420
2421 virtual enum change_kind
2422 has_local_changes() const;
2423
2424 virtual void
2425 report(ostream&, const string& indent = "") const;
2426
2427 virtual void
2429};// end class typedef_diff
2430
2433 const typedef_decl_sptr,
2434 diff_context_sptr ctxt);
2435
2436const diff*
2438
2440
2441/// Convenience typedef for a shared pointer on a
2442/// @ref translation_unit_diff type.
2443typedef shared_ptr<translation_unit_diff> translation_unit_diff_sptr;
2444
2445/// An abstraction of a diff between two translation units.
2447{
2448 struct priv;
2449 std::unique_ptr<priv> priv_;
2450
2451protected:
2453 translation_unit_sptr second,
2455
2456public:
2457
2459 first_translation_unit() const;
2460
2463
2466 const translation_unit_sptr second,
2467 diff_context_sptr ctxt);
2468
2469 virtual bool
2470 has_changes() const;
2471
2472 virtual enum change_kind
2473 has_local_changes() const;
2474
2475 virtual void
2476 report(ostream& out, const string& indent = "") const;
2477};//end class translation_unit_diff
2478
2481 const translation_unit_sptr second,
2483
2484/// An abstraction of a diff between between two abi corpus.
2486{
2487 struct priv;
2488 std::unique_ptr<priv> priv_;
2489
2490protected:
2491 corpus_diff(corpus_sptr first,
2492 corpus_sptr second,
2494
2495 void
2497
2498public:
2499
2500 class diff_stats;
2501
2502 virtual ~corpus_diff();
2503
2504 /// A convenience typedef for a shared pointer to @ref diff_stats
2505 typedef shared_ptr<diff_stats> diff_stats_sptr;
2506
2507 bool
2508 do_log() const;
2509
2510 void
2511 do_log(bool);
2512
2513 corpus_sptr
2514 first_corpus() const;
2515
2516 corpus_sptr
2517 second_corpus() const;
2518
2519 const vector<diff*>&
2520 children_nodes() const;
2521
2522 void
2524
2526 function_changes() const;
2527
2529 variable_changes() const;
2530
2531 bool
2532 soname_changed() const;
2533
2534 bool
2535 architecture_changed() const;
2536
2538 deleted_functions() const;
2539
2542
2544 changed_functions() const;
2545
2548
2551
2554
2555 const string_var_ptr_map&
2556 deleted_variables() const;
2557
2558 const string_var_ptr_map&
2559 added_variables() const;
2560
2563
2564 const var_diff_sptrs_type&
2566
2567 const var_diff_sptrs_type&
2569
2572
2575
2578
2581
2584
2587
2588 const vector<type_base_sptr>&
2590
2593
2594 const vector<type_base_sptr>&
2596
2599
2600 const vector<diff_sptr>&
2602
2603 const diff_context_sptr
2604 context() const;
2605
2606 const string&
2608
2609 bool
2610 has_changes() const;
2611
2612 bool
2614
2615 bool
2617
2618 bool
2619 has_net_changes() const;
2620
2621 const diff_stats&
2623
2624 void
2626
2627 diff_maps&
2629
2630 const diff_maps&
2631 get_leaf_diffs() const;
2632
2633 virtual void
2634 report(ostream& out, const string& indent = "") const;
2635
2636 virtual bool
2638
2639 virtual void
2641
2642 friend corpus_diff_sptr
2643 compute_diff(const corpus_sptr f,
2644 const corpus_sptr s,
2645 diff_context_sptr ctxt);
2646
2647 friend void
2648 apply_suppressions(const corpus_diff* diff_tree);
2649
2650 friend void
2652 const corpus_diff::diff_stats &s,
2653 const string& indent,
2654 ostream& out);
2655
2656 friend class default_reporter;
2657 friend class leaf_reporter;
2658}; // end class corpus_diff
2659
2661compute_diff(const corpus_sptr,
2662 const corpus_sptr,
2664
2666compute_diff(const corpus_group_sptr&,
2667 const corpus_group_sptr&,
2668 diff_context_sptr ctxt);
2669
2670/// This is a document class that aims to capture statistics about the
2671/// changes carried by a @ref corpus_diff type.
2672///
2673/// Its values are populated by the member function
2674/// corpus_diff::apply_filters_and_suppressions_before_reporting()
2676{
2677 struct priv;
2678 std::unique_ptr<priv> priv_;
2679
2680 diff_stats();
2681
2682public:
2683
2685
2686 size_t num_func_removed() const;
2687 void num_func_removed(size_t);
2688
2689 size_t num_removed_func_filtered_out() const;
2690 void num_removed_func_filtered_out(size_t);
2691
2692 size_t net_num_func_removed() const;
2693
2694 size_t num_func_added() const;
2695 void num_func_added(size_t);
2696
2697 size_t num_added_func_filtered_out() const;
2698 void num_added_func_filtered_out(size_t);
2699
2700 size_t net_num_func_added() const;
2701
2702 size_t num_func_changed() const;
2703 void num_func_changed(size_t);
2704
2705 size_t num_changed_func_filtered_out() const;
2706 void num_changed_func_filtered_out(size_t);
2707
2710
2713
2716
2719
2720 size_t num_var_with_incompatible_changes() const;
2722
2723 size_t net_num_func_changed() const;
2724
2726
2727 size_t num_vars_removed() const;
2728 void num_vars_removed(size_t);
2729
2730 size_t num_removed_vars_filtered_out() const;
2731 void num_removed_vars_filtered_out(size_t) const;
2732
2733 size_t net_num_vars_removed() const;
2734
2735 size_t num_vars_added() const;
2736 void num_vars_added(size_t);
2737
2738 size_t num_added_vars_filtered_out() const;
2739 void num_added_vars_filtered_out(size_t);
2740
2741 size_t net_num_vars_added() const;
2742
2743 size_t num_vars_changed() const;
2744 void num_vars_changed(size_t);
2745
2746 size_t num_changed_vars_filtered_out() const;
2747 void num_changed_vars_filtered_out(size_t);
2748
2749 size_t net_num_vars_changed() const;
2750
2752
2753 size_t num_func_syms_removed() const;
2754 void num_func_syms_removed(size_t);
2755
2758
2759 size_t num_func_syms_added() const;
2760 void num_func_syms_added(size_t);
2761
2762 size_t num_added_func_syms_filtered_out() const;
2764
2765 size_t net_num_removed_func_syms() const;
2766 size_t net_num_added_func_syms() const;
2767
2768 size_t num_var_syms_removed() const;
2769 void num_var_syms_removed(size_t);
2770
2771 size_t num_removed_var_syms_filtered_out() const;
2773
2774 size_t num_var_syms_added() const;
2775 void num_var_syms_added(size_t);
2776
2777 size_t num_added_var_syms_filtered_out() const;
2779
2780 size_t net_num_removed_var_syms() const;
2781 size_t net_num_added_var_syms() const;
2782
2783 size_t num_leaf_changes() const;
2784 void num_leaf_changes(size_t);
2785
2786 size_t num_leaf_changes_filtered_out() const;
2787 void num_leaf_changes_filtered_out(size_t);
2788
2789 size_t net_num_leaf_changes() const;
2790
2791 size_t num_leaf_type_changes() const;
2792 void num_leaf_type_changes(size_t);
2793
2796 size_t net_num_leaf_type_changes() const;
2797
2798 size_t num_leaf_func_changes() const;
2799 void num_leaf_func_changes(size_t);
2800
2803 size_t net_num_leaf_func_changes() const;
2804
2805 size_t num_leaf_var_changes() const;
2806 void num_leaf_var_changes(size_t);
2807
2808 size_t num_leaf_var_changes_filtered_out() const;
2810 size_t net_num_leaf_var_changes() const;
2811
2812 size_t num_added_unreachable_types() const;
2813 void num_added_unreachable_types(size_t);
2814
2817 size_t net_num_added_unreachable_types() const;
2818
2819 size_t num_removed_unreachable_types() const;
2820 void num_removed_unreachable_types(size_t);
2821
2824 size_t net_num_removed_unreachable_types() const;
2825
2826 size_t num_changed_unreachable_types() const;
2827 void num_changed_unreachable_types(size_t);
2828
2831 size_t net_num_changed_unreachable_types() const;
2832
2833}; // end class corpus_diff::diff_stats
2834
2835/// The base class for the node visitors. These are the types used to
2836/// visit each node traversed by the diff_traversable_base::traverse() method.
2838{
2839protected:
2840 struct priv;
2841 std::unique_ptr<priv> priv_;
2842
2843public:
2844
2846
2847 virtual ~diff_node_visitor();
2848
2850
2852 get_visiting_kind() const;
2853
2854 void
2856
2857 void
2859
2860 void
2862
2863 diff*
2865
2866 virtual void
2867 visit_begin(diff*);
2868
2869 virtual void
2871
2872 virtual void
2873 visit_end(diff*);
2874
2875 virtual void
2877
2878 virtual bool
2879 visit(diff*, bool);
2880
2881 virtual bool
2882 visit(distinct_diff*, bool);
2883
2884 virtual bool
2885 visit(var_diff*, bool);
2886
2887 virtual bool
2888 visit(pointer_diff*, bool);
2889
2890 virtual bool
2891 visit(reference_diff*, bool);
2892
2893 virtual bool
2894 visit(qualified_type_diff*, bool);
2895
2896 virtual bool
2897 visit(enum_diff*, bool);
2898
2899 virtual bool
2900 visit(class_diff*, bool);
2901
2902 virtual bool
2903 visit(base_diff*, bool);
2904
2905 virtual bool
2906 visit(scope_diff*, bool);
2907
2908 virtual bool
2909 visit(function_decl_diff*, bool);
2910
2911 virtual bool
2912 visit(type_decl_diff*, bool);
2913
2914 virtual bool
2915 visit(typedef_diff*, bool);
2916
2917 virtual bool
2919
2920 virtual bool
2921 visit(corpus_diff*, bool);
2922}; // end struct diff_node_visitor
2923
2924void
2925propagate_categories(diff* diff_tree);
2926
2927void
2929
2930void
2932
2933void
2935
2936void
2937apply_suppressions(diff* diff_tree);
2938
2939void
2940apply_suppressions(const corpus_diff* diff_tree);
2941
2942void
2943apply_suppressions(diff_sptr diff_tree);
2944
2945void
2947
2948void
2949print_diff_tree(diff* diff_tree, std::ostream&);
2950
2951void
2952print_diff_tree(corpus_diff* diff_tree,
2953 std::ostream&);
2954
2955void
2956print_diff_tree(diff_sptr diff_tree,
2957 std::ostream&);
2958
2959void
2961 std::ostream&);
2962
2963void
2965
2966void
2967categorize_redundancy(diff* diff_tree);
2968
2969void
2971
2972void
2974
2975void
2977
2978void
2980
2981void
2983
2984void
2986
2987void
2989
2990void
2992
2993bool
2995
2996bool
2998
2999bool
3001
3002bool
3004
3005const type_diff_base*
3006is_type_diff(const diff* diff);
3007
3008const decl_diff_base*
3009is_decl_diff(const diff* diff);
3010
3011const type_decl_diff*
3013
3014const type_decl_diff*
3015is_diff_of_basic_type(const diff* diff, bool);
3016
3019
3020bool
3022
3023const enum_diff*
3024is_enum_diff(const diff *diff);
3025
3026const class_diff*
3027is_class_diff(const diff* diff);
3028
3029const union_diff*
3030is_union_diff(const diff* diff);
3031
3034
3037
3038const subrange_diff*
3039is_subrange_diff(const diff* diff);
3040
3041const subrange_diff*
3043
3044const array_diff*
3045is_array_diff(const diff* diff);
3046
3047const function_type_diff*
3049
3050const function_type_diff*
3052
3053const typedef_diff*
3054is_typedef_diff(const diff *diff);
3055
3056const var_diff*
3057is_var_diff(const diff* diff);
3058
3059const function_decl_diff*
3061
3062const pointer_diff*
3063is_pointer_diff(const diff* diff);
3064
3065const reference_diff*
3067
3070
3071const fn_parm_diff*
3072is_fn_parm_diff(const diff* diff);
3073
3074const base_diff*
3075is_base_diff(const diff* diff);
3076
3077const distinct_diff*
3078is_distinct_diff(const diff *diff);
3079
3080bool
3082
3083bool
3085
3086const corpus_diff*
3087is_corpus_diff(const diff* diff);
3088
3089const diff*
3090peel_typedef_diff(const diff* dif);
3091
3092const diff*
3093peel_pointer_diff(const diff* dif);
3094
3095const diff*
3096peel_reference_diff(const diff* dif);
3097
3098const diff*
3099peel_qualified_diff(const diff* dif);
3100
3101const diff*
3102peel_fn_parm_diff(const diff* dif);
3103
3104const diff*
3106
3107const diff*
3109
3110const diff*
3112}// end namespace comparison
3113
3114}// end namespace abigail
3115
3116#endif //__ABG_COMPARISON_H__
This file declares types and operations implementing the "O(ND) Difference Algorithm" (aka diff2) fro...
The declaration of the reporting types of libabigail's diff engine.
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, vector< subrange_diff_sptr > &subrange_diffs, diff_context_sptr ctxt=diff_context_sptr())
Constructor for array_diff.
bool any_subrange_diff_to_be_reported() const
Test if any subrange diff is to be reported.
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
const vector< subrange_diff_sptr > & subrange_diffs() const
Getter for the diffs between the array subranges.
virtual const string & get_pretty_representation() const
friend array_diff_sptr compute_diff(array_type_def_sptr first, array_type_def_sptr second, diff_context_sptr ctxt)
Compute the diff between two arrays.
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
friend base_diff_sptr compute_diff(const class_decl::base_spec_sptr first, const class_decl::base_spec_sptr second, diff_context_sptr ctxt)
Constructs the diff object representing a diff between two base class specifications.
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 unsigned_var_diff_sptr_map & changed_data_members() const
Getter of the map of data members that got replaced by another data member. The key of the map is the...
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 num_var_with_incompatible_changes() const
Getter for the number of variables with incompatible changes.
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 net_num_non_incompatible_var_changed() const
Getter of the net number of variables with changes that are not incompatible.
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 num_func_with_local_harmful_changes() const
Getter for the number of functions with local harmful changes.
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 num_func_with_incompatible_changes() const
Getter for the number of functions with incompatible changes.
size_t net_num_non_incompatible_func_changed() const
Getter of the net number of functions with changes that are not incompatible.
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 num_var_with_local_harmful_changes() const
Getter for the number of variables with local harmful changes.
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
friend void maybe_report_unreachable_type_changes(const corpus_diff &d, const corpus_diff::diff_stats &s, const string &indent, ostream &out)
Report changes about types that are not reachable from global functions and variables,...
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.
const string_function_decl_diff_sptr_map & changed_functions() const
Getter for the functions which signature didn't change, but which do have some indirect changes in th...
const var_diff_sptrs_type & incompatible_changed_variables() const
Getter of the set of diff nodes representing incompatibly changed global variables.
corpus_diff(corpus_sptr first, corpus_sptr second, diff_context_sptr ctxt=diff_context_sptr())
Constructor for corpus_diff.
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.
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.
const function_decl_diff_sptrs_type & incompatible_changed_functions() const
Getter of the set of diff nodes representing incompatibly changed functions.
shared_ptr< diff_stats > diff_stats_sptr
A convenience typedef for a shared pointer to diff_stats.
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 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 function_decl_diff_sptrs_type & changed_functions_sorted() const
Getter for a sorted vector of functions which signature didn't change, but which do have some indirec...
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.
bool architecture_changed() const
Test if the architecture of the underlying corpus has changed.
The base class of diff between decls.
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...
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.
Definition: abg-reporter.h:159
The context of the diff. This type holds various bits of information that is going to be used through...
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...
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.
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...
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.
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.
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.
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.
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.
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...
The base class for the diff classes that are to be traversed.
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.
virtual void report(ostream &out, const string &indent="") const =0
Pure interface to report the diff in a serialized form that is legible for the user.
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 ...
bool is_categorized_as_suppressed() const
Test if the current diff node has been suppressed by a suppression specification or it has been categ...
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 void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of @distinct_d...
friend 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.
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
friend enum_diff_sptr compute_diff(const enum_type_decl_sptr first, const enum_type_decl_sptr second, diff_context_sptr ctxt)
Compute the set of changes between two instances of enum_type_decl.
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.
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.
friend fn_parm_diff_sptr compute_diff(const function_decl::parameter_sptr first, const function_decl::parameter_sptr second, diff_context_sptr ctxt)
Compute the difference between two function_decl::parameter_sptr; that is, between two function param...
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
friend function_decl_diff_sptr compute_diff(const function_decl_sptr first, const function_decl_sptr second, diff_context_sptr ctxt)
Compute the diff between two function_decl.
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.
Definition: abg-reporter.h:281
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
friend pointer_diff_sptr compute_diff(pointer_type_def_sptr first, pointer_type_def_sptr second, diff_context_sptr ctxt)
Compute the diff between between two pointers.
virtual void report(ostream &, const string &indent="") const
Report the diff in a serialized form.
The abstraction of a diff between two ptr_to_mbr_type.
virtual bool has_changes() const
Test whether the current 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 ptr_to_mbr_...
virtual ~ptr_to_mbr_diff()
Destructor of ptr_to_mbr_diff.
ptr_to_mbr_type_sptr first_ptr_to_mbr_type() const
Getter of the first pointer-to-member subject of the current diff node.
friend ptr_to_mbr_diff_sptr compute_diff(const ptr_to_mbr_type_sptr &first, const ptr_to_mbr_type_sptr &second, diff_context_sptr &ctxt)
Compute the diff between two ptr_to_mbr_type types.
const diff_sptr containing_type_diff() const
Getter of the diff node carrying changes to the containing type of first subject of the current diff ...
const diff_sptr member_type_diff() const
Getter of the diff node carrying changes to the member type of first subject of the current diff node...
ptr_to_mbr_type_sptr second_ptr_to_mbr_type() const
Getter of the second pointer-to-member subject of the current diff node.
virtual enum change_kind has_local_changes() const
Test whether the current diff node carries any local change.
virtual const string & get_pretty_representation() const
Get the pretty representation of the current ptr_to_mbr_diff node.
virtual void report(ostream &, const string &indent="") const
Pure interface to report the diff in a serialized form that is legible for the user.
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...
friend qualified_type_diff_sptr compute_diff(const qualified_type_def_sptr first, const qualified_type_def_sptr second, diff_context_sptr ctxt)
Compute the diff between two qualified types.
diff_sptr leaf_underlying_type_diff() const
Getter for the diff between the most underlying non-qualified types of two qualified types.
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
friend reference_diff_sptr compute_diff(reference_type_def_sptr first, reference_type_def_sptr second, diff_context_sptr ctxt)
Compute the diff between two references.
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.
friend subrange_diff_sptr compute_diff(array_type_def::subrange_sptr first, array_type_def::subrange_sptr second, diff_context_sptr ctxt)
Compute the diff between two instances of 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.
friend translation_unit_diff_sptr compute_diff(const translation_unit_sptr first, const translation_unit_sptr second, diff_context_sptr ctxt)
Compute the diff between two translation_units.
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.
friend type_decl_diff_sptr compute_diff(const type_decl_sptr first, const type_decl_sptr second, diff_context_sptr ctxt)
Compute a diff between two type_decl.
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.
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...
Abstraction of a diff between two typedef_decl.
friend typedef_diff_sptr compute_diff(const typedef_decl_sptr first, const typedef_decl_sptr second, diff_context_sptr ctxt)
Compute 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.
friend union_diff_sptr compute_diff(const union_decl_sptr first, const union_decl_sptr second, diff_context_sptr ctxt)
Compute the difference between two union_decl types.
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.
Definition: abg-ir.h:2566
shared_ptr< base_spec > base_spec_sptr
Convenience typedef.
Definition: abg-ir.h:4193
The abstraction of an enumerator.
Definition: abg-ir.h:2881
shared_ptr< parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
Definition: abg-ir.h:3187
The interface for types which are feeling social and want to be visited during the traversal of a hie...
Definition: abg-traverse.h:39
std::vector< filter_base_sptr > filters
Convenience typedef for a vector of filter_base_sptr.
shared_ptr< filter_base > filter_base_sptr
Convenience typedef for a shared pointer to filter_base.
bool is_harmful_category(diff_category c)
Test if an instance of diff_category (a category bit-field) is harmful or not.
shared_ptr< diff > diff_sptr
Convenience typedef for a shared_ptr for the diff class.
Definition: abg-fwd.h:78
visiting_kind operator~(visiting_kind l)
The overloaded 'bit inversion' operator for visiting_kind.
shared_ptr< type_diff_base > type_diff_base_sptr
Convenience pointer for a shared pointer to a type_diff_base.
std::pair< enum_type_decl::enumerator, enum_type_decl::enumerator > changed_enumerator
Convenience typedef for a changed enumerator. The first element of the pair is the old enumerator and...
vector< type_diff_base_sptr > type_diff_base_sptrs_type
Convenience typedef for a vector of type_diff_base_sptr.
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*.
shared_ptr< decl_diff_base > decl_diff_base_sptr
Convenience typedef for a shared_ptr of decl_diff_base.
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.
@ NON_COMPATIBLE_DISTINCT_CHANGE_CATEGORY
A change between two non-compatible types of different kinds.
@ 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...
@ NON_COMPATIBLE_NAME_CHANGE_CATEGORY
A non-compatible name change between two types.
@ COMPATIBLE_TYPE_CHANGE_CATEGORY
This means the diff node (or at least one of its descendant nodes) carries a change involving two com...
@ TYPE_DECL_ONLY_DEF_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a type that was declaration-only and that is now ...
@ STATIC_DATA_MEMBER_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an addition or removal of a static data member.
@ HARMLESS_UNION_OR_CLASS_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless union or class change.
@ HARMLESS_DECL_NAME_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless declaration name change....
@ 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...
@ 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.
Definition: abg-reporter.h:54
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 subrange_diff * is_anonymous_subrange_diff(const diff *d)
Test if a diff node is a subrange_diff between two anonymous subranges.
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.
unordered_map< unsigned, function_decl::parameter_sptr > unsigned_parm_map
Convenience typedef for a map which key is an integer and which value is a parameter.
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.
unordered_map< string, var_diff_sptr > string_var_diff_ptr_map
Convenience typedef for a map which key is a string and which value is a var_diff_sptr.
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.
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.
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.
void print_category(diff_category c)
Print a given category out to stdout for debuging purposes.
shared_ptr< type_decl_diff > type_decl_diff_sptr
Convenience typedef for a shared pointer on a type_decl_diff type.
unordered_map< string, changed_member_function_sptr > string_changed_member_function_sptr_map
Convenience typedef for a hash map of strings and changed member functions.
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.
Definition: abg-fwd.h:70
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.
shared_ptr< function_decl_diff > function_decl_diff_sptr
Convenience typedef for a shared pointer to a function_decl type.
shared_ptr< ptr_to_mbr_diff > ptr_to_mbr_diff_sptr
Typedef of a shared_ptr to ptr_to_mbr_diff.
const function_decl_diff * is_function_decl_diff(const diff *diff)
Test if a diff node is about differences between functions.
shared_ptr< fn_parm_diff > fn_parm_diff_sptr
Convenience typedef for a shared pointer to a fn_parm_diff type.
vector< decl_diff_base_sptr > decl_diff_base_sptrs_type
Convenience typedef for a vector of decl_diff_base_sptr.
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.
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...
@ DEFAULT_VISITING_KIND
The default enumerator value of this enum. It doesn't have any particular meaning yet.
@ 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.
shared_ptr< diff_traversable_base > diff_traversable_base_sptr
Convenience typedef for shared_ptr on diff_traversable_base.
std::pair< var_decl *, var_decl * > changed_var_ptr
Convenience typedef for a pair of pointer to var_decl representing a var_decl change....
pair< method_decl_sptr, method_decl_sptr > changed_member_function_sptr
Convenience typedef for a pair of class_decl::member_function_sptr representing a changed member func...
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.
unordered_map< string, var_decl_sptr > string_var_ptr_map
Convenience typedef for a map which key is a string and which value is a point to var_decl.
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.
const union_diff * is_union_diff(const diff *diff)
Test if a diff node is a union_diff node.
unordered_map< string, type_diff_base_sptr > string_type_diff_base_sptr_map
Convenience typedef for a map which value is a type_diff_base_sptr. The key of the map is the qualifi...
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.
unordered_map< unsigned, decl_base_sptr > unsigned_decl_base_sptr_map
Convenience typedef for a map which key is an unsigned integer and which value is a decl_base_sptr.
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...
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.
unordered_map< size_t, size_t > pointer_map
Convenience typedef for a map of pointer values. The Key is a pointer value and the value is potentia...
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...
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...
unordered_set< diff_sptr, diff_sptr_hasher > unordered_diff_sptr_set
Convenience typedef for an unoredered set of diff_sptr.
shared_ptr< array_diff > array_diff_sptr
Convenience typedef for a shared pointer on a array_diff type.
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...
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 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.
shared_ptr< function_type_diff > function_type_diff_sptr
A convenience typedef for a shared pointer to function_type_type_diff.
unordered_map< string, decl_diff_base_sptr > string_decl_diff_base_sptr_map
Convenience typedef for a map which value is a decl_diff_base_sptr. The key of the map is the qualifi...
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.
const reference_diff * is_reference_diff(const diff *diff)
Test if a diff node is about differences between two references.
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...
unordered_map< string, const 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.
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.
shared_ptr< reference_type_def > reference_type_def_sptr
Convenience typedef for a shared pointer on a reference_type_def.
Definition: abg-fwd.h:235
shared_ptr< function_decl > function_decl_sptr
Convenience typedef for a shared pointer on a function_decl.
Definition: abg-fwd.h:269
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.
Definition: abg-ir.h:559
change_kind
A bitfield that gives callers of abigail::ir::equals() some insight about how different two internal ...
Definition: abg-ir.h:1361
shared_ptr< array_type_def > array_type_def_sptr
Convenience typedef for a shared pointer on a array_type_def.
Definition: abg-fwd.h:244
shared_ptr< class_decl > class_decl_sptr
Convenience typedef for a shared pointer on a class_decl.
Definition: abg-fwd.h:193
shared_ptr< function_type > function_type_sptr
Convenience typedef for a shared pointer on a function_type.
Definition: abg-fwd.h:210
shared_ptr< typedef_decl > typedef_decl_sptr
Convenience typedef for a shared pointer on a typedef_decl.
Definition: abg-fwd.h:167
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
Definition: abg-fwd.h:256
shared_ptr< ptr_to_mbr_type > ptr_to_mbr_type_sptr
Convenience typedef for a shared pointer to a ptr_to_mbr_type.
Definition: abg-fwd.h:239
shared_ptr< scope_decl > scope_decl_sptr
Convenience typedef for a shared pointer on a scope_decl.
Definition: abg-fwd.h:264
shared_ptr< type_or_decl_base > type_or_decl_base_sptr
A convenience typedef for a shared_ptr to type_or_decl_base.
Definition: abg-fwd.h:120
shared_ptr< translation_unit > translation_unit_sptr
Convenience typedef for a shared pointer on a translation_unit type.
Definition: abg-fwd.h:136
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.
Definition: abg-fwd.h:157
shared_ptr< pointer_type_def > pointer_type_def_sptr
Convenience typedef for a shared pointer on a pointer_type_def.
Definition: abg-fwd.h:226
shared_ptr< enum_type_decl > enum_type_decl_sptr
Convenience typedef for shared pointer to a enum_type_decl.
Definition: abg-fwd.h:175
shared_ptr< type_decl > type_decl_sptr
Convenience typedef for a shared pointer on a type_decl.
Definition: abg-fwd.h:161
vector< suppression_sptr > suppressions_type
Convenience typedef for a vector of suppression_sptr.
Definition: abg-fwd.h:1681
shared_ptr< suppression_base > suppression_sptr
Convenience typedef for a shared pointer to a suppression.
Definition: abg-fwd.h:1678
Toplevel namespace for libabigail.
The type of the private data (pimpl sub-object) of the class_diff type.
The type of private data of class_or_union_diff.
The type of the private data of corpus_diff::diff_stats.
The private member (pimpl) for diff_context.
size_t operator()(const diff_sptr &t) const
The actual hashing functor.
The private data structure for distinct_diff.
The internal type for the impl idiom implementation of pointer_diff.
The private data of the ptr_to_mbr_diff type.
The internal type for the impl idiom implementation of subrange_diff.
The internal type for the impl idiom implementation of var_diff.
The base class for the visitor type hierarchy used for traversing a hierarchy of nodes.
Definition: abg-traverse.h:28