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-2023 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 
22 namespace 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.
29 namespace comparison
30 {
31 
32 namespace filtering
33 {
34 struct filter_base;
35 typedef shared_ptr<filter_base> filter_base_sptr;
36 typedef std::vector<filter_base_sptr> filters;
37 }
38 
39 // Inject types we need into this namespace.
40 using std::ostream;
41 using std::vector;
42 using std::unordered_map;
43 using std::unordered_set;
44 using std::pair;
45 
46 using diff_utils::insertion;
47 using diff_utils::deletion;
48 using 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.
60 typedef vector<diff_sptr> diff_sptrs_type;
61 
62 /// Convenience typedef for a vector of @ref diff*.
63 typedef vector<diff*> diff_ptrs_type;
64 
65 /// Convenience typedef for an unoredered set of @ref diff_sptr
66 typedef unordered_set<diff_sptr, diff_sptr_hasher> unordered_diff_sptr_set;
67 
68 class decl_diff_base;
69 
70 /// Convenience typedef for a shared_ptr of @ref decl_diff_base.
71 typedef shared_ptr<decl_diff_base> decl_diff_base_sptr;
72 
73 /// Convenience typedef for a vector of @ref decl_diff_base_sptr.
74 typedef vector<decl_diff_base_sptr> decl_diff_base_sptrs_type;
75 
76 class type_diff_base;
77 /// Convenience pointer for a shared pointer to a type_diff_base
78 typedef shared_ptr<type_diff_base> type_diff_base_sptr;
79 
80 /// Convenience typedef for a vector of @ref type_diff_base_sptr
81 typedef vector<type_diff_base_sptr> type_diff_base_sptrs_type;
82 
83 class function_decl_diff;
84 
85 /// Convenience typedef for a shared pointer to a @ref function_decl type.
86 typedef shared_ptr<function_decl_diff> function_decl_diff_sptr;
87 
88 /// Convenience typedef for a vector of @ref function_decl_diff_sptr
89 typedef vector<function_decl_diff_sptr> function_decl_diff_sptrs_type;
90 
91 class fn_parm_diff;
92 
93 /// Convenience typedef for a shared pointer to a @ref fn_parm_diff
94 /// type.
95 typedef shared_ptr<fn_parm_diff> fn_parm_diff_sptr;
96 
97 class var_diff;
98 
99 /// Convenience typedef for a shared pointer to a @ref var_diff type.
100 typedef shared_ptr<var_diff> var_diff_sptr;
101 
102 /// Convenience typedef for a vector of @ref var_diff_sptr.
103 typedef vector<var_diff_sptr> var_diff_sptrs_type;
104 
105 class base_diff;
106 
107 /// Convenience typedef for a shared pointer to a @ref base_diff type.
108 typedef shared_ptr<base_diff> base_diff_sptr;
109 
110 /// Convenience typedef for a vector of @ref base_diff_sptr.
111 typedef vector<base_diff_sptr> base_diff_sptrs_type;
112 
113 class class_diff;
114 
115 /// Convenience typedef for a shared pointer on a @ref class_diff type.
116 typedef 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.
121 typedef 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 decl_base_sptr.
125 typedef unordered_map<string, decl_base_sptr> string_decl_base_sptr_map;
126 
127 /// Convenience typedef for a map which key is a string and which
128 /// value is a @ref type_base_sptr.
129 typedef unordered_map<string, type_base_sptr> string_type_base_sptr_map;
130 
131 /// Convenience typedef for a map which key is an unsigned integer and
132 /// which value is a @ref decl_base_sptr
133 typedef unordered_map<unsigned, decl_base_sptr> unsigned_decl_base_sptr_map;
134 
135 /// Convenience typedef for a map of string and class_decl::basse_spec_sptr.
136 typedef unordered_map<string, class_decl::base_spec_sptr> string_base_sptr_map;
137 
138 /// Convenience typedef for a map of string and @ref base_diff_sptr.
139 typedef unordered_map<string, base_diff_sptr> string_base_diff_sptr_map;
140 
141 /// Convenience typedef for a map which value is a changed function
142 /// parameter and which key is the name of the function parameter.
143 typedef unordered_map<string, fn_parm_diff_sptr> string_fn_parm_diff_sptr_map;
144 
145 /// Convenience typedef for a map which key is an integer and which
146 /// value is a changed parameter.
147 typedef unordered_map<unsigned, fn_parm_diff_sptr>
149 
150 /// Convenience typedef for a map which key is an integer and which
151 /// value is a parameter.
152 typedef unordered_map<unsigned,
154 
155 /// Convenience typedef for a map which value is a
156 /// type_diff_base_sptr. The key of the map is the qualified name of
157 /// the changed type.
158 typedef unordered_map<string,
160 
161 /// Convenience typedef for a map which value is a
162 /// decl_diff_base_sptr. The key of the map is the qualified name of
163 /// the changed type.
164 typedef unordered_map<string,
166 
167 /// Convenience typedef for a map which value is a diff_sptr. The key
168 /// of the map is the qualified name of the changed type.
169 typedef unordered_map<string, diff_sptr> string_diff_sptr_map;
170 
171 /// Convenience typedef for a map which value is a diff*. The key of
172 /// the map is the qualified name of the changed type.
173 typedef unordered_map<string, diff*> string_diff_ptr_map;
174 
175 /// Convenience typedef for a map whose key is a string and whose
176 /// value is a changed variable of type @ref var_diff_sptr.
177 typedef unordered_map<string,
179 
180 
181 /// Convenience typedef for a map whose key is an unsigned int and
182 /// whose value is a changed variable of type @ref var_diff_sptr.
183 typedef unordered_map<unsigned, var_diff_sptr> unsigned_var_diff_sptr_map;
184 
185 /// Convenience typedef for a map which value is a function
186 /// parameter. The key is the name of the function parm.
187 typedef unordered_map<string, function_decl::parameter_sptr> string_parm_map;
188 
189 /// Convenience typedef for a map which value is an enumerator. The
190 /// key is the name of the enumerator.
191 typedef unordered_map<string, enum_type_decl::enumerator> string_enumerator_map;
192 
193 /// Convenience typedef for a changed enumerator. The first element
194 /// of the pair is the old enumerator and the second one is the new enumerator.
195 typedef std::pair<enum_type_decl::enumerator,
196  enum_type_decl::enumerator> changed_enumerator;
197 
198 /// Convenience typedef for a vector of changed enumerators.
199 typedef vector<changed_enumerator> changed_enumerators_type;
200 
201 /// Convenience typedef for a map which value is a changed enumerator.
202 /// The key is the name of the changed enumerator.
203 typedef unordered_map<string, changed_enumerator> string_changed_enumerator_map;
204 
205 /// Convenience typedef for a map which key is a string and which
206 /// value is a pointer to @ref decl_base.
207 typedef unordered_map<string, function_decl*> string_function_ptr_map;
208 
209 /// Convenience typedef for a map which key is a string and which
210 /// value is a @ref function_decl_diff_sptr.
211 typedef unordered_map<string,
214 
215 /// Convenience typedef for a pair of class_decl::member_function_sptr
216 /// representing a changed member function. The first element of the
217 /// pair is the initial member function and the second element is the
218 /// changed one.
219 typedef pair<method_decl_sptr,
220  method_decl_sptr> changed_member_function_sptr;
221 
222 /// Convenience typedef for a hash map of strings and changed member functions.
223 typedef unordered_map<string,
226 
227 /// Convenience typedef for a hash map of strings and member functions.
228 typedef unordered_map<string, method_decl_sptr> string_member_function_sptr_map;
229 
230 /// Convenience typedef for a map which key is a string and which
231 /// value is a point to @ref var_decl.
232 typedef unordered_map<string, var_decl*> string_var_ptr_map;
233 
234 /// Convenience typedef for a pair of pointer to @ref var_decl
235 /// representing a @ref var_decl change. The first member of the pair
236 /// represents the initial variable and the second member represents
237 /// the changed variable.
238 typedef std::pair<var_decl*, var_decl*> changed_var_ptr;
239 
240 /// Convenience typedef for a pair of @ref var_decl_sptr representing
241 /// a @ref var_decl change. The first member of the pair represents
242 /// the initial variable and the second member represents the changed
243 /// variable.
244 typedef std::pair<var_decl_sptr, var_decl_sptr> changed_var_sptr;
245 
246 /// Convenience typedef for a vector of @changed_var_sptr.gg381
247 typedef vector<changed_var_sptr> changed_var_sptrs_type;
248 
249 /// Convenience typedef for a map whose key is a string and whose
250 /// value is an @ref elf_symbol_sptr.
251 typedef unordered_map<string, elf_symbol_sptr> string_elf_symbol_map;
252 
253 /// Convenience typedef for a map which key is a string and which
254 /// value is a @ref var_diff_sptr.
255 typedef unordered_map<string, var_diff_sptr> string_var_diff_ptr_map;
256 
257 class diff_node_visitor;
258 
260 
261 /// Convenience typedef for shared_ptr on diff_traversable_base.
262 typedef shared_ptr<diff_traversable_base> diff_traversable_base_sptr;
263 
264 /// An enum for the different ways to visit a diff tree node.
265 ///
266 /// This is used by the node traversing code, to know when to avoid
267 /// visiting children nodes, for instance.
269 {
270  /// The default enumerator value of this enum. It doesn't have any
271  /// particular meaning yet.
273 
274  /// This says that the traversing code should avoid visiting the
275  /// children nodes of the current node being visited.
277 
278  /// This says that the traversing code should not mark visited nodes
279  /// as having been traversed. This is useful, for instance, for
280  /// visitors which have debugging purposes.
282 };
283 
286 
289 
292 
293 /// The base class for the diff classes that are to be traversed.
295 {
296 public:
297  virtual bool
299 }; // end struct diff_traversable_base
300 
301 /// An enum for the different categories that a diff tree node falls
302 /// into, regarding the kind of changes it represents.
303 ///
304 /// Note that if you add an enumerator to this enum, you need to
305 /// update a few spots accordingly:
306 ///
307 /// * update the ACCESS_CHANGE_CATEGORY enumerator (which is the
308 /// last enumerator of this enum by OR-ing its initializer with
309 /// the new enumerator.
310 ///
311 /// * update the categorize_harmless_diff_node or
312 /// categorize_harmful_diff_node function depending on if the new
313 /// enumerator classifies diff nodes as harmless or harmful.
314 ///
315 /// * update the get_default_harmless_categories_bitmap or
316 /// get_default_harmful_categories_bitmap function as well, just
317 /// like above.
318 ///
319 /// * update the "operator<<(ostream& o, diff_category c)" streaming
320 /// operator so that it can stream the new enumerator to a textual
321 /// output stream.
323 {
324  /// This means the diff node does not carry any (meaningful) change,
325  /// or that it carries changes that have not yet been categorized.
327 
328  /// This means the diff node (or at least one of its descendant
329  /// nodes) carries access related changes, e.g, a private member
330  /// that becomes public.
332 
333  /// This means the diff node (or at least one of its descendant
334  /// nodes) carries a change involving two compatible types. For
335  /// instance a type and its typedefs.
337 
338  /// This means that a diff node in the sub-tree carries a harmless
339  /// declaration name change. This is set only for name changes for
340  /// data members and typedefs.
342 
343  /// This means that a diff node in the sub-tree carries an addition
344  /// or removal of a non-virtual member function.
346 
347  /// This means that a diff node in the sub-tree carries an addition
348  /// or removal of a static data member.
350 
351  /// This means that a diff node in the sub-tree carries an addition
352  /// of enumerator to an enum type.
354 
355  /// This means that a diff node in the sub-tree carries an a symbol
356  /// alias change that is harmless.
358 
359  /// This means that a diff node in the sub-tree carries a harmless
360  /// union change.
362 
363  /// This means that a diff node in the sub-tree carries a harmless
364  /// data member change. An example of harmless data member change
365  /// is an anonymous data member that replaces a given data member
366  /// without locally changing the layout.
368 
369  /// This means that a diff node was marked as suppressed by a
370  /// user-provided suppression specification.
372 
373  /// This means that a diff node was warked as being for a private
374  /// type. That is, the diff node is meant to be suppressed by a
375  /// suppression specification that was auto-generated to filter out
376  /// changes to private types.
378 
379  /// This means the diff node (or at least one of its descendant
380  /// nodes) carries a change that modifies the size of a type or an
381  /// offset of a type member. Removal or changes of enumerators in a
382  /// enum fall in this category too.
384 
385  /// This means that a diff node in the sub-tree carries an
386  /// incompatible change to a vtable.
388 
389  /// A diff node in this category is redundant. That means it's
390  /// present as a child of a other nodes in the diff tree.
392 
393  /// This means that a diff node in the sub-tree carries a type that
394  /// was declaration-only and that is now defined, or vice versa.
396 
397  /// A diff node in this category is a function parameter type which
398  /// top cv-qualifiers change.
400 
401  /// A diff node in this category has a function parameter type with a
402  /// cv-qualifiers change.
404 
405  /// A diff node in this category is a function return type with a
406  /// cv-qualifier change.
408 
409  /// A diff node in this category is a function (or function type)
410  /// with at least one parameter added or removed.
412 
413  /// A diff node in this category is for a variable which type holds
414  /// a cv-qualifier change.
416 
417  /// A diff node in this category carries a change from void pointer
418  /// to non-void pointer.
420 
421  /// A diff node in this category carries a change in the size of the
422  /// array type of a global variable, but the ELF size of the
423  /// variable didn't change.
425 
426  /// A diff node in this category carries a change that must be
427  /// reported, even if the diff node is also in the
428  /// SUPPRESSED_CATEGORY or PRIVATE_TYPE_CATEGORY categories.
429  /// Typically, this node matches a suppression specification like
430  /// the [allow_type] directive.
432 
433  /// A diff node in this category has a descendant node that is in
434  /// the HAS_ALLOWED_CHANGE_CATEGORY category. Nodes in this
435  /// category must be reported, even if they are also in the
436  /// SUPPRESSED_CATEGORY or PRIVATE_TYPE_CATEGORY categories.
438 
439  /// A diff node in this category has a parent node that is in the
440  /// HAS_ALLOWED_CHANGE_CATEGORY category. Nodes in this category
441  /// must be reported, even if they are also in the
442  /// SUPPRESSED_CATEGORY or PRIVATE_TYPE_CATEGORY categories.
444 
445  /// A special enumerator that is the logical 'or' all the
446  /// enumerators above.
447  ///
448  /// This one must stay the last enumerator. Please update it each
449  /// time you add a new enumerator above.
476 }; // enum diff_category
477 
480 
482 operator|=(diff_category& c1, diff_category c2);
483 
485 operator&=(diff_category& c1, diff_category c2);
486 
488 operator^(diff_category c1, diff_category c2);
489 
492 
495 
498 
501 
502 ostream&
503 operator<<(ostream& o, diff_category);
504 
505 class corpus_diff;
506 
507 /// This type contains maps. Each map associates a type name to a
508 /// diff of that type. Not all kinds of diffs are present; only those
509 /// that carry leaf changes are, for now.
511 {
512  struct priv;
513  std::unique_ptr<priv> priv_;
514 
515 public:
516 
517  diff_maps();
518 
519  ~diff_maps();
520 
521  const string_diff_ptr_map&
522  get_type_decl_diff_map() const;
523 
526 
527  const string_diff_ptr_map&
528  get_enum_diff_map() const;
529 
532 
533  const string_diff_ptr_map&
534  get_class_diff_map() const;
535 
538 
539  const string_diff_ptr_map&
540  get_union_diff_map() const;
541 
544 
545  const string_diff_ptr_map&
546  get_typedef_diff_map() const;
547 
550 
551  const string_diff_ptr_map&
552  get_subrange_diff_map() const;
553 
556 
557  const string_diff_ptr_map&
558  get_array_diff_map() const;
559 
562 
563  const string_diff_ptr_map&
564  get_reference_diff_map() const;
565 
568 
569  const string_diff_ptr_map&
570  get_fn_parm_diff_map() const;
571 
574 
575  const string_diff_ptr_map&
577 
580 
581  const string_diff_ptr_map&
583 
586 
587  const string_diff_ptr_map&
588  get_var_decl_diff_map() const;
589 
592 
593  const string_diff_ptr_map&
594  get_distinct_diff_map() const;
595 
598 
599  bool
600  insert_diff_node(const diff *d,
601  const type_or_decl_base_sptr& impacted_iface);
602 
604  lookup_impacted_interfaces(const diff *d) const;
605 }; // end class diff_maps
606 
607 /// A convenience typedef for a shared pointer to @ref corpus_diff.
608 typedef shared_ptr<corpus_diff> corpus_diff_sptr;
609 
610 /// The context of the diff. This type holds various bits of
611 /// information that is going to be used throughout the diffing of two
612 /// entities and the reporting that follows.
614 {
615  struct priv;
616  std::unique_ptr<priv> priv_;
617 
618  diff_sptr
619  has_diff_for(const type_or_decl_base_sptr first,
620  const type_or_decl_base_sptr second) const;
621 
622  diff_sptr
623  has_diff_for_types(const type_base_sptr first,
624  const type_base_sptr second) const;
625 
626  const diff*
627  has_diff_for(const diff* d) const;
628 
629  diff_sptr
630  has_diff_for(const diff_sptr d) const;
631 
632  void
633  add_diff(const type_or_decl_base_sptr first,
634  const type_or_decl_base_sptr second,
635  const diff_sptr d);
636 
637  void
638  add_diff(const diff_sptr d);
639 
640  void
641  add_diff(const diff* d);
642 
643  void
644  set_canonical_diff_for(const type_or_decl_base_sptr first,
645  const type_or_decl_base_sptr second,
646  const diff_sptr);
647 
648  diff_sptr
649  set_or_get_canonical_diff_for(const type_or_decl_base_sptr first,
650  const type_or_decl_base_sptr second,
651  const diff_sptr canonical_diff);
652 
653 public:
654  diff_context();
655 
656  ~diff_context();
657 
658  bool
659  do_log() const;
660 
661  void
662  do_log(bool);
663 
664  void
666 
667  const corpus_diff_sptr&
668  get_corpus_diff() const;
669 
670  corpus_sptr
671  get_first_corpus() const;
672 
673  corpus_sptr
674  get_second_corpus() const;
675 
677  get_reporter() const;
678 
679  void
681 
682  diff_sptr
684  const type_or_decl_base_sptr second) const;
685 
686  diff_sptr
687  get_canonical_diff_for(const diff_sptr d) const;
688 
689  void
691 
692  void
694 
695  diff*
696  diff_has_been_visited(const diff*) const;
697 
698  diff_sptr
699  diff_has_been_visited(const diff_sptr) const;
700 
701  void
702  mark_diff_as_visited(const diff*);
703 
704  void
706 
707  void
708  mark_last_diff_visited_per_class_of_equivalence(const diff*);
709 
710  void
711  clear_last_diffs_visited_per_class_of_equivalence();
712 
713  const diff*
714  get_last_visited_diff_of_class_of_equivalence(const diff*);
715 
716  void
718 
719  bool
721 
722  void
724 
725  bool
727 
729  get_allowed_category() const;
730 
731  void
733 
734  void
736 
737  void
739 
740  const filtering::filters&
741  diff_filters() const;
742 
743  void
745 
746  void
748 
749  void
751 
753  suppressions() const;
754 
756  suppressions();
757 
759  negated_suppressions() const;
760 
762  direct_suppressions() const;
763 
764  void
766 
767  void
769 
770  bool
772 
773  void
775 
776  void
777  show_leaf_changes_only(bool f);
778 
779  bool
780  show_leaf_changes_only() const;
781 
782  bool
783  show_hex_values() const;
784 
785  void
786  show_hex_values(bool f);
787 
788  bool
790 
791  void
793 
794  void
796 
797  bool
799 
800  void
801  show_stats_only(bool f);
802 
803  bool
804  show_stats_only() const;
805 
806  void
807  show_soname_change(bool f);
808 
809  bool
810  show_soname_change() const;
811 
812  void
813  show_architecture_change(bool f);
814 
815  bool
816  show_architecture_change() const;
817 
818  void
819  show_deleted_fns(bool f);
820 
821  bool
822  show_deleted_fns() const;
823 
824  void
825  show_changed_fns(bool f);
826 
827  bool
828  show_changed_fns() const;
829 
830  void
831  show_added_fns(bool f);
832 
833  bool
834  show_added_fns() const;
835 
836  void
837  show_deleted_vars(bool f);
838 
839  bool
840  show_deleted_vars() const;
841 
842  void
843  show_changed_vars(bool f);
844 
845  bool
846  show_changed_vars() const;
847 
848  void
849  show_added_vars(bool f);
850 
851  bool
852  show_added_vars() const;
853 
854  bool
855  show_linkage_names() const;
856 
857  void
858  show_linkage_names(bool f);
859 
860  bool
861  show_locs() const;
862 
863  void
864  show_locs(bool f);
865 
866  bool
867  show_redundant_changes() const;
868 
869  void
870  show_redundant_changes(bool f);
871 
872  bool
874 
875  void
877 
878  bool
880 
881  void
883 
884  void show_unreachable_types(bool f);
885 
886  bool show_unreachable_types();
887 
888  bool
889  show_impacted_interfaces() const;
890 
891  void
892  show_impacted_interfaces(bool f);
893 
894  void
895  default_output_stream(ostream*);
896 
897  ostream*
899 
900  void
901  error_output_stream(ostream*);
902 
903  ostream*
904  error_output_stream() const;
905 
906  bool
907  dump_diff_tree() const;
908 
909  void
910  dump_diff_tree(bool f);
911 
912  void
913  do_dump_diff_tree(const diff_sptr) const;
914 
915  void
916  do_dump_diff_tree(const corpus_diff_sptr) const;
917 
918  friend class_diff_sptr
919  compute_diff(const class_decl_sptr first,
920  const class_decl_sptr second,
921  diff_context_sptr ctxt);
922 };//end struct diff_context.
923 
924 /// The abstraction of a change between two ABI artifacts, a.k.a an
925 /// artifact change.
926 ///
927 /// In the grand scheme of things, a diff is strongly typed; for
928 /// instance, a change between two enums is represented by an
929 /// enum_diff type. A change between two function_type is represented
930 /// by a function_type_diff type and a change between two class_decl
931 /// is represented by a class_diff type. All of these types derive
932 /// from the @ref diff parent class.
933 ///
934 /// An artifact change D can have one (or more) details named D'. A
935 /// detail is an artifact change that "belongs" to another one. Here,
936 /// D' belongs to D. Or said otherwise, D' is a child change of D.
937 /// Said otherwise, D and D' are related, and the relation is a
938 /// "child relation".
939 ///
940 /// For instance, if we consider a change carried by a class_diff, the
941 /// detail change might be a change on one data member of the class.
942 /// In other word, the class_diff change might have a child diff node
943 /// that would be a var_diff node.
944 ///
945 /// There are two ways to get the child var_diff node (for the data
946 /// member change detail) of the class_diff.
947 ///
948 /// The first way is through the typed API, that is, through the
949 /// class_diff::sorted_changed_data_members() member function which
950 /// returns var_diff nodes.
951 ///
952 /// The second way is through the generic API, that is, through the
953 /// diff::children_nodes() member function which returns generic diff
954 /// nodes. This second way enables us to walk the diff nodes graph in
955 /// a generic way, regardless of the types of the diff nodes.
956 ///
957 /// Said otherwise, there are two views for a given diff node. There
958 /// is typed view, and there is the generic view. In the typed view,
959 /// the details are accessed through the typed API. In the generic
960 /// view, the details are gathered through the generic view.
961 ///
962 ///
963 /// Please read more about the @ref DiffNode "IR" of the comparison
964 /// engine to learn more about this.
965 ///
966 /// This type encapsulates an edit script (a set of insertions and
967 /// deletions) for two constructs that are to be diff'ed. The two
968 /// constructs are called the "subjects" of the diff.
970 {
971  friend class diff_context;
972 
973  // Forbidden
974  diff();
975 
976 protected:
977  struct priv;
978  std::unique_ptr<priv> priv_;
979 
982 
985  diff_context_sptr ctxt);
986 
987  bool
988  do_log() const;
989 
990  void
991  do_log(bool);
992 
993  void
995 
996  void
997  end_traversing();
998 
999  virtual void
1000  finish_diff_type();
1001 
1002  void
1004 
1005 public:
1007  first_subject() const;
1008 
1010  second_subject() const;
1011 
1012  const vector<diff*>&
1013  children_nodes() const;
1014 
1015  const diff*
1016  parent_node() const;
1017 
1018  diff* get_canonical_diff() const;
1019 
1020  bool
1021  is_traversing() const;
1022 
1023  void
1025 
1026  const diff_context_sptr
1027  context() const;
1028 
1029  void
1031 
1032  bool
1033  currently_reporting() const;
1034 
1035  void
1036  currently_reporting(bool f) const;
1037 
1038  bool
1039  reported_once() const;
1040 
1041  void
1042  reported_once(bool f) const;
1043 
1045  get_category() const;
1046 
1048  get_local_category() const;
1049 
1052 
1055 
1058 
1059  void
1061 
1064 
1067 
1068  void
1070 
1071  void
1073 
1074  bool
1075  is_filtered_out() const;
1076 
1077  bool
1079 
1080  bool
1082 
1083  bool
1084  is_suppressed() const;
1085 
1086  bool
1087  is_suppressed(bool &is_private_type) const;
1088 
1089  bool
1090  to_be_reported() const;
1091 
1092  bool
1094 
1095  bool
1097 
1098  bool
1100 
1101  bool
1103 
1104  virtual const string&
1105  get_pretty_representation() const;
1106 
1107  /// This constructs the relation between this diff node and its
1108  /// detail diff nodes, in the generic view of the diff node.
1109  ///
1110  /// Each specific typed diff node should implement how the typed
1111  /// view "links" itself to its detail nodes in the generic sense.
1112  virtual void
1114 
1115  /// Pure interface to get the length of the changes encapsulated by
1116  /// this diff. A length of zero means that the current instance of
1117  /// @ref diff doesn't carry any change.
1118  ///
1119  /// This is to be implemented by all descendants of this type.
1120  virtual bool
1121  has_changes() const = 0;
1122 
1123  /// Pure interface to know if the current instance of @diff carries
1124  /// a local change. A local change is a change that is on the @ref
1125  /// diff object itself, as opposed to a change that is carried by
1126  /// some of its children nodes.
1127  ///
1128  /// This is to be implemented by all descendants of this type.
1129  virtual enum change_kind
1130  has_local_changes() const = 0;
1131 
1132  /// Pure interface to report the diff in a serialized form that is
1133  /// legible for the user.
1134  ///
1135  /// Note that the serializd report has to leave one empty line at
1136  /// the end of its content.
1137  ///
1138  /// @param out the output stream to serialize the report to.
1139  ///
1140  /// @param indent the indentation string to use.
1141  virtual void
1142  report(ostream& out, const string& indent = "") const = 0;
1143 
1144  virtual bool
1146 };// end class diff
1147 
1148 diff_sptr
1149 compute_diff(const decl_base_sptr,
1150  const decl_base_sptr,
1151  diff_context_sptr ctxt);
1152 
1153 diff_sptr
1154 compute_diff(const type_base_sptr,
1155  const type_base_sptr,
1156  diff_context_sptr ctxt);
1157 
1158 /// The base class of diff between types.
1159 class type_diff_base : public diff
1160 {
1161  struct priv;
1162  std::unique_ptr<priv> priv_;
1163 
1164  type_diff_base();
1165 
1166 protected:
1168  type_base_sptr second_subject,
1169  diff_context_sptr ctxt);
1170 
1171 public:
1172 
1173  virtual enum change_kind
1174  has_local_changes() const = 0;
1175 
1176  virtual ~type_diff_base();
1177 };// end class type_diff_base
1178 
1179 /// The base class of diff between decls.
1180 class decl_diff_base : public diff
1181 {
1182  struct priv;
1183  std::unique_ptr<priv> priv_;
1184 
1185 protected:
1187  decl_base_sptr second_subject,
1188  diff_context_sptr ctxt);
1189 
1190 public:
1191 
1192  virtual enum change_kind
1193  has_local_changes() const = 0;
1194 
1195  virtual ~decl_diff_base();
1196 };// end class decl_diff_base
1197 
1198 string
1200 
1201 class distinct_diff;
1202 
1203 /// Convenience typedef for a shared pointer to distinct_types_diff
1204 typedef shared_ptr<distinct_diff> distinct_diff_sptr;
1205 
1206 /// An abstraction of a diff between entities that are of a different
1207 /// kind (disctinct).
1208 class distinct_diff : public diff
1209 {
1210  struct priv;
1211  std::unique_ptr<priv> priv_;
1212 
1213 protected:
1217 
1218 public:
1219 
1221  first() const;
1222 
1224  second() const;
1225 
1226  const diff_sptr
1227  compatible_child_diff() const;
1228 
1229  virtual const string&
1230  get_pretty_representation() const;
1231 
1232  virtual bool
1233  has_changes() const;
1234 
1235  virtual enum change_kind
1236  has_local_changes() const;
1237 
1238  virtual void
1239  report(ostream& out, const string& indent = "") const;
1240 
1241  virtual void
1243 
1244  static bool
1247 
1248  friend distinct_diff_sptr
1251  diff_context_sptr ctxt);
1252 };// end class distinct_types_diff
1253 
1256  const type_or_decl_base_sptr,
1257  diff_context_sptr ctxt);
1258 
1259 /// Abstracts a diff between two instances of @ref var_decl
1260 class var_diff : public decl_diff_base
1261 {
1262  struct priv;
1263  std::unique_ptr<priv> priv_;
1264 
1265 protected:
1266  var_diff(var_decl_sptr first,
1267  var_decl_sptr second,
1270 
1271 public:
1273  first_var() const;
1274 
1276  second_var() const;
1277 
1278  diff_sptr
1279  type_diff() const;
1280 
1281  virtual void
1283 
1284  virtual bool
1285  has_changes() const;
1286 
1287  virtual enum change_kind
1288  has_local_changes() const;
1289 
1290  virtual void
1291  report(ostream& out, const string& indent = "") const;
1292 
1293  virtual const string&
1294  get_pretty_representation() const;
1295 
1296  friend var_diff_sptr
1297  compute_diff(const var_decl_sptr first,
1298  const var_decl_sptr second,
1299  diff_context_sptr ctxt);
1300 };// end class var_diff
1301 
1304 
1305 class pointer_diff;
1306 /// Convenience typedef for a shared pointer on a @ref
1307 /// pointer_diff type.
1308 typedef shared_ptr<pointer_diff> pointer_diff_sptr;
1309 
1310 /// The abstraction of a diff between two pointers.
1312 {
1313  struct priv;
1314  std::unique_ptr<priv> priv_;
1315 
1316 protected:
1318  pointer_type_def_sptr second,
1321 
1322 public:
1323  const pointer_type_def_sptr
1324  first_pointer() const;
1325 
1326  const pointer_type_def_sptr
1327  second_pointer() const;
1328 
1329  diff_sptr
1330  underlying_type_diff() const;
1331 
1332  void
1334 
1335  virtual const string&
1336  get_pretty_representation() const;
1337 
1338  virtual bool
1339  has_changes() const;
1340 
1341  virtual enum change_kind
1342  has_local_changes() const;
1343 
1344  virtual void
1345  report(ostream&, const string& indent = "") const;
1346 
1347  virtual void
1349 
1350  friend pointer_diff_sptr
1352  pointer_type_def_sptr second,
1353  diff_context_sptr ctxt);
1354 };// end class pointer_diff
1355 
1358  pointer_type_def_sptr second,
1359  diff_context_sptr ctxt);
1360 
1361 class reference_diff;
1362 
1363 /// Convenience typedef for a shared pointer on a @ref
1364 /// reference_diff type.
1365 typedef shared_ptr<reference_diff> reference_diff_sptr;
1366 
1367 /// The abstraction of a diff between two references.
1369 {
1370  struct priv;
1371  std::unique_ptr<priv> priv_;
1372 
1373 protected:
1375  const reference_type_def_sptr second,
1376  diff_sptr underlying,
1378 
1379 public:
1381  first_reference() const;
1382 
1384  second_reference() const;
1385 
1386  const diff_sptr&
1387  underlying_type_diff() const;
1388 
1389  diff_sptr&
1391 
1392  virtual const string&
1393  get_pretty_representation() const;
1394 
1395  virtual bool
1396  has_changes() const;
1397 
1398  virtual enum change_kind
1399  has_local_changes() const;
1400 
1401  virtual void
1402  report(ostream&, const string& indent = "") const;
1403 
1404  virtual void
1406 
1407  friend reference_diff_sptr
1409  reference_type_def_sptr second,
1410  diff_context_sptr ctxt);
1411 };// end class reference_diff
1412 
1415  reference_type_def_sptr second,
1416  diff_context_sptr ctxt);
1417 
1418 
1419 class subrange_diff;
1420 
1421 /// A convenience typedef for a shared pointer to subrange_diff type.
1422 typedef shared_ptr<subrange_diff> subrange_diff_sptr;
1423 
1424 /// The abstraction of the diff between two subrange types.
1426 {
1427  struct priv;
1428  std::unique_ptr<priv> priv_;
1429 
1430 protected:
1432  const array_type_def::subrange_sptr& second,
1434  const diff_context_sptr ctxt = diff_context_sptr());
1435 
1436 public:
1438  first_subrange() const;
1439 
1441  second_subrange() const;
1442 
1443  const diff_sptr
1444  underlying_type_diff() const;
1445 
1446  virtual const string&
1447  get_pretty_representation() const;
1448 
1449  virtual bool
1450  has_changes() const;
1451 
1452  virtual enum change_kind
1453  has_local_changes() const;
1454 
1455  virtual void
1456  report(ostream&, const string& indent = "") const;
1457 
1458  virtual void
1460 
1461  friend subrange_diff_sptr
1464  diff_context_sptr ctxt);
1465 }; // end subrange_diff
1466 
1470  diff_context_sptr ctxt);
1471 
1472 
1473 class array_diff;
1474 
1475 /// Convenience typedef for a shared pointer on a @ref
1476 /// array_diff type.
1477 typedef shared_ptr<array_diff> array_diff_sptr;
1478 
1479 /// The abstraction of a diff between two arrays.
1481 {
1482  struct priv;
1483  std::unique_ptr<priv> priv_;
1484 
1485 protected:
1486  array_diff(const array_type_def_sptr first,
1487  const array_type_def_sptr second,
1490 
1491 public:
1492  const array_type_def_sptr
1493  first_array() const;
1494 
1495  const array_type_def_sptr
1496  second_array() const;
1497 
1498  const diff_sptr&
1499  element_type_diff() const;
1500 
1501  void
1503 
1504  virtual const string&
1505  get_pretty_representation() const;
1506 
1507  virtual bool
1508  has_changes() const;
1509 
1510  virtual enum change_kind
1511  has_local_changes() const;
1512 
1513  virtual void
1514  report(ostream&, const string& indent = "") const;
1515 
1516  virtual void
1518 
1519  friend array_diff_sptr
1521  array_type_def_sptr second,
1522  diff_context_sptr ctxt);
1523 };// end class array_diff
1524 
1527  array_type_def_sptr second,
1528  diff_context_sptr ctxt);
1529 
1530 class qualified_type_diff;
1531 typedef class shared_ptr<qualified_type_diff> qualified_type_diff_sptr;
1532 
1533 /// Abstraction of a diff between two qualified types.
1535 {
1536  struct priv;
1537  std::unique_ptr<priv> priv_;
1538 
1539 protected:
1540  qualified_type_diff(qualified_type_def_sptr first,
1541  qualified_type_def_sptr second,
1542  diff_sptr underling,
1544 
1545 public:
1546  const qualified_type_def_sptr
1547  first_qualified_type() const;
1548 
1549  const qualified_type_def_sptr
1550  second_qualified_type() const;
1551 
1552  diff_sptr
1553  underlying_type_diff() const;
1554 
1555  void
1557 
1558  diff_sptr
1559  leaf_underlying_type_diff() const;
1560 
1561  virtual const string&
1562  get_pretty_representation() const;
1563 
1564  virtual bool
1565  has_changes() const;
1566 
1567  virtual enum change_kind
1568  has_local_changes() const;
1569 
1570  virtual void
1571  report(ostream&, const string& indent = "") const;
1572 
1573  virtual void
1575 
1576  friend qualified_type_diff_sptr
1577  compute_diff(const qualified_type_def_sptr first,
1578  const qualified_type_def_sptr second,
1579  diff_context_sptr ctxt);
1580 };// end class qualified_type_diff.
1581 
1582 qualified_type_diff_sptr
1583 compute_diff(const qualified_type_def_sptr first,
1584  const qualified_type_def_sptr second,
1585  diff_context_sptr ctxt);
1586 
1587 class enum_diff;
1588 typedef shared_ptr<enum_diff> enum_diff_sptr;
1589 
1590 /// Abstraction of a diff between two enums.
1592 {
1593  struct priv;
1594  std::unique_ptr<priv> priv_;
1595 
1596  void
1597  clear_lookup_tables();
1598 
1599  bool
1600  lookup_tables_empty() const;
1601 
1602  void
1603  ensure_lookup_tables_populated();
1604 
1605 protected:
1607  const enum_type_decl_sptr,
1608  const diff_sptr,
1610 
1611 public:
1612  const enum_type_decl_sptr
1613  first_enum() const;
1614 
1615  const enum_type_decl_sptr
1616  second_enum() const;
1617 
1618  diff_sptr
1619  underlying_type_diff() const;
1620 
1621  const string_enumerator_map&
1622  deleted_enumerators() const;
1623 
1624  const string_enumerator_map&
1625  inserted_enumerators() const;
1626 
1628  changed_enumerators() const;
1629 
1630  virtual const string&
1631  get_pretty_representation() const;
1632 
1633  virtual bool
1634  has_changes() const;
1635 
1636  virtual enum change_kind
1637  has_local_changes() const;
1638 
1639  virtual void
1640  report(ostream&, const string& indent = "") const;
1641 
1642  virtual void
1644 
1645  friend enum_diff_sptr
1646  compute_diff(const enum_type_decl_sptr first,
1647  const enum_type_decl_sptr second,
1648  diff_context_sptr ctxt);
1649 };//end class enum_diff;
1650 
1651 enum_diff_sptr
1653  const enum_type_decl_sptr,
1655 
1656 /// This is the base class of @ref class_diff and @ref union_diff.
1658 {
1659 protected:
1660  struct priv;
1661  typedef std::unique_ptr<priv> priv_ptr;
1662  priv_ptr priv_;
1663 
1664  void
1665  clear_lookup_tables(void);
1666 
1667  bool
1668  lookup_tables_empty(void) const;
1669 
1670  void
1671  ensure_lookup_tables_populated(void) const;
1672 
1673  void
1675 
1676 protected:
1677  class_or_union_diff(class_or_union_sptr first_scope,
1678  class_or_union_sptr second_scope,
1680 
1681 public:
1682 
1683  const class_or_union_diff::priv_ptr&
1684  get_priv() const;
1685 
1686  //TODO: add change of the name of the type.
1687 
1688  virtual ~class_or_union_diff();
1689 
1690  class_or_union_sptr
1691  first_class_or_union() const;
1692 
1693  class_or_union_sptr
1694  second_class_or_union() const;
1695 
1696  const edit_script&
1697  member_types_changes() const;
1698 
1699  edit_script&
1701 
1702  const edit_script&
1703  data_members_changes() const;
1704 
1705  edit_script&
1707 
1709  inserted_data_members() const;
1710 
1712  deleted_data_members() const;
1713 
1714  const edit_script&
1715  member_fns_changes() const;
1716 
1717  edit_script&
1719 
1721  changed_member_fns() const;
1722 
1724  deleted_member_fns() const;
1725 
1727  inserted_member_fns() const;
1728 
1729  const var_diff_sptrs_type&
1731 
1732  size_t
1733  count_filtered_changed_data_members(bool local_only = false) const;
1734 
1735  const var_diff_sptrs_type&
1737 
1738  size_t
1739  count_filtered_subtype_changed_data_members(bool local_only = false) const;
1740 
1743 
1744  const changed_var_sptrs_type&
1746 
1747  const edit_script&
1748  member_fn_tmpls_changes() const;
1749 
1750  edit_script&
1752 
1753  const edit_script&
1755 
1756  edit_script&
1758 
1759  virtual bool
1760  has_changes() const;
1761 
1762  virtual enum change_kind
1763  has_local_changes() const;
1764 
1765  virtual void
1766  report(ostream&, const string& indent = "") const;
1767 
1768  virtual void
1770 
1771  friend class default_reporter;
1772 }; // end class_or_union_diff;
1773 
1774 /// This type abstracts changes for a class_decl.
1776 {
1777  struct priv;
1778  typedef std::unique_ptr<priv> priv_ptr;
1779  priv_ptr priv_;
1780 
1781  const priv_ptr& get_priv()const;
1782 
1783  void
1784  clear_lookup_tables(void);
1785 
1786  bool
1787  lookup_tables_empty(void) const;
1788 
1789  void
1790  ensure_lookup_tables_populated(void) const;
1791 
1792  void
1793  allocate_priv_data();
1794 
1795 protected:
1796  class_diff(class_decl_sptr first_scope,
1797  class_decl_sptr second_scope,
1799 
1800 public:
1801  //TODO: add change of the name of the type.
1802 
1803  virtual ~class_diff();
1804 
1806  first_class_decl() const;
1807 
1809  second_class_decl() const;
1810 
1811  const edit_script&
1812  base_changes() const;
1813 
1814  edit_script&
1815  base_changes();
1816 
1817  const string_base_sptr_map&
1818  deleted_bases() const;
1819 
1820  const string_base_sptr_map&
1821  inserted_bases() const;
1822 
1823  const base_diff_sptrs_type&
1824  changed_bases();
1825 
1826  const vector<class_decl::base_spec_sptr>&
1827  moved_bases() const;
1828 
1829  virtual bool
1830  has_changes() const;
1831 
1832  virtual enum change_kind
1833  has_local_changes() const;
1834 
1835  virtual const string&
1836  get_pretty_representation() const;
1837 
1838  virtual void
1839  report(ostream&, const string& indent = "") const;
1840 
1841  virtual void
1843 
1844  friend class_diff_sptr
1845  compute_diff(const class_decl_sptr first,
1846  const class_decl_sptr second,
1847  diff_context_sptr ctxt);
1848 
1849  friend class default_reporter;
1850 };// end class_diff
1851 
1853 compute_diff(const class_decl_sptr first,
1854  const class_decl_sptr second,
1855  diff_context_sptr ctxt);
1856 
1857 class union_diff;
1858 typedef shared_ptr<union_diff> union_diff_sptr;
1859 
1861 {
1862  void
1863  clear_lookup_tables(void);
1864 
1865  bool
1866  lookup_tables_empty(void) const;
1867 
1868  void
1869  ensure_lookup_tables_populated(void) const;
1870 
1871  void
1872  allocate_priv_data();
1873 
1874 protected:
1875  union_diff(union_decl_sptr first_union,
1876  union_decl_sptr second_union,
1878 
1879 public:
1880 
1881  virtual ~union_diff();
1882 
1883  union_decl_sptr
1884  first_union_decl() const;
1885 
1886  union_decl_sptr
1887  second_union_decl() const;
1888 
1889  virtual const string&
1890  get_pretty_representation() const;
1891 
1892  virtual void
1893  report(ostream&, const string& indent = "") const;
1894 
1895  friend union_diff_sptr
1896  compute_diff(const union_decl_sptr first,
1897  const union_decl_sptr second,
1898  diff_context_sptr ctxt);
1899 }; // end class union_diff
1900 
1901 union_diff_sptr
1902 compute_diff(const union_decl_sptr first,
1903  const union_decl_sptr second,
1904  diff_context_sptr ctxt);
1905 
1906 /// An abstraction of a diff between two instances of class_decl::base_spec.
1907 class base_diff : public diff
1908 {
1909  struct priv;
1910  std::unique_ptr<priv> priv_;
1911 
1912 protected:
1915  class_diff_sptr underlying,
1917 
1918 public:
1920  first_base() const;
1921 
1923  second_base() const;
1924 
1925  const class_diff_sptr
1926  get_underlying_class_diff() const;
1927 
1928  void
1930 
1931  virtual const string&
1932  get_pretty_representation() const;
1933 
1934  virtual bool
1935  has_changes() const;
1936 
1937  virtual enum change_kind
1938  has_local_changes() const;
1939 
1940  virtual void
1941  report(ostream&, const string& indent = "") const;
1942 
1943  virtual void
1945 
1946  friend base_diff_sptr
1948  const class_decl::base_spec_sptr second,
1949  diff_context_sptr ctxt);
1950 };// end class base_diff
1951 
1954  const class_decl::base_spec_sptr second,
1955  diff_context_sptr ctxt);
1956 
1957 class scope_diff;
1958 
1959 /// Convenience typedef for a shared pointer on a @ref scope_diff.
1960 typedef shared_ptr<scope_diff> scope_diff_sptr;
1961 
1962 /// An abstractions of the changes between two scopes.
1963 class scope_diff : public diff
1964 {
1965  struct priv;
1966  std::unique_ptr<priv> priv_;
1967 
1968  bool
1969  lookup_tables_empty() const;
1970 
1971  void
1972  clear_lookup_tables();
1973 
1974  void
1975  ensure_lookup_tables_populated();
1976 
1977 protected:
1981 
1982 public:
1983 
1984  friend scope_diff_sptr
1985  compute_diff(const scope_decl_sptr first,
1986  const scope_decl_sptr second,
1987  scope_diff_sptr d,
1988  diff_context_sptr ctxt);
1989 
1990  friend scope_diff_sptr
1993  diff_context_sptr ctxt);
1994 
1995  const scope_decl_sptr
1996  first_scope() const;
1997 
1998  const scope_decl_sptr
1999  second_scope() const;
2000 
2001  const edit_script&
2002  member_changes() const;
2003 
2004  edit_script&
2005  member_changes();
2006 
2007  const decl_base_sptr
2008  deleted_member_at(unsigned index) const;
2009 
2010  const decl_base_sptr
2011  deleted_member_at(vector<deletion>::const_iterator) const;
2012 
2013  const decl_base_sptr
2014  inserted_member_at(unsigned i);
2015 
2016  const decl_base_sptr
2017  inserted_member_at(vector<unsigned>::const_iterator i);
2018 
2019  const diff_sptrs_type&
2020  changed_types() const;
2021 
2022  const diff_sptrs_type&
2023  changed_decls() const;
2024 
2026  removed_types() const;
2027 
2029  removed_decls() const;
2030 
2032  added_types() const;
2033 
2035  added_decls() const;
2036 
2037  virtual const string&
2038  get_pretty_representation() const;
2039 
2040  virtual bool
2041  has_changes() const;
2042 
2043  virtual enum change_kind
2044  has_local_changes() const;
2045 
2046  virtual void
2047  report(ostream& out, const string& indent = "") const;
2048 
2049  virtual void
2051 
2052  friend class default_reporter;
2053  friend class leaf_reporter;
2054 };// end class scope_diff
2055 
2057 compute_diff(const scope_decl_sptr first,
2058  const scope_decl_sptr second,
2059  scope_diff_sptr d,
2060  diff_context_sptr ctxt);
2061 
2063 compute_diff(const scope_decl_sptr first_scope,
2064  const scope_decl_sptr second_scope,
2065  diff_context_sptr ctxt);
2066 
2067 /// Abstraction of a diff between two function parameters.
2069 {
2070  struct priv;
2071  std::unique_ptr<priv> priv_;
2072 
2074  const function_decl::parameter_sptr second,
2075  diff_context_sptr ctxt);
2076 
2077 public:
2078  friend fn_parm_diff_sptr
2080  const function_decl::parameter_sptr second,
2081  diff_context_sptr ctxt);
2082 
2084  first_parameter() const;
2085 
2087  second_parameter() const;
2088 
2089  diff_sptr
2090  type_diff() const;
2091 
2092  virtual const string&
2093  get_pretty_representation() const;
2094 
2095  virtual bool
2096  has_changes() const;
2097 
2098  virtual enum change_kind
2099  has_local_changes() const;
2100 
2101  virtual void
2102  report(ostream&, const string& indent = "") const;
2103 
2104  virtual void
2106 }; // end class fn_parm_diff
2107 
2110  const function_decl::parameter_sptr second,
2111  diff_context_sptr ctxt);
2112 
2113 class function_type_diff;
2114 
2115 /// A convenience typedef for a shared pointer to @ref
2116 /// function_type_type_diff
2117 typedef shared_ptr<function_type_diff> function_type_diff_sptr;
2118 
2119 /// Abstraction of a diff between two function types.
2121 {
2122  struct priv;
2123  std::unique_ptr<priv> priv_;
2124 
2125  void
2126  ensure_lookup_tables_populated();
2127 
2129  deleted_parameter_at(int i) const;
2130 
2132  inserted_parameter_at(int i) const;
2133 
2134 protected:
2136  const function_type_sptr second,
2137  diff_context_sptr ctxt);
2138 
2139 public:
2141  compute_diff(const function_type_sptr first,
2142  const function_type_sptr second,
2143  diff_context_sptr ctxt);
2144 
2145  const function_type_sptr
2146  first_function_type() const;
2147 
2148  const function_type_sptr
2149  second_function_type() const;
2150 
2151  const diff_sptr
2152  return_type_diff() const;
2153 
2155  subtype_changed_parms() const;
2156 
2157  const string_parm_map&
2158  removed_parms() const;
2159 
2160  const string_parm_map&
2161  added_parms() const;
2162 
2163  const vector<function_decl::parameter_sptr>&
2164  sorted_deleted_parms() const;
2165 
2166  const vector<function_decl::parameter_sptr>&
2167  sorted_added_parms() const;
2168 
2169  virtual const string&
2170  get_pretty_representation() const;
2171 
2172  virtual bool
2173  has_changes() const;
2174 
2175  virtual enum change_kind
2176  has_local_changes() const;
2177 
2178  virtual void
2179  report(ostream&, const string& indent = "") const;
2180 
2181  virtual void
2183 
2184  friend class default_reporter;
2185  friend class leaf_reporter;
2186 };// end class function_type_diff
2187 
2189 compute_diff(const function_type_sptr first,
2190  const function_type_sptr second,
2191  diff_context_sptr ctxt);
2192 
2193 /// Abstraction of a diff between two function_decl.
2195 {
2196  struct priv;
2197  std::unique_ptr<priv> priv_;
2198 
2199  void
2200  ensure_lookup_tables_populated();
2201 
2202 
2203 protected:
2205  const function_decl_sptr second,
2206  diff_context_sptr ctxt);
2207 
2208 public:
2209 
2211 compute_diff(const function_decl_sptr first,
2212  const function_decl_sptr second,
2213  diff_context_sptr ctxt);
2214 
2215  const function_decl_sptr
2216  first_function_decl() const;
2217 
2218  const function_decl_sptr
2219  second_function_decl() const;
2220 
2222  type_diff() const;
2223 
2224  virtual const string&
2225  get_pretty_representation() const;
2226 
2227  virtual bool
2228  has_changes() const;
2229 
2230  virtual enum change_kind
2231  has_local_changes() const;
2232 
2233  virtual void
2234  report(ostream&, const string& indent = "") const;
2235 
2236  virtual void
2238 }; // end class function_decl_diff
2239 
2241 compute_diff(const function_decl_sptr first,
2242  const function_decl_sptr second,
2243  diff_context_sptr ctxt);
2244 
2245 class type_decl_diff;
2246 
2247 /// Convenience typedef for a shared pointer on a @ref type_decl_diff type.
2248 typedef shared_ptr<type_decl_diff> type_decl_diff_sptr;
2249 
2250 /// Abstraction of a diff between two basic type declarations.
2252 {
2253  type_decl_diff();
2254 
2255 protected:
2256  type_decl_diff(const type_decl_sptr first,
2257  const type_decl_sptr second,
2259 
2260 public:
2261  friend type_decl_diff_sptr
2262  compute_diff(const type_decl_sptr first,
2263  const type_decl_sptr second,
2264  diff_context_sptr ctxt);
2265 
2266  const type_decl_sptr
2267  first_type_decl() const;
2268 
2269  const type_decl_sptr
2270  second_type_decl() const;
2271 
2272  virtual const string&
2273  get_pretty_representation() const;
2274 
2275  virtual bool
2276  has_changes() const;
2277 
2278  virtual enum change_kind
2279  has_local_changes() const;
2280 
2281  virtual void
2282  report(ostream& out, const string& indent = "") const;
2283 };// end type_decl_diff
2284 
2287  const type_decl_sptr,
2289 
2290 class typedef_diff;
2291 
2292 /// Convenience typedef for a shared pointer on a typedef_diff type.
2293 typedef shared_ptr<typedef_diff> typedef_diff_sptr;
2294 
2295 /// Abstraction of a diff between two typedef_decl.
2297 {
2298  struct priv;
2299  std::unique_ptr<priv> priv_;
2300 
2301  typedef_diff();
2302 
2303 protected:
2304  typedef_diff(const typedef_decl_sptr first,
2305  const typedef_decl_sptr second,
2308 
2309 public:
2310  friend typedef_diff_sptr
2311  compute_diff(const typedef_decl_sptr first,
2312  const typedef_decl_sptr second,
2313  diff_context_sptr ctxt);
2314 
2315  const typedef_decl_sptr
2316  first_typedef_decl() const;
2317 
2318  const typedef_decl_sptr
2319  second_typedef_decl() const;
2320 
2321  const diff_sptr
2322  underlying_type_diff() const;
2323 
2324  void
2326 
2327  virtual const string&
2328  get_pretty_representation() const;
2329 
2330  virtual bool
2331  has_changes() const;
2332 
2333  virtual enum change_kind
2334  has_local_changes() const;
2335 
2336  virtual void
2337  report(ostream&, const string& indent = "") const;
2338 
2339  virtual void
2341 };// end class typedef_diff
2342 
2345  const typedef_decl_sptr,
2346  diff_context_sptr ctxt);
2347 
2348 const diff*
2350 
2351 class translation_unit_diff;
2352 
2353 /// Convenience typedef for a shared pointer on a
2354 /// @ref translation_unit_diff type.
2355 typedef shared_ptr<translation_unit_diff> translation_unit_diff_sptr;
2356 
2357 /// An abstraction of a diff between two translation units.
2359 {
2360  struct priv;
2361  std::unique_ptr<priv> priv_;
2362 
2363 protected:
2365  translation_unit_sptr second,
2367 
2368 public:
2369 
2370  const translation_unit_sptr
2371  first_translation_unit() const;
2372 
2373  const translation_unit_sptr
2374  second_translation_unit() const;
2375 
2377  compute_diff(const translation_unit_sptr first,
2378  const translation_unit_sptr second,
2379  diff_context_sptr ctxt);
2380 
2381  virtual bool
2382  has_changes() const;
2383 
2384  virtual enum change_kind
2385  has_local_changes() const;
2386 
2387  virtual void
2388  report(ostream& out, const string& indent = "") const;
2389 };//end class translation_unit_diff
2390 
2393  const translation_unit_sptr second,
2395 
2396 /// An abstraction of a diff between between two abi corpus.
2398 {
2399  struct priv;
2400  std::unique_ptr<priv> priv_;
2401 
2402 protected:
2403  corpus_diff(corpus_sptr first,
2404  corpus_sptr second,
2406 
2407  void
2408  finish_diff_type();
2409 
2410 public:
2411 
2412  class diff_stats;
2413 
2414  virtual ~corpus_diff();
2415 
2416  /// A convenience typedef for a shared pointer to @ref diff_stats
2417  typedef shared_ptr<diff_stats> diff_stats_sptr;
2418 
2419  bool
2420  do_log() const;
2421 
2422  void
2423  do_log(bool);
2424 
2425  corpus_sptr
2426  first_corpus() const;
2427 
2428  corpus_sptr
2429  second_corpus() const;
2430 
2431  const vector<diff*>&
2432  children_nodes() const;
2433 
2434  void
2436 
2437  edit_script&
2438  function_changes() const;
2439 
2440  edit_script&
2441  variable_changes() const;
2442 
2443  bool
2444  soname_changed() const;
2445 
2446  bool
2447  architecture_changed() const;
2448 
2450  deleted_functions() const;
2451 
2453  added_functions();
2454 
2457 
2460 
2461  const string_var_ptr_map&
2462  deleted_variables() const;
2463 
2464  const string_var_ptr_map&
2465  added_variables() const;
2466 
2469 
2470  const var_diff_sptrs_type&
2472 
2473  const string_elf_symbol_map&
2475 
2476  const string_elf_symbol_map&
2478 
2479  const string_elf_symbol_map&
2481 
2482  const string_elf_symbol_map&
2484 
2486  deleted_unreachable_types() const;
2487 
2488  const vector<type_base_sptr>&
2490 
2492  added_unreachable_types() const;
2493 
2494  const vector<type_base_sptr>&
2496 
2497  const string_diff_sptr_map&
2498  changed_unreachable_types() const;
2499 
2500  const vector<diff_sptr>&
2502 
2503  const diff_context_sptr
2504  context() const;
2505 
2506  const string&
2507  get_pretty_representation() const;
2508 
2509  bool
2510  has_changes() const;
2511 
2512  bool
2513  has_incompatible_changes() const;
2514 
2515  bool
2516  has_net_subtype_changes() const;
2517 
2518  bool
2519  has_net_changes() const;
2520 
2521  const diff_stats&
2523 
2524  void
2526 
2527  diff_maps&
2528  get_leaf_diffs();
2529 
2530  const diff_maps&
2531  get_leaf_diffs() const;
2532 
2533  virtual void
2534  report(ostream& out, const string& indent = "") const;
2535 
2536  virtual bool
2538 
2539  virtual void
2541 
2542  friend corpus_diff_sptr
2543  compute_diff(const corpus_sptr f,
2544  const corpus_sptr s,
2545  diff_context_sptr ctxt);
2546 
2547  friend void
2548  apply_suppressions(const corpus_diff* diff_tree);
2549 
2550  friend void
2552  const corpus_diff::diff_stats &s,
2553  const string& indent,
2554  ostream& out);
2555 
2556  friend class default_reporter;
2557  friend class leaf_reporter;
2558 }; // end class corpus_diff
2559 
2561 compute_diff(const corpus_sptr,
2562  const corpus_sptr,
2564 
2566 compute_diff(const corpus_group_sptr&,
2567  const corpus_group_sptr&,
2568  diff_context_sptr ctxt);
2569 
2570 /// This is a document class that aims to capture statistics about the
2571 /// changes carried by a @ref corpus_diff type.
2572 ///
2573 /// Its values are populated by the member function
2574 /// corpus_diff::apply_filters_and_suppressions_before_reporting()
2576 {
2577  struct priv;
2578  std::unique_ptr<priv> priv_;
2579 
2580  diff_stats();
2581 
2582 public:
2583 
2585 
2586  size_t num_func_removed() const;
2587  void num_func_removed(size_t);
2588 
2589  size_t num_removed_func_filtered_out() const;
2590  void num_removed_func_filtered_out(size_t);
2591 
2592  size_t net_num_func_removed() const;
2593 
2594  size_t num_func_added() const;
2595  void num_func_added(size_t);
2596 
2597  size_t num_added_func_filtered_out() const;
2598  void num_added_func_filtered_out(size_t);
2599 
2600  size_t net_num_func_added() const;
2601 
2602  size_t num_func_changed() const;
2603  void num_func_changed(size_t);
2604 
2605  size_t num_changed_func_filtered_out() const;
2606  void num_changed_func_filtered_out(size_t);
2607 
2608  size_t num_func_with_virtual_offset_changes() const;
2610 
2611  size_t net_num_func_changed() const;
2612 
2613  size_t num_vars_removed() const;
2614  void num_vars_removed(size_t);
2615 
2616  size_t num_removed_vars_filtered_out() const;
2617  void num_removed_vars_filtered_out(size_t) const;
2618 
2619  size_t net_num_vars_removed() const;
2620 
2621  size_t num_vars_added() const;
2622  void num_vars_added(size_t);
2623 
2624  size_t num_added_vars_filtered_out() const;
2625  void num_added_vars_filtered_out(size_t);
2626 
2627  size_t net_num_vars_added() const;
2628 
2629  size_t num_vars_changed() const;
2630  void num_vars_changed(size_t);
2631 
2632  size_t num_changed_vars_filtered_out() const;
2633  void num_changed_vars_filtered_out(size_t);
2634 
2635  size_t net_num_vars_changed() const;
2636 
2637  size_t num_func_syms_removed() const;
2638  void num_func_syms_removed(size_t);
2639 
2640  size_t num_removed_func_syms_filtered_out() const;
2642 
2643  size_t num_func_syms_added() const;
2644  void num_func_syms_added(size_t);
2645 
2646  size_t num_added_func_syms_filtered_out() const;
2647  void num_added_func_syms_filtered_out(size_t);
2648 
2649  size_t net_num_removed_func_syms() const;
2650  size_t net_num_added_func_syms() const;
2651 
2652  size_t num_var_syms_removed() const;
2653  void num_var_syms_removed(size_t);
2654 
2655  size_t num_removed_var_syms_filtered_out() const;
2656  void num_removed_var_syms_filtered_out(size_t);
2657 
2658  size_t num_var_syms_added() const;
2659  void num_var_syms_added(size_t);
2660 
2661  size_t num_added_var_syms_filtered_out() const;
2662  void num_added_var_syms_filtered_out(size_t);
2663 
2664  size_t net_num_removed_var_syms() const;
2665  size_t net_num_added_var_syms() const;
2666 
2667  size_t num_leaf_changes() const;
2668  void num_leaf_changes(size_t);
2669 
2670  size_t num_leaf_changes_filtered_out() const;
2671  void num_leaf_changes_filtered_out(size_t);
2672 
2673  size_t net_num_leaf_changes() const;
2674 
2675  size_t num_leaf_type_changes() const;
2676  void num_leaf_type_changes(size_t);
2677 
2678  size_t num_leaf_type_changes_filtered_out() const;
2680  size_t net_num_leaf_type_changes() const;
2681 
2682  size_t num_leaf_func_changes() const;
2683  void num_leaf_func_changes(size_t);
2684 
2685  size_t num_leaf_func_changes_filtered_out() const;
2687  size_t net_num_leaf_func_changes() const;
2688 
2689  size_t num_leaf_var_changes() const;
2690  void num_leaf_var_changes(size_t);
2691 
2692  size_t num_leaf_var_changes_filtered_out() const;
2693  void num_leaf_var_changes_filtered_out(size_t);
2694  size_t net_num_leaf_var_changes() const;
2695 
2696  size_t num_added_unreachable_types() const;
2697  void num_added_unreachable_types(size_t);
2698 
2701  size_t net_num_added_unreachable_types() const;
2702 
2703  size_t num_removed_unreachable_types() const;
2704  void num_removed_unreachable_types(size_t);
2705 
2708  size_t net_num_removed_unreachable_types() const;
2709 
2710  size_t num_changed_unreachable_types() const;
2711  void num_changed_unreachable_types(size_t);
2712 
2715  size_t net_num_changed_unreachable_types() const;
2716 
2717 }; // end class corpus_diff::diff_stats
2718 
2719 /// The base class for the node visitors. These are the types used to
2720 /// visit each node traversed by the diff_traversable_base::traverse() method.
2722 {
2723 protected:
2724  struct priv;
2725  std::unique_ptr<priv> priv_;
2726 
2727 public:
2728 
2730 
2731  virtual ~diff_node_visitor();
2732 
2734 
2736  get_visiting_kind() const;
2737 
2738  void
2740 
2741  void
2743 
2744  void
2746 
2747  diff*
2749 
2750  virtual void
2751  visit_begin(diff*);
2752 
2753  virtual void
2755 
2756  virtual void
2757  visit_end(diff*);
2758 
2759  virtual void
2761 
2762  virtual bool
2763  visit(diff*, bool);
2764 
2765  virtual bool
2766  visit(distinct_diff*, bool);
2767 
2768  virtual bool
2769  visit(var_diff*, bool);
2770 
2771  virtual bool
2772  visit(pointer_diff*, bool);
2773 
2774  virtual bool
2775  visit(reference_diff*, bool);
2776 
2777  virtual bool
2778  visit(qualified_type_diff*, bool);
2779 
2780  virtual bool
2781  visit(enum_diff*, bool);
2782 
2783  virtual bool
2784  visit(class_diff*, bool);
2785 
2786  virtual bool
2787  visit(base_diff*, bool);
2788 
2789  virtual bool
2790  visit(scope_diff*, bool);
2791 
2792  virtual bool
2793  visit(function_decl_diff*, bool);
2794 
2795  virtual bool
2796  visit(type_decl_diff*, bool);
2797 
2798  virtual bool
2799  visit(typedef_diff*, bool);
2800 
2801  virtual bool
2802  visit(translation_unit_diff*, bool);
2803 
2804  virtual bool
2805  visit(corpus_diff*, bool);
2806 }; // end struct diff_node_visitor
2807 
2808 void
2809 propagate_categories(diff* diff_tree);
2810 
2811 void
2812 propagate_categories(diff_sptr diff_tree);
2813 
2814 void
2815 propagate_categories(corpus_diff* diff_tree);
2816 
2817 void
2819 
2820 void
2821 apply_suppressions(diff* diff_tree);
2822 
2823 void
2824 apply_suppressions(const corpus_diff* diff_tree);
2825 
2826 void
2827 apply_suppressions(diff_sptr diff_tree);
2828 
2829 void
2831 
2832 void
2833 print_diff_tree(diff* diff_tree, std::ostream&);
2834 
2835 void
2836 print_diff_tree(corpus_diff* diff_tree,
2837  std::ostream&);
2838 
2839 void
2840 print_diff_tree(diff_sptr diff_tree,
2841  std::ostream&);
2842 
2843 void
2845  std::ostream&);
2846 
2847 void
2848 categorize_redundancy(diff* diff_tree);
2849 
2850 void
2851 categorize_redundancy(diff_sptr diff_tree);
2852 
2853 void
2855 
2856 void
2858 
2859 void
2861 
2862 void
2864 
2865 void
2867 
2868 void
2870 
2871 void
2872 apply_filters(corpus_diff_sptr diff_tree);
2873 
2874 bool
2876 
2877 bool
2879 
2880 bool
2882 
2883 bool
2885 
2886 const type_diff_base*
2887 is_type_diff(const diff* diff);
2888 
2889 const decl_diff_base*
2890 is_decl_diff(const diff* diff);
2891 
2892 const type_decl_diff*
2894 
2895 const type_decl_diff*
2896 is_diff_of_basic_type(const diff* diff, bool);
2897 
2898 const class_or_union_diff*
2900 
2901 bool
2903 
2904 const enum_diff*
2905 is_enum_diff(const diff *diff);
2906 
2907 const class_diff*
2908 is_class_diff(const diff* diff);
2909 
2910 const union_diff*
2911 is_union_diff(const diff* diff);
2912 
2913 const class_or_union_diff*
2914 is_class_or_union_diff(const diff* d);
2915 
2916 const class_or_union_diff*
2918 
2919 const subrange_diff*
2920 is_subrange_diff(const diff* diff);
2921 
2922 const array_diff*
2923 is_array_diff(const diff* diff);
2924 
2925 const function_type_diff*
2927 
2928 const function_type_diff*
2930 
2931 const typedef_diff*
2932 is_typedef_diff(const diff *diff);
2933 
2934 const var_diff*
2935 is_var_diff(const diff* diff);
2936 
2937 const function_decl_diff*
2939 
2940 const pointer_diff*
2941 is_pointer_diff(const diff* diff);
2942 
2943 const reference_diff*
2944 is_reference_diff(const diff* diff);
2945 
2946 const qualified_type_diff*
2948 
2949 const fn_parm_diff*
2950 is_fn_parm_diff(const diff* diff);
2951 
2952 const base_diff*
2953 is_base_diff(const diff* diff);
2954 
2955 const distinct_diff*
2956 is_distinct_diff(const diff *diff);
2957 
2958 bool
2960 
2961 bool
2963 
2964 const corpus_diff*
2965 is_corpus_diff(const diff* diff);
2966 
2967 const diff*
2968 peel_typedef_diff(const diff* dif);
2969 
2970 const diff*
2971 peel_pointer_diff(const diff* dif);
2972 
2973 const diff*
2974 peel_reference_diff(const diff* dif);
2975 
2976 const diff*
2977 peel_qualified_diff(const diff* dif);
2978 
2979 const diff*
2980 peel_fn_parm_diff(const diff* dif);
2981 
2982 const diff*
2984 
2985 const diff*
2987 
2988 const diff*
2990 }// end namespace comparison
2991 
2992 }// end namespace abigail
2993 
2994 #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, diff_context_sptr ctxt=diff_context_sptr())
Constructor for array_diff.
const array_type_def_sptr second_array() const
Getter for the second array of the diff.
const array_type_def_sptr first_array() const
Getter for the first array of the diff.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
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 edit_script & member_types_changes() const
const string_member_function_sptr_map & deleted_member_fns() const
class_or_union_sptr first_class_or_union() const
const var_diff_sptrs_type & sorted_subtype_changed_data_members() const
Getter of the sorted vector of data members with a (sub-)type change.
bool lookup_tables_empty(void) const
Tests if the lookup tables are empty.
const string_decl_base_sptr_map & data_members_replaced_by_adms() const
Get the map of data members that got replaced by anonymous data members.
void clear_lookup_tables(void)
Clear the lookup tables useful for reporting.
const string_decl_base_sptr_map & deleted_data_members() const
Getter for the data members that got deleted.
virtual ~class_or_union_diff()
Destructor of class_or_union_diff.
const string_decl_base_sptr_map & inserted_data_members() const
Getter for the data members that got inserted.
void ensure_lookup_tables_populated(void) const
If the lookup tables are not yet built, walk the differences and fill them.
const string_member_function_sptr_map & inserted_member_fns() const
const function_decl_diff_sptrs_type & changed_member_fns() const
Getter for the virtual members functions that have had a change in a sub-type, without having a chang...
const edit_script & data_members_changes() const
const changed_var_sptrs_type & ordered_data_members_replaced_by_adms() const
Get an ordered vector of of data members that got replaced by anonymous data members.
virtual enum change_kind has_local_changes() const
size_t count_filtered_changed_data_members(bool local_only=false) const
Count the number of /filtered/ data members that got replaced by another data member.
const edit_script & member_fns_changes() const
class_or_union_sptr second_class_or_union() const
const var_diff_sptrs_type & sorted_changed_data_members() const
Getter of the sorted vector of data members that got replaced by another data member.
virtual void report(ostream &, const string &indent="") const
Report the changes carried by the current class_or_union_diff node in a textual format.
This is a document class that aims to capture statistics about the changes carried by a corpus_diff t...
size_t num_changed_unreachable_types_filtered_out() const
Getter of the number of changed types that are unreachable from public interfaces and that have been ...
size_t num_func_removed() const
Getter for the number of functions removed.
size_t num_removed_unreachable_types_filtered_out() const
Getter of the number of removed types that are not reachable from public interfaces and that have bee...
size_t num_vars_changed() const
Getter for the number of variables that have a change in one of their sub-types.
size_t net_num_leaf_var_changes() const
Getter for the net number of leaf variable change diff nodes.
size_t num_vars_added() const
Getter for the number of variables added.
size_t num_removed_unreachable_types() const
Getter of the number of removed types that are unreachable from the public interface of the ABI corpu...
size_t num_changed_vars_filtered_out() const
Getter for the number of variables that have a change in one of their sub-types, and that have been f...
size_t num_changed_func_filtered_out() const
Getter for the number of functions that have a change in one of their sub-types, and that have been f...
size_t num_removed_vars_filtered_out() const
Getter for the number removed variables that have been filtered out.
size_t net_num_func_changed() const
Getter for the number of functions that have a change in their sub-types, minus the number of these f...
size_t net_num_vars_removed() const
Getter for the net number of removed variables.
size_t net_num_added_unreachable_types() const
Getter of the number of added types that are unreachable from public interfaces and that are *NOT* fi...
size_t num_removed_var_syms_filtered_out() const
Getter for the number of removed variable symbols, not referenced by any debug info,...
size_t net_num_added_func_syms() const
Getter of the net number of added function symbols that are not referenced by any debug info.
size_t num_added_var_syms_filtered_out() const
Getter for the number of added variable symbols, not referenced by any debug info,...
size_t num_added_unreachable_types() const
Getter of the number of added types that are unreachable from the public interface of the ABI corpus.
size_t net_num_removed_func_syms() const
Getter of the net number of removed function symbols that are not referenced by any debug info.
size_t num_var_syms_added() const
Getter for the number of variable symbols (not referenced by any debug info) that got added.
size_t num_leaf_var_changes() const
Getter for the number of leaf variable change diff nodes.
size_t net_num_removed_var_syms() const
Getter of the net number of removed variable symbols that are not referenced by any debug info.
size_t net_num_func_removed() const
Getter for the net number of function removed.
size_t net_num_func_added() const
Getter for the net number of added functions.
size_t net_num_removed_unreachable_types() const
Getter of the number of removed types that are not reachable from public interfaces and that have *NO...
size_t net_num_leaf_changes() const
Getter of the net number of leaf change diff nodes.
size_t num_removed_func_syms_filtered_out() const
Getter for the number of removed function symbols, not referenced by debug info, that have been filte...
size_t num_added_unreachable_types_filtered_out() const
Getter of the number of added types that are unreachable from public interfaces and that are filtered...
size_t num_added_func_filtered_out() const
Getter for the number of added function that have been filtered out.
size_t num_func_syms_added() const
Getter for the number of function symbols (not referenced by any debug info) that got added.
size_t net_num_leaf_type_changes() const
Getter for the net number of leaf type change diff nodes.
size_t num_func_added() const
Getter for the number of functions added.
size_t net_num_added_var_syms() const
Getter of the net number of added variable symbols that are not referenced by any debug info.
size_t num_leaf_type_changes() const
Getter for the number of leaf type change diff nodes.
size_t num_leaf_var_changes_filtered_out() const
Getter for the number of leaf variable changes diff nodes that have been filtered out.
size_t num_added_vars_filtered_out() const
Getter for the number of added variables that have been filtered out.
size_t num_func_with_virtual_offset_changes() const
Getter for the number of functions that carry virtual member offset changes.
size_t num_func_changed() const
Getter for the number of functions that have a change in one of their sub-types.
size_t num_removed_func_filtered_out() const
Getter for the number of removed functions that have been filtered out.
size_t net_num_vars_added() const
Getter for the net number of added variables.
size_t num_leaf_changes() const
Getter of the number of leaf type change diff nodes.
size_t num_leaf_func_changes_filtered_out() const
Getter for the number of leaf function change diff nodes that were filtered out.
size_t num_added_func_syms_filtered_out() const
Getter for the number of added function symbols, not referenced by any debug info,...
size_t num_leaf_type_changes_filtered_out() const
Getter for the number of filtered out leaf type change diff nodes.
size_t num_changed_unreachable_types() const
Getter of the number of changed types that are unreachable from the public interface of the ABI corpu...
size_t net_num_leaf_func_changes() const
Getter for the net number of leaf function change diff nodes.
size_t num_leaf_func_changes() const
Getter for the number of leaf function change diff nodes.
size_t net_num_changed_unreachable_types() const
Getter of the number of changed types that are unreachable from public interfaces and that have *NOT*...
size_t num_func_syms_removed() const
Getter for the number of function symbols (not referenced by any debug info) that got removed.
size_t num_leaf_changes_filtered_out() const
Getter of the number of leaf type change diff nodes that have been filtered out.
size_t num_vars_removed() const
Getter for the number of variables removed.
size_t num_var_syms_removed() const
Getter for the number of variable symbols (not referenced by any debug info) that got removed.
size_t net_num_vars_changed() const
Getter for the number of variables that have a change in their sub-types, minus the number of these v...
An abstraction of a diff between between two abi corpus.
bool has_incompatible_changes() const
Test if the current instance of corpus_diff carries changes that we are sure are incompatible....
bool has_changes() const
Return true iff the current corpus_diff node carries a change.
void finish_diff_type()
Finish building the current instance of corpus_diff.
virtual void chain_into_hierarchy()
Populate the vector of children node of the corpus_diff type.
const string_var_ptr_map & deleted_variables() const
Getter for the variables that got deleted from the first subject of the diff.
const vector< diff_sptr > & changed_unreachable_types_sorted() const
Getter of a sorted vector of changed types that are not reachable from global functions/variables.
bool soname_changed() const
Test if the soname of the underlying corpus has changed.
friend corpus_diff_sptr compute_diff(const corpus_sptr f, const corpus_sptr s, diff_context_sptr ctxt)
Compute the diff between two instances of corpus.
const vector< type_base_sptr > & deleted_unreachable_types_sorted() const
Getter of a sorted vector of deleted types that are not reachable from global functions/variables.
edit_script & function_changes() const
edit_script & variable_changes() const
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.
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.
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 function_decl_diff_sptrs_type & changed_functions_sorted()
Getter for a sorted vector of functions which signature didn't change, but which do have some indirec...
const string & get_pretty_representation() const
const string_function_ptr_map & deleted_functions() const
Getter for the deleted functions of the diff.
void append_child_node(diff_sptr)
Append a new child node to the vector of children nodes for the current instance of corpus_diff node.
friend void apply_suppressions(const corpus_diff *diff_tree)
Walk a corpus_diff tree and appply the suppressions carried by the context. If the suppression applie...
const string_type_base_sptr_map & added_unreachable_types() const
Getter for a map of added types that are not reachable from global functions/variables.
const string_function_decl_diff_sptr_map & changed_functions()
Getter for the functions which signature didn't change, but which do have some indirect changes in th...
bool architecture_changed() const
Test if the architecture of the underlying corpus has changed.
The base class of diff between decls.
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:154
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 ...
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:267
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.
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:2460
shared_ptr< base_spec > base_spec_sptr
Convenience typedef.
Definition: abg-ir.h:4155
shared_ptr< parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
Definition: abg-ir.h:3044
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.
shared_ptr< diff > diff_sptr
Convenience typedef for a shared_ptr for the diff class.
Definition: abg-fwd.h:76
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.
@ PRIVATE_TYPE_CATEGORY
This means that a diff node was warked as being for a private type. That is, the diff node is meant t...
@ COMPATIBLE_TYPE_CHANGE_CATEGORY
This means the diff node (or at least one of its descendant nodes) carries a change involving two com...
@ TYPE_DECL_ONLY_DEF_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a type that was declaration-only and that is now ...
@ STATIC_DATA_MEMBER_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an addition or removal of a static data member.
@ HARMLESS_DECL_NAME_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless declaration name change....
@ EVERYTHING_CATEGORY
A special enumerator that is the logical 'or' all the enumerators above.
@ NO_CHANGE_CATEGORY
This means the diff node does not carry any (meaningful) change, or that it carries changes that have...
@ HARMLESS_UNION_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless union change.
@ HAS_PARENT_WITH_ALLOWED_CHANGE_CATEGORY
A diff node in this category has a parent node that is in the HAS_ALLOWED_CHANGE_CATEGORY category....
@ BENIGN_INFINITE_ARRAY_CHANGE_CATEGORY
A diff node in this category carries a change in the size of the array type of a global variable,...
@ VAR_TYPE_CV_CHANGE_CATEGORY
A diff node in this category is for a variable which type holds a cv-qualifier change.
@ HAS_ALLOWED_CHANGE_CATEGORY
A diff node in this category carries a change that must be reported, even if the diff node is also in...
@ FN_PARM_TYPE_CV_CHANGE_CATEGORY
A diff node in this category has a function parameter type with a cv-qualifiers change.
@ FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY
A diff node in this category is a function parameter type which top cv-qualifiers change.
@ FN_RETURN_TYPE_CV_CHANGE_CATEGORY
A diff node in this category is a function return type with a cv-qualifier change.
@ HARMLESS_SYMBOL_ALIAS_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an a symbol alias change that is harmless.
shared_ptr< reporter_base > reporter_base_sptr
A convenience typedef for a shared pointer to a reporter_base.
Definition: abg-reporter.h:49
unordered_map< string, var_diff_sptr > string_var_diff_sptr_map
Convenience typedef for a map whose key is a string and whose value is a changed variable of type var...
const class_or_union_diff * is_diff_of_class_or_union_type(const diff *d)
Test if a diff node represents a diff between two class or union types.
const pointer_diff * is_pointer_diff(const diff *diff)
Test if a diff node is about differences between two pointers.
vector< var_diff_sptr > var_diff_sptrs_type
Convenience typedef for a vector of var_diff_sptr.
unordered_map< string, class_decl::base_spec_sptr > string_base_sptr_map
Convenience typedef for a map of string and class_decl::basse_spec_sptr.
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.
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:68
shared_ptr< subrange_diff > subrange_diff_sptr
A convenience typedef for a shared pointer to subrange_diff type.
bool is_diff_of_variadic_parameter_type(const diff *d)
Test if a diff node represents the difference between a variadic parameter type and something else.
diff_category get_default_harmful_categories_bitmap()
Getter of a bitmap made of the set of change categories that are considered harmful.
unordered_map< string, function_decl::parameter_sptr > string_parm_map
Convenience typedef for a map which value is a function parameter. The key is the name of the functio...
unordered_map< string, enum_type_decl::enumerator > string_enumerator_map
Convenience typedef for a map which value is an enumerator. The key is the name of the enumerator.
shared_ptr< var_diff > var_diff_sptr
Convenience typedef for a shared pointer to a var_diff type.
unordered_map< string, method_decl_sptr > string_member_function_sptr_map
Convenience typedef for a hash map of strings and member functions.
const diff * peel_typedef_diff(const diff *dif)
If a diff node is about changes between two typedef types, get the diff node about changes between th...
shared_ptr< reference_diff > reference_diff_sptr
Convenience typedef for a shared pointer on a reference_diff type.
vector< base_diff_sptr > base_diff_sptrs_type
Convenience typedef for a vector of base_diff_sptr.
unordered_map< string, function_decl * > string_function_ptr_map
Convenience typedef for a map which key is a string and which value is a pointer to decl_base.
shared_ptr< function_decl_diff > function_decl_diff_sptr
Convenience typedef for a shared pointer to a function_decl type.
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.
unordered_map< string, var_decl * > string_var_ptr_map
Convenience typedef for a map which key is a string and which value is a point to var_decl.
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, decl_base_sptr > string_decl_base_sptr_map
Convenience typedef for a map which key is a string and which value is a decl_base_sptr.
const class_or_union_diff * is_anonymous_class_or_union_diff(const diff *d)
Test if a diff node is a class_or_union_diff between two anonymous classes or unions.
shared_ptr< base_diff > base_diff_sptr
Convenience typedef for a shared pointer to a base_diff type.
shared_ptr< scope_diff > scope_diff_sptr
Convenience typedef for a shared pointer on a scope_diff.
shared_ptr< class_diff > class_diff_sptr
Convenience typedef for a shared pointer on a class_diff type.
const base_diff * is_base_diff(const diff *diff)
Test if a diff node is about differences between two base class specifiers.
const fn_parm_diff * is_fn_parm_diff(const diff *diff)
Test if a diff node is about differences between two function parameters.
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...
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...
void print_diff_tree(diff *diff_tree, ostream &out)
Emit a textual representation of a diff sub-tree to an output stream.
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...
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:229
shared_ptr< function_decl > function_decl_sptr
Convenience typedef for a shared pointer on a function_decl.
Definition: abg-fwd.h:263
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:541
change_kind
A bitfield that gives callers of abigail::ir::equals() some insight about how different two internal ...
Definition: abg-ir.h:1300
shared_ptr< array_type_def > array_type_def_sptr
Convenience typedef for a shared pointer on a array_type_def.
Definition: abg-fwd.h:234
shared_ptr< class_decl > class_decl_sptr
Convenience typedef for a shared pointer on a class_decl.
Definition: abg-fwd.h:187
shared_ptr< function_type > function_type_sptr
Convenience typedef for a shared pointer on a function_type.
Definition: abg-fwd.h:205
shared_ptr< typedef_decl > typedef_decl_sptr
Convenience typedef for a shared pointer on a typedef_decl.
Definition: abg-fwd.h:161
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
Definition: abg-fwd.h:246
shared_ptr< scope_decl > scope_decl_sptr
Convenience typedef for a shared pointer on a scope_decl.
Definition: abg-fwd.h:258
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:119
shared_ptr< translation_unit > translation_unit_sptr
Convenience typedef for a shared pointer on a translation_unit type.
Definition: abg-fwd.h:134
shared_ptr< pointer_type_def > pointer_type_def_sptr
Convenience typedef for a shared pointer on a pointer_type_def.
Definition: abg-fwd.h:220
shared_ptr< enum_type_decl > enum_type_decl_sptr
Convenience typedef for shared pointer to a enum_type_decl.
Definition: abg-fwd.h:169
shared_ptr< type_decl > type_decl_sptr
Convenience typedef for a shared pointer on a type_decl.
Definition: abg-fwd.h:156
vector< suppression_sptr > suppressions_type
Convenience typedef for a vector of suppression_sptr.
Definition: abg-fwd.h:1533
shared_ptr< suppression_base > suppression_sptr
Convenience typedef for a shared pointer to a suppression.
Definition: abg-fwd.h:1527
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 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