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-2024 Red Hat, Inc.
5//
6// Author: Dodji Seketeli
7
8#ifndef __ABG_COMPARISON_H__
9#define __ABG_COMPARISON_H__
10
11/// @file
12
13#include <memory>
14#include <ostream>
15#include <unordered_map>
16#include <unordered_set>
17#include "abg-corpus.h"
18#include "abg-diff-utils.h"
19#include "abg-reporter.h"
20#include "abg-suppression.h"
21
22namespace abigail
23{
24
25/// @brief utilities to compare abi artifacts
26///
27/// The main entry points of the namespace are the compute_diff()
28/// overloads used to compute the difference between two abi artifacts.
29namespace comparison
30{
31
32namespace filtering
33{
34struct filter_base;
35typedef shared_ptr<filter_base> filter_base_sptr;
36typedef std::vector<filter_base_sptr> filters;
37}
38
39// Inject types we need into this namespace.
40using std::ostream;
41using std::vector;
42using std::unordered_map;
43using std::unordered_set;
44using std::pair;
45
46using diff_utils::insertion;
47using diff_utils::deletion;
48using diff_utils::edit_script;
49
50/// Hasher for @ref diff_sptr.
52{
53 /// The actual hashing functor.
54 size_t
55 operator()(const diff_sptr& t) const
56 {return reinterpret_cast<size_t>(t.get());}
57}; // end struct diff_sptr_hasher
58
59/// Convenience typedef for a vector of @ref diff_sptr.
60typedef vector<diff_sptr> diff_sptrs_type;
61
62/// Convenience typedef for a vector of @ref diff*.
63typedef vector<diff*> diff_ptrs_type;
64
65/// Convenience typedef for an unoredered set of @ref diff_sptr
66typedef unordered_set<diff_sptr, diff_sptr_hasher> unordered_diff_sptr_set;
67
68class decl_diff_base;
69
70/// Convenience typedef for a shared_ptr of @ref decl_diff_base.
71typedef shared_ptr<decl_diff_base> decl_diff_base_sptr;
72
73/// Convenience typedef for a vector of @ref decl_diff_base_sptr.
74typedef vector<decl_diff_base_sptr> decl_diff_base_sptrs_type;
75
76class type_diff_base;
77/// Convenience pointer for a shared pointer to a type_diff_base
78typedef shared_ptr<type_diff_base> type_diff_base_sptr;
79
80/// Convenience typedef for a vector of @ref type_diff_base_sptr
81typedef vector<type_diff_base_sptr> type_diff_base_sptrs_type;
82
84
85/// Convenience typedef for a shared pointer to a @ref function_decl type.
86typedef shared_ptr<function_decl_diff> function_decl_diff_sptr;
87
88/// Convenience typedef for a vector of @ref function_decl_diff_sptr
89typedef vector<function_decl_diff_sptr> function_decl_diff_sptrs_type;
90
91class fn_parm_diff;
92
93/// Convenience typedef for a shared pointer to a @ref fn_parm_diff
94/// type.
95typedef shared_ptr<fn_parm_diff> fn_parm_diff_sptr;
96
97class var_diff;
98
99/// Convenience typedef for a shared pointer to a @ref var_diff type.
100typedef shared_ptr<var_diff> var_diff_sptr;
101
102/// Convenience typedef for a vector of @ref var_diff_sptr.
103typedef vector<var_diff_sptr> var_diff_sptrs_type;
104
105class base_diff;
106
107/// Convenience typedef for a shared pointer to a @ref base_diff type.
108typedef shared_ptr<base_diff> base_diff_sptr;
109
110/// Convenience typedef for a vector of @ref base_diff_sptr.
111typedef vector<base_diff_sptr> base_diff_sptrs_type;
112
113class class_diff;
114
115/// Convenience typedef for a shared pointer on a @ref class_diff type.
116typedef shared_ptr<class_diff> class_diff_sptr;
117
118/// Convenience typedef for a map of pointer values. The Key is a
119/// pointer value and the value is potentially another pointer value
120/// associated to the first one.
121typedef unordered_map<size_t, size_t> pointer_map;
122
123/// Convenience typedef for a map which key is a string and which
124/// value is a @ref type_base_sptr.
125typedef unordered_map<string, type_base_sptr> string_type_base_sptr_map;
126
127/// Convenience typedef for a map which key is an unsigned integer and
128/// which value is a @ref decl_base_sptr
129typedef unordered_map<unsigned, decl_base_sptr> unsigned_decl_base_sptr_map;
130
131/// Convenience typedef for a map of string and class_decl::basse_spec_sptr.
132typedef unordered_map<string, class_decl::base_spec_sptr> string_base_sptr_map;
133
134/// Convenience typedef for a map of string and @ref base_diff_sptr.
135typedef unordered_map<string, base_diff_sptr> string_base_diff_sptr_map;
136
137/// Convenience typedef for a map which value is a changed function
138/// parameter and which key is the name of the function parameter.
139typedef unordered_map<string, fn_parm_diff_sptr> string_fn_parm_diff_sptr_map;
140
141/// Convenience typedef for a map which key is an integer and which
142/// value is a changed parameter.
143typedef unordered_map<unsigned, fn_parm_diff_sptr>
145
146/// Convenience typedef for a map which key is an integer and which
147/// value is a parameter.
148typedef unordered_map<unsigned,
150
151/// Convenience typedef for a map which value is a
152/// type_diff_base_sptr. The key of the map is the qualified name of
153/// the changed type.
154typedef unordered_map<string,
156
157/// Convenience typedef for a map which value is a
158/// decl_diff_base_sptr. The key of the map is the qualified name of
159/// the changed type.
160typedef unordered_map<string,
162
163/// Convenience typedef for a map which value is a diff_sptr. The key
164/// of the map is the qualified name of the changed type.
165typedef unordered_map<string, diff_sptr> string_diff_sptr_map;
166
167/// Convenience typedef for a map which value is a diff*. The key of
168/// the map is the qualified name of the changed type.
169typedef unordered_map<string, diff*> string_diff_ptr_map;
170
171/// Convenience typedef for a map whose key is a string and whose
172/// value is a changed variable of type @ref var_diff_sptr.
173typedef unordered_map<string,
175
176
177/// Convenience typedef for a map whose key is an unsigned int and
178/// whose value is a changed variable of type @ref var_diff_sptr.
179typedef unordered_map<unsigned, var_diff_sptr> unsigned_var_diff_sptr_map;
180
181/// Convenience typedef for a map which value is a function
182/// parameter. The key is the name of the function parm.
183typedef unordered_map<string, function_decl::parameter_sptr> string_parm_map;
184
185/// Convenience typedef for a map which value is an enumerator. The
186/// key is the name of the enumerator.
187typedef unordered_map<string, enum_type_decl::enumerator> string_enumerator_map;
188
189/// Convenience typedef for a changed enumerator. The first element
190/// of the pair is the old enumerator and the second one is the new enumerator.
191typedef std::pair<enum_type_decl::enumerator,
192 enum_type_decl::enumerator> changed_enumerator;
193
194/// Convenience typedef for a vector of changed enumerators.
195typedef vector<changed_enumerator> changed_enumerators_type;
196
197/// Convenience typedef for a map which value is a changed enumerator.
198/// The key is the name of the changed enumerator.
199typedef unordered_map<string, changed_enumerator> string_changed_enumerator_map;
200
201/// Convenience typedef for a map which key is a string and which
202/// value is a pointer to @ref decl_base.
203typedef unordered_map<string, const function_decl*> string_function_ptr_map;
204
205/// Convenience typedef for a map which key is a string and which
206/// value is a @ref function_decl_diff_sptr.
207typedef unordered_map<string,
210
211/// Convenience typedef for a pair of class_decl::member_function_sptr
212/// representing a changed member function. The first element of the
213/// pair is the initial member function and the second element is the
214/// changed one.
215typedef pair<method_decl_sptr,
217
218/// Convenience typedef for a hash map of strings and changed member functions.
219typedef unordered_map<string,
222
223/// Convenience typedef for a hash map of strings and member functions.
224typedef unordered_map<string, method_decl_sptr> string_member_function_sptr_map;
225
226/// Convenience typedef for a map which key is a string and which
227/// value is a point to @ref var_decl.
228typedef unordered_map<string, const var_decl*> string_var_ptr_map;
229
230/// Convenience typedef for a pair of pointer to @ref var_decl
231/// representing a @ref var_decl change. The first member of the pair
232/// represents the initial variable and the second member represents
233/// the changed variable.
234typedef std::pair<var_decl*, var_decl*> changed_var_ptr;
235
236/// Convenience typedef for a pair of @ref var_decl_sptr representing
237/// a @ref var_decl change. The first member of the pair represents
238/// the initial variable and the second member represents the changed
239/// variable.
240typedef std::pair<var_decl_sptr, var_decl_sptr> changed_var_sptr;
241
242/// Convenience typedef for a vector of @changed_var_sptr.gg381
243typedef vector<changed_var_sptr> changed_var_sptrs_type;
244
245/// Convenience typedef for a map whose key is a string and whose
246/// value is an @ref elf_symbol_sptr.
247typedef unordered_map<string, elf_symbol_sptr> string_elf_symbol_map;
248
249/// Convenience typedef for a map which key is a string and which
250/// value is a @ref var_diff_sptr.
251typedef unordered_map<string, var_diff_sptr> string_var_diff_ptr_map;
252
254
256
257/// Convenience typedef for shared_ptr on diff_traversable_base.
258typedef shared_ptr<diff_traversable_base> diff_traversable_base_sptr;
259
260/// An enum for the different ways to visit a diff tree node.
261///
262/// This is used by the node traversing code, to know when to avoid
263/// visiting children nodes, for instance.
265{
266 /// The default enumerator value of this enum. It doesn't have any
267 /// particular meaning yet.
269
270 /// This says that the traversing code should avoid visiting the
271 /// children nodes of the current node being visited.
273
274 /// This says that the traversing code should not mark visited nodes
275 /// as having been traversed. This is useful, for instance, for
276 /// visitors which have debugging purposes.
279
282
285
288
289/// The base class for the diff classes that are to be traversed.
291{
292public:
293 virtual bool
295}; // end struct diff_traversable_base
296
297/// An enum for the different categories that a diff tree node falls
298/// into, regarding the kind of changes it represents.
299///
300/// Note that if you add an enumerator to this enum, you need to
301/// update a few spots accordingly:
302///
303/// * update the ACCESS_CHANGE_CATEGORY enumerator (which is the
304/// last enumerator of this enum by OR-ing its initializer with
305/// the new enumerator.
306///
307/// * update the categorize_harmless_diff_node or
308/// categorize_harmful_diff_node function depending on if the new
309/// enumerator classifies diff nodes as harmless or harmful.
310///
311/// * update the get_default_harmless_categories_bitmap or
312/// get_default_harmful_categories_bitmap function as well, just
313/// like above.
314///
315/// * update the "operator<<(ostream& o, diff_category c)" streaming
316/// operator so that it can stream the new enumerator to a textual
317/// output stream.
319{
320 /// This means the diff node does not carry any (meaningful) change,
321 /// or that it carries changes that have not yet been categorized.
323
324 /// This means the diff node (or at least one of its descendant
325 /// nodes) carries access related changes, e.g, a private member
326 /// that becomes public.
328
329 /// This means the diff node (or at least one of its descendant
330 /// nodes) carries a change involving two compatible types. For
331 /// instance a type and its typedefs.
333
334 /// This means that a diff node in the sub-tree carries a harmless
335 /// declaration name change. This is set only for name changes for
336 /// data members and typedefs.
338
339 /// This means that a diff node in the sub-tree carries an addition
340 /// or removal of a non-virtual member function.
342
343 /// This means that a diff node in the sub-tree carries an addition
344 /// or removal of a static data member.
346
347 /// This means that a diff node in the sub-tree carries an addition
348 /// of enumerator to an enum type.
350
351 /// This means that a diff node in the sub-tree carries an a symbol
352 /// alias change that is harmless.
354
355 /// This means that a diff node in the sub-tree carries a harmless
356 /// union or class change.
358
359 /// This means that a diff node in the sub-tree carries a harmless
360 /// data member change. An example of harmless data member change
361 /// is an anonymous data member that replaces a given data member
362 /// without locally changing the layout.
364
365 /// This means that a diff node was marked as suppressed by a
366 /// user-provided suppression specification.
368
369 /// This means that a diff node was warked as being for a private
370 /// type. That is, the diff node is meant to be suppressed by a
371 /// suppression specification that was auto-generated to filter out
372 /// changes to private types.
374
375 /// This means the diff node (or at least one of its descendant
376 /// nodes) carries a change that modifies the size of a type or an
377 /// offset of a type member. Removal or changes of enumerators in a
378 /// enum fall in this category too.
380
381 /// This means that a diff node in the sub-tree carries an
382 /// incompatible change to a vtable.
384
385 /// A diff node in this category is redundant. That means it's
386 /// present as a child of a other nodes in the diff tree.
388
389 /// This means that a diff node in the sub-tree carries a type that
390 /// was declaration-only and that is now defined, or vice versa.
392
393 /// A diff node in this category is a function parameter type which
394 /// top cv-qualifiers change.
396
397 /// A diff node in this category has a function parameter type with a
398 /// cv-qualifiers change.
400
401 /// A diff node in this category is a function return type with a
402 /// cv-qualifier change.
404
405 /// A diff node in this category is a function (or function type)
406 /// with at least one parameter added or removed.
408
409 /// A diff node in this category is for a variable which type holds
410 /// a cv-qualifier change.
412
413 /// A diff node in this category carries a change from void pointer
414 /// to non-void pointer.
416
417 /// A diff node in this category carries a change in the size of the
418 /// array type of a global variable, but the ELF size of the
419 /// variable didn't change.
421
422 /// A diff node in this category carries a change that must be
423 /// reported, even if the diff node is also in the
424 /// SUPPRESSED_CATEGORY or PRIVATE_TYPE_CATEGORY categories.
425 /// Typically, this node matches a suppression specification like
426 /// the [allow_type] directive.
428
429 /// A diff node in this category has a descendant node that is in
430 /// the HAS_ALLOWED_CHANGE_CATEGORY category. Nodes in this
431 /// category must be reported, even if they are also in the
432 /// SUPPRESSED_CATEGORY or PRIVATE_TYPE_CATEGORY categories.
434
435 /// A diff node in this category has a parent node that is in the
436 /// HAS_ALLOWED_CHANGE_CATEGORY category. Nodes in this category
437 /// must be reported, even if they are also in the
438 /// SUPPRESSED_CATEGORY or PRIVATE_TYPE_CATEGORY categories.
440
441 /// A special enumerator that is the logical 'or' all the
442 /// enumerators above.
443 ///
444 /// This one must stay the last enumerator. Please update it each
445 /// time you add a new enumerator above.
472}; // enum diff_category
473
476
478operator|=(diff_category& c1, diff_category c2);
479
481operator&=(diff_category& c1, diff_category c2);
482
484operator^(diff_category c1, diff_category c2);
485
488
491
494
497
498ostream&
499operator<<(ostream& o, diff_category);
500
501class corpus_diff;
502
503/// This type contains maps. Each map associates a type name to a
504/// diff of that type. Not all kinds of diffs are present; only those
505/// that carry leaf changes are, for now.
507{
508 struct priv;
509 std::unique_ptr<priv> priv_;
510
511public:
512
513 diff_maps();
514
515 ~diff_maps();
516
519
522
524 get_enum_diff_map() const;
525
528
530 get_class_diff_map() const;
531
534
536 get_union_diff_map() const;
537
540
542 get_typedef_diff_map() const;
543
546
548 get_subrange_diff_map() const;
549
552
554 get_array_diff_map() const;
555
558
561
564
566 get_fn_parm_diff_map() const;
567
570
573
576
579
582
584 get_var_decl_diff_map() const;
585
588
590 get_distinct_diff_map() const;
591
594
595 bool
596 insert_diff_node(const diff *d,
597 const type_or_decl_base_sptr& impacted_iface);
598
600 lookup_impacted_interfaces(const diff *d) const;
601}; // end class diff_maps
602
603/// A convenience typedef for a shared pointer to @ref corpus_diff.
604typedef shared_ptr<corpus_diff> corpus_diff_sptr;
605
606/// The context of the diff. This type holds various bits of
607/// information that is going to be used throughout the diffing of two
608/// entities and the reporting that follows.
610{
611 struct priv;
612 std::unique_ptr<priv> priv_;
613
615 has_diff_for(const type_or_decl_base_sptr first,
616 const type_or_decl_base_sptr second) const;
617
619 has_diff_for_types(const type_base_sptr first,
620 const type_base_sptr second) const;
621
622 const diff*
623 has_diff_for(const diff* d) const;
624
626 has_diff_for(const diff_sptr d) const;
627
628 void
629 add_diff(const type_or_decl_base_sptr first,
630 const type_or_decl_base_sptr second,
631 const diff_sptr d);
632
633 void
634 add_diff(const diff_sptr d);
635
636 void
637 add_diff(const diff* d);
638
639 void
640 set_canonical_diff_for(const type_or_decl_base_sptr first,
641 const type_or_decl_base_sptr second,
642 const diff_sptr);
643
645 set_or_get_canonical_diff_for(const type_or_decl_base_sptr first,
646 const type_or_decl_base_sptr second,
647 const diff_sptr canonical_diff);
648
649public:
650 diff_context();
651
653
654 bool
655 do_log() const;
656
657 void
658 do_log(bool);
659
660 void
662
663 const corpus_diff_sptr&
664 get_corpus_diff() const;
665
666 corpus_sptr
667 get_first_corpus() const;
668
669 corpus_sptr
670 get_second_corpus() const;
671
673 get_reporter() const;
674
675 void
677
680 const type_or_decl_base_sptr second) const;
681
683 get_canonical_diff_for(const diff_sptr d) const;
684
685 void
687
688 void
690
691 diff*
692 diff_has_been_visited(const diff*) const;
693
695 diff_has_been_visited(const diff_sptr) const;
696
697 void
699
700 void
702
703 void
704 mark_last_diff_visited_per_class_of_equivalence(const diff*);
705
706 void
707 clear_last_diffs_visited_per_class_of_equivalence();
708
709 const diff*
710 get_last_visited_diff_of_class_of_equivalence(const diff*);
711
712 void
714
715 bool
717
718 void
720
721 bool
723
725 get_allowed_category() const;
726
727 void
729
730 void
732
733 void
735
736 const filtering::filters&
737 diff_filters() const;
738
739 void
741
742 void
744
745 void
747
749 suppressions() const;
750
752 suppressions();
753
755 negated_suppressions() const;
756
758 direct_suppressions() const;
759
760 void
762
763 void
765
766 bool
768
769 void
771
772 void
774
775 bool
777
778 bool
779 show_hex_values() const;
780
781 void
782 show_hex_values(bool f);
783
784 bool
786
787 void
789
790 void
792
793 bool
795
796 void
797 show_stats_only(bool f);
798
799 bool
800 show_stats_only() const;
801
802 void
803 show_soname_change(bool f);
804
805 bool
806 show_soname_change() const;
807
808 void
810
811 bool
813
814 void
815 show_deleted_fns(bool f);
816
817 bool
818 show_deleted_fns() const;
819
820 void
821 show_changed_fns(bool f);
822
823 bool
824 show_changed_fns() const;
825
826 void
827 show_added_fns(bool f);
828
829 bool
830 show_added_fns() const;
831
832 void
833 show_deleted_vars(bool f);
834
835 bool
836 show_deleted_vars() const;
837
838 void
839 show_changed_vars(bool f);
840
841 bool
842 show_changed_vars() const;
843
844 void
845 show_added_vars(bool f);
846
847 bool
848 show_added_vars() const;
849
850 bool
851 show_linkage_names() const;
852
853 void
854 show_linkage_names(bool f);
855
856 bool
857 show_locs() const;
858
859 void
860 show_locs(bool f);
861
862 bool
864
865 void
867
868 bool
870
871 void
873
874 bool
876
877 void
879
880 void show_unreachable_types(bool f);
881
883
884 bool
886
887 void
889
890 void
891 default_output_stream(ostream*);
892
893 ostream*
895
896 void
897 error_output_stream(ostream*);
898
899 ostream*
900 error_output_stream() const;
901
902 bool
903 dump_diff_tree() const;
904
905 void
906 dump_diff_tree(bool f);
907
908 void
909 do_dump_diff_tree(const diff_sptr) const;
910
911 void
913
914 friend class_diff_sptr
915 compute_diff(const class_decl_sptr first,
916 const class_decl_sptr second,
917 diff_context_sptr ctxt);
918};//end struct diff_context.
919
920/// The abstraction of a change between two ABI artifacts, a.k.a an
921/// artifact change.
922///
923/// In the grand scheme of things, a diff is strongly typed; for
924/// instance, a change between two enums is represented by an
925/// enum_diff type. A change between two function_type is represented
926/// by a function_type_diff type and a change between two class_decl
927/// is represented by a class_diff type. All of these types derive
928/// from the @ref diff parent class.
929///
930/// An artifact change D can have one (or more) details named D'. A
931/// detail is an artifact change that "belongs" to another one. Here,
932/// D' belongs to D. Or said otherwise, D' is a child change of D.
933/// Said otherwise, D and D' are related, and the relation is a
934/// "child relation".
935///
936/// For instance, if we consider a change carried by a class_diff, the
937/// detail change might be a change on one data member of the class.
938/// In other word, the class_diff change might have a child diff node
939/// that would be a var_diff node.
940///
941/// There are two ways to get the child var_diff node (for the data
942/// member change detail) of the class_diff.
943///
944/// The first way is through the typed API, that is, through the
945/// class_diff::sorted_changed_data_members() member function which
946/// returns var_diff nodes.
947///
948/// The second way is through the generic API, that is, through the
949/// diff::children_nodes() member function which returns generic diff
950/// nodes. This second way enables us to walk the diff nodes graph in
951/// a generic way, regardless of the types of the diff nodes.
952///
953/// Said otherwise, there are two views for a given diff node. There
954/// is typed view, and there is the generic view. In the typed view,
955/// the details are accessed through the typed API. In the generic
956/// view, the details are gathered through the generic view.
957///
958///
959/// Please read more about the @ref DiffNode "IR" of the comparison
960/// engine to learn more about this.
961///
962/// This type encapsulates an edit script (a set of insertions and
963/// deletions) for two constructs that are to be diff'ed. The two
964/// constructs are called the "subjects" of the diff.
966{
967 friend class diff_context;
968
969 // Forbidden
970 diff();
971
972protected:
973 struct priv;
974 std::unique_ptr<priv> priv_;
975
978
981 diff_context_sptr ctxt);
982
983 bool
984 do_log() const;
985
986 void
987 do_log(bool);
988
989 void
991
992 void
994
995 virtual void
997
998 void
1000
1001public:
1003 first_subject() const;
1004
1006 second_subject() const;
1007
1008 const vector<diff*>&
1009 children_nodes() const;
1010
1011 const diff*
1012 parent_node() const;
1013
1014 diff* get_canonical_diff() const;
1015
1016 bool
1017 is_traversing() const;
1018
1019 void
1021
1022 const diff_context_sptr
1023 context() const;
1024
1025 void
1027
1028 bool
1029 currently_reporting() const;
1030
1031 void
1032 currently_reporting(bool f) const;
1033
1034 bool
1035 reported_once() const;
1036
1037 void
1038 reported_once(bool f) const;
1039
1041 get_category() const;
1042
1044 get_local_category() const;
1045
1048
1051
1054
1055 void
1057
1060
1063
1064 void
1066
1067 void
1069
1070 bool
1071 is_filtered_out() const;
1072
1073 bool
1075
1076 bool
1078
1079 bool
1080 is_suppressed() const;
1081
1082 bool
1083 is_suppressed(bool &is_private_type) const;
1084
1085 bool
1086 to_be_reported() const;
1087
1088 bool
1090
1091 bool
1093
1094 bool
1096
1097 bool
1099
1100 virtual const string&
1102
1103 /// This constructs the relation between this diff node and its
1104 /// detail diff nodes, in the generic view of the diff node.
1105 ///
1106 /// Each specific typed diff node should implement how the typed
1107 /// view "links" itself to its detail nodes in the generic sense.
1108 virtual void
1110
1111 /// Pure interface to get the length of the changes encapsulated by
1112 /// this diff. A length of zero means that the current instance of
1113 /// @ref diff doesn't carry any change.
1114 ///
1115 /// This is to be implemented by all descendants of this type.
1116 virtual bool
1117 has_changes() const = 0;
1118
1119 /// Pure interface to know if the current instance of @diff carries
1120 /// a local change. A local change is a change that is on the @ref
1121 /// diff object itself, as opposed to a change that is carried by
1122 /// some of its children nodes.
1123 ///
1124 /// This is to be implemented by all descendants of this type.
1125 virtual enum change_kind
1127
1128 /// Pure interface to report the diff in a serialized form that is
1129 /// legible for the user.
1130 ///
1131 /// Note that the serializd report has to leave one empty line at
1132 /// the end of its content.
1133 ///
1134 /// @param out the output stream to serialize the report to.
1135 ///
1136 /// @param indent the indentation string to use.
1137 virtual void
1138 report(ostream& out, const string& indent = "") const = 0;
1139
1140 virtual bool
1142};// end class diff
1143
1145compute_diff(const decl_base_sptr,
1146 const decl_base_sptr,
1147 diff_context_sptr ctxt);
1148
1150compute_diff(const type_base_sptr,
1151 const type_base_sptr,
1152 diff_context_sptr ctxt);
1153
1154/// The base class of diff between types.
1155class type_diff_base : public diff
1156{
1157 struct priv;
1158 std::unique_ptr<priv> priv_;
1159
1161
1162protected:
1163 type_diff_base(type_base_sptr first_subject,
1164 type_base_sptr second_subject,
1165 diff_context_sptr ctxt);
1166
1167public:
1168
1169 virtual enum change_kind
1171
1172 virtual ~type_diff_base();
1173};// end class type_diff_base
1174
1175/// The base class of diff between decls.
1176class decl_diff_base : public diff
1177{
1178 struct priv;
1179 std::unique_ptr<priv> priv_;
1180
1181protected:
1182 decl_diff_base(decl_base_sptr first_subject,
1183 decl_base_sptr second_subject,
1184 diff_context_sptr ctxt);
1185
1186public:
1187
1188 virtual enum change_kind
1190
1191 virtual ~decl_diff_base();
1192};// end class decl_diff_base
1193
1194string
1196
1197class distinct_diff;
1198
1199/// Convenience typedef for a shared pointer to distinct_types_diff
1200typedef shared_ptr<distinct_diff> distinct_diff_sptr;
1201
1202/// An abstraction of a diff between entities that are of a different
1203/// kind (disctinct).
1204class distinct_diff : public diff
1205{
1206 struct priv;
1207 std::unique_ptr<priv> priv_;
1208
1209protected:
1213
1214public:
1215
1217 first() const;
1218
1220 second() const;
1221
1222 const diff_sptr
1223 compatible_child_diff() const;
1224
1225 virtual const string&
1227
1228 virtual bool
1229 has_changes() const;
1230
1231 virtual enum change_kind
1232 has_local_changes() const;
1233
1234 virtual void
1235 report(ostream& out, const string& indent = "") const;
1236
1237 virtual void
1239
1240 static bool
1243
1244 friend distinct_diff_sptr
1247 diff_context_sptr ctxt);
1248};// end class distinct_types_diff
1249
1253 diff_context_sptr ctxt);
1254
1255/// Abstracts a diff between two instances of @ref var_decl
1257{
1258 struct priv;
1259 std::unique_ptr<priv> priv_;
1260
1261protected:
1262 var_diff(var_decl_sptr first,
1263 var_decl_sptr second,
1266
1267public:
1269 first_var() const;
1270
1272 second_var() const;
1273
1274 diff_sptr
1275 type_diff() const;
1276
1277 virtual void
1279
1280 virtual bool
1281 has_changes() const;
1282
1283 virtual enum change_kind
1284 has_local_changes() const;
1285
1286 virtual void
1287 report(ostream& out, const string& indent = "") const;
1288
1289 virtual const string&
1291
1292 friend var_diff_sptr
1293 compute_diff(const var_decl_sptr first,
1294 const var_decl_sptr second,
1295 diff_context_sptr ctxt);
1296};// end class var_diff
1297
1300
1301class pointer_diff;
1302/// Convenience typedef for a shared pointer on a @ref
1303/// pointer_diff type.
1304typedef shared_ptr<pointer_diff> pointer_diff_sptr;
1305
1306/// The abstraction of a diff between two pointers.
1308{
1309 struct priv;
1310 std::unique_ptr<priv> priv_;
1311
1312protected:
1314 pointer_type_def_sptr second,
1317
1318public:
1320 first_pointer() const;
1321
1323 second_pointer() const;
1324
1325 diff_sptr
1326 underlying_type_diff() const;
1327
1328 void
1330
1331 virtual const string&
1333
1334 virtual bool
1335 has_changes() const;
1336
1337 virtual enum change_kind
1338 has_local_changes() const;
1339
1340 virtual void
1341 report(ostream&, const string& indent = "") const;
1342
1343 virtual void
1345
1346 friend pointer_diff_sptr
1348 pointer_type_def_sptr second,
1349 diff_context_sptr ctxt);
1350};// end class pointer_diff
1351
1354 pointer_type_def_sptr second,
1355 diff_context_sptr ctxt);
1356
1357class reference_diff;
1358
1359/// Convenience typedef for a shared pointer on a @ref
1360/// reference_diff type.
1361typedef shared_ptr<reference_diff> reference_diff_sptr;
1362
1363/// The abstraction of a diff between two references.
1365{
1366 struct priv;
1367 std::unique_ptr<priv> priv_;
1368
1369protected:
1371 const reference_type_def_sptr second,
1372 diff_sptr underlying,
1374
1375public:
1377 first_reference() const;
1378
1380 second_reference() const;
1381
1382 const diff_sptr&
1383 underlying_type_diff() const;
1384
1385 diff_sptr&
1387
1388 virtual const string&
1390
1391 virtual bool
1392 has_changes() const;
1393
1394 virtual enum change_kind
1395 has_local_changes() const;
1396
1397 virtual void
1398 report(ostream&, const string& indent = "") const;
1399
1400 virtual void
1402
1403 friend reference_diff_sptr
1406 diff_context_sptr ctxt);
1407};// end class reference_diff
1408
1412 diff_context_sptr ctxt);
1413
1414
1415class ptr_to_mbr_diff;
1416
1417/// Typedef of a shared_ptr to @ref ptr_to_mbr_diff
1418typedef shared_ptr<ptr_to_mbr_diff> ptr_to_mbr_diff_sptr;
1419
1420/// The abstraction of a diff between two @ref ptr_to_mbr_type.
1422{
1423 struct priv;
1424 std::unique_ptr<priv> priv_;
1425
1426 ptr_to_mbr_diff() = default;
1427
1428protected:
1430 const ptr_to_mbr_type_sptr& second,
1433 diff_context_sptr ctxt);
1434
1435public:
1436
1438 first_ptr_to_mbr_type() const;
1439
1441 second_ptr_to_mbr_type() const;
1442
1443 const diff_sptr
1444 member_type_diff() const;
1445
1446 const diff_sptr
1447 containing_type_diff() const;
1448
1449 virtual bool
1450 has_changes() const;
1451
1452 virtual enum change_kind
1453 has_local_changes() const;
1454
1455 virtual const string&
1457
1458 virtual void
1459 report(ostream&, const string& indent = "") const;
1460
1461 virtual void
1463
1464 virtual ~ptr_to_mbr_diff();
1465
1468 const ptr_to_mbr_type_sptr& second,
1469 diff_context_sptr& ctxt);
1470}; // end class ptr_to_mbr_diff
1471
1474 const ptr_to_mbr_type_sptr& second,
1475 diff_context_sptr& ctxt);
1476
1477class subrange_diff;
1478
1479/// A convenience typedef for a shared pointer to subrange_diff type.
1480typedef shared_ptr<subrange_diff> subrange_diff_sptr;
1481
1482/// The abstraction of the diff between two subrange types.
1484{
1485 struct priv;
1486 std::unique_ptr<priv> priv_;
1487
1488protected:
1490 const array_type_def::subrange_sptr& second,
1492 const diff_context_sptr ctxt = diff_context_sptr());
1493
1494public:
1496 first_subrange() const;
1497
1499 second_subrange() const;
1500
1501 const diff_sptr
1502 underlying_type_diff() const;
1503
1504 virtual const string&
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 subrange_diff_sptr
1522 diff_context_sptr ctxt);
1523}; // end subrange_diff
1524
1528 diff_context_sptr ctxt);
1529
1530
1531class array_diff;
1532
1533/// Convenience typedef for a shared pointer on a @ref
1534/// array_diff type.
1535typedef shared_ptr<array_diff> array_diff_sptr;
1536
1537/// The abstraction of a diff between two arrays.
1539{
1540 struct priv;
1541 std::unique_ptr<priv> priv_;
1542
1543protected:
1544 array_diff(const array_type_def_sptr first,
1545 const array_type_def_sptr second,
1548
1549public:
1551 first_array() const;
1552
1554 second_array() const;
1555
1556 const diff_sptr&
1557 element_type_diff() const;
1558
1559 void
1561
1562 virtual const string&
1564
1565 virtual bool
1566 has_changes() const;
1567
1568 virtual enum change_kind
1569 has_local_changes() const;
1570
1571 virtual void
1572 report(ostream&, const string& indent = "") const;
1573
1574 virtual void
1576
1577 friend array_diff_sptr
1579 array_type_def_sptr second,
1580 diff_context_sptr ctxt);
1581};// end class array_diff
1582
1585 array_type_def_sptr second,
1586 diff_context_sptr ctxt);
1587
1589typedef class shared_ptr<qualified_type_diff> qualified_type_diff_sptr;
1590
1591/// Abstraction of a diff between two qualified types.
1593{
1594 struct priv;
1595 std::unique_ptr<priv> priv_;
1596
1597protected:
1598 qualified_type_diff(qualified_type_def_sptr first,
1599 qualified_type_def_sptr second,
1600 diff_sptr underling,
1602
1603public:
1604 const qualified_type_def_sptr
1605 first_qualified_type() const;
1606
1607 const qualified_type_def_sptr
1608 second_qualified_type() const;
1609
1610 diff_sptr
1611 underlying_type_diff() const;
1612
1613 void
1615
1616 diff_sptr
1618
1619 virtual const string&
1621
1622 virtual bool
1623 has_changes() const;
1624
1625 virtual enum change_kind
1626 has_local_changes() const;
1627
1628 virtual void
1629 report(ostream&, const string& indent = "") const;
1630
1631 virtual void
1633
1634 friend qualified_type_diff_sptr
1635 compute_diff(const qualified_type_def_sptr first,
1636 const qualified_type_def_sptr second,
1637 diff_context_sptr ctxt);
1638};// end class qualified_type_diff.
1639
1640qualified_type_diff_sptr
1641compute_diff(const qualified_type_def_sptr first,
1642 const qualified_type_def_sptr second,
1643 diff_context_sptr ctxt);
1644
1645class enum_diff;
1646typedef shared_ptr<enum_diff> enum_diff_sptr;
1647
1648/// Abstraction of a diff between two enums.
1650{
1651 struct priv;
1652 std::unique_ptr<priv> priv_;
1653
1654 void
1655 clear_lookup_tables();
1656
1657 bool
1658 lookup_tables_empty() const;
1659
1660 void
1661 ensure_lookup_tables_populated();
1662
1663protected:
1665 const enum_type_decl_sptr,
1666 const diff_sptr,
1668
1669public:
1671 first_enum() const;
1672
1674 second_enum() const;
1675
1676 diff_sptr
1677 underlying_type_diff() const;
1678
1680 deleted_enumerators() const;
1681
1683 inserted_enumerators() const;
1684
1686 changed_enumerators() const;
1687
1688 virtual const string&
1690
1691 virtual bool
1692 has_changes() const;
1693
1694 virtual enum change_kind
1695 has_local_changes() const;
1696
1697 virtual void
1698 report(ostream&, const string& indent = "") const;
1699
1700 virtual void
1702
1703 friend enum_diff_sptr
1705 const enum_type_decl_sptr second,
1706 diff_context_sptr ctxt);
1707};//end class enum_diff;
1708
1709enum_diff_sptr
1711 const enum_type_decl_sptr,
1713
1714/// This is the base class of @ref class_diff and @ref union_diff.
1716{
1717protected:
1718 struct priv;
1719 typedef std::unique_ptr<priv> priv_ptr;
1720 priv_ptr priv_;
1721
1722 void
1723 clear_lookup_tables(void);
1724
1725 bool
1726 lookup_tables_empty(void) const;
1727
1728 void
1730
1731 void
1733
1734protected:
1735 class_or_union_diff(class_or_union_sptr first_scope,
1736 class_or_union_sptr second_scope,
1738
1739public:
1740
1741 const class_or_union_diff::priv_ptr&
1742 get_priv() const;
1743
1744 //TODO: add change of the name of the type.
1745
1746 virtual ~class_or_union_diff();
1747
1748 class_or_union_sptr
1749 first_class_or_union() const;
1750
1751 class_or_union_sptr
1752 second_class_or_union() const;
1753
1754 const edit_script&
1755 member_types_changes() const;
1756
1759
1760 const edit_script&
1761 data_members_changes() const;
1762
1765
1767 inserted_data_members() const;
1768
1770 deleted_data_members() const;
1771
1773 changed_data_members() const;
1774
1775 const var_diff_sptrs_type&
1777
1778 const edit_script&
1779 member_fns_changes() const;
1780
1783
1785 changed_member_fns() const;
1786
1788 deleted_member_fns() const;
1789
1791 inserted_member_fns() const;
1792
1793 size_t
1794 count_filtered_changed_data_members(bool local_only = false) const;
1795
1796 const var_diff_sptrs_type&
1798
1799 size_t
1800 count_filtered_subtype_changed_data_members(bool local_only = false) const;
1801
1804
1807
1808 const edit_script&
1810
1813
1814 const edit_script&
1816
1819
1820 virtual bool
1821 has_changes() const;
1822
1823 virtual enum change_kind
1824 has_local_changes() const;
1825
1826 virtual void
1827 report(ostream&, const string& indent = "") const;
1828
1829 virtual void
1831
1832 friend class default_reporter;
1833}; // end class_or_union_diff;
1834
1835/// This type abstracts changes for a class_decl.
1837{
1838 struct priv;
1839 typedef std::unique_ptr<priv> priv_ptr;
1840 priv_ptr priv_;
1841
1842 const priv_ptr& get_priv()const;
1843
1844 void
1845 clear_lookup_tables(void);
1846
1847 bool
1848 lookup_tables_empty(void) const;
1849
1850 void
1851 ensure_lookup_tables_populated(void) const;
1852
1853 void
1854 allocate_priv_data();
1855
1856protected:
1857 class_diff(class_decl_sptr first_scope,
1858 class_decl_sptr second_scope,
1860
1861public:
1862 //TODO: add change of the name of the type.
1863
1864 virtual ~class_diff();
1865
1867 first_class_decl() const;
1868
1870 second_class_decl() const;
1871
1872 const edit_script&
1873 base_changes() const;
1874
1876 base_changes();
1877
1879 deleted_bases() const;
1880
1882 inserted_bases() const;
1883
1885 changed_bases();
1886
1887 const vector<class_decl::base_spec_sptr>&
1888 moved_bases() const;
1889
1890 virtual bool
1891 has_changes() const;
1892
1893 virtual enum change_kind
1894 has_local_changes() const;
1895
1896 virtual const string&
1898
1899 virtual void
1900 report(ostream&, const string& indent = "") const;
1901
1902 virtual void
1904
1905 friend class_diff_sptr
1906 compute_diff(const class_decl_sptr first,
1907 const class_decl_sptr second,
1908 diff_context_sptr ctxt);
1909
1910 friend class default_reporter;
1911};// end class_diff
1912
1914compute_diff(const class_decl_sptr first,
1915 const class_decl_sptr second,
1916 diff_context_sptr ctxt);
1917
1918class union_diff;
1919typedef shared_ptr<union_diff> union_diff_sptr;
1920
1922{
1923 void
1924 clear_lookup_tables(void);
1925
1926 bool
1927 lookup_tables_empty(void) const;
1928
1929 void
1930 ensure_lookup_tables_populated(void) const;
1931
1932 void
1933 allocate_priv_data();
1934
1935protected:
1936 union_diff(union_decl_sptr first_union,
1937 union_decl_sptr second_union,
1939
1940public:
1941
1942 virtual ~union_diff();
1943
1944 union_decl_sptr
1945 first_union_decl() const;
1946
1947 union_decl_sptr
1948 second_union_decl() const;
1949
1950 virtual const string&
1952
1953 virtual void
1954 report(ostream&, const string& indent = "") const;
1955
1956 friend union_diff_sptr
1957 compute_diff(const union_decl_sptr first,
1958 const union_decl_sptr second,
1959 diff_context_sptr ctxt);
1960}; // end class union_diff
1961
1962union_diff_sptr
1963compute_diff(const union_decl_sptr first,
1964 const union_decl_sptr second,
1965 diff_context_sptr ctxt);
1966
1967/// An abstraction of a diff between two instances of class_decl::base_spec.
1968class base_diff : public diff
1969{
1970 struct priv;
1971 std::unique_ptr<priv> priv_;
1972
1973protected:
1976 class_diff_sptr underlying,
1978
1979public:
1981 first_base() const;
1982
1984 second_base() const;
1985
1986 const class_diff_sptr
1988
1989 void
1991
1992 virtual const string&
1994
1995 virtual bool
1996 has_changes() const;
1997
1998 virtual enum change_kind
1999 has_local_changes() const;
2000
2001 virtual void
2002 report(ostream&, const string& indent = "") const;
2003
2004 virtual void
2006
2007 friend base_diff_sptr
2009 const class_decl::base_spec_sptr second,
2010 diff_context_sptr ctxt);
2011};// end class base_diff
2012
2015 const class_decl::base_spec_sptr second,
2016 diff_context_sptr ctxt);
2017
2018class scope_diff;
2019
2020/// Convenience typedef for a shared pointer on a @ref scope_diff.
2021typedef shared_ptr<scope_diff> scope_diff_sptr;
2022
2023/// An abstractions of the changes between two scopes.
2024class scope_diff : public diff
2025{
2026 struct priv;
2027 std::unique_ptr<priv> priv_;
2028
2029 bool
2030 lookup_tables_empty() const;
2031
2032 void
2033 clear_lookup_tables();
2034
2035 void
2036 ensure_lookup_tables_populated();
2037
2038protected:
2042
2043public:
2044
2045 friend scope_diff_sptr
2046 compute_diff(const scope_decl_sptr first,
2047 const scope_decl_sptr second,
2049 diff_context_sptr ctxt);
2050
2051 friend scope_diff_sptr
2054 diff_context_sptr ctxt);
2055
2056 const scope_decl_sptr
2057 first_scope() const;
2058
2059 const scope_decl_sptr
2060 second_scope() const;
2061
2062 const edit_script&
2063 member_changes() const;
2064
2067
2068 const decl_base_sptr
2069 deleted_member_at(unsigned index) const;
2070
2071 const decl_base_sptr
2072 deleted_member_at(vector<deletion>::const_iterator) const;
2073
2074 const decl_base_sptr
2075 inserted_member_at(unsigned i);
2076
2077 const decl_base_sptr
2078 inserted_member_at(vector<unsigned>::const_iterator i);
2079
2080 const diff_sptrs_type&
2081 changed_types() const;
2082
2083 const diff_sptrs_type&
2084 changed_decls() const;
2085
2087 removed_types() const;
2088
2090 removed_decls() const;
2091
2093 added_types() const;
2094
2096 added_decls() const;
2097
2098 virtual const string&
2100
2101 virtual bool
2102 has_changes() const;
2103
2104 virtual enum change_kind
2105 has_local_changes() const;
2106
2107 virtual void
2108 report(ostream& out, const string& indent = "") const;
2109
2110 virtual void
2112
2113 friend class default_reporter;
2114 friend class leaf_reporter;
2115};// end class scope_diff
2116
2118compute_diff(const scope_decl_sptr first,
2119 const scope_decl_sptr second,
2121 diff_context_sptr ctxt);
2122
2124compute_diff(const scope_decl_sptr first_scope,
2125 const scope_decl_sptr second_scope,
2126 diff_context_sptr ctxt);
2127
2128/// Abstraction of a diff between two function parameters.
2130{
2131 struct priv;
2132 std::unique_ptr<priv> priv_;
2133
2135 const function_decl::parameter_sptr second,
2136 diff_context_sptr ctxt);
2137
2138public:
2139 friend fn_parm_diff_sptr
2141 const function_decl::parameter_sptr second,
2142 diff_context_sptr ctxt);
2143
2145 first_parameter() const;
2146
2148 second_parameter() const;
2149
2150 diff_sptr
2151 type_diff() const;
2152
2153 virtual const string&
2155
2156 virtual bool
2157 has_changes() const;
2158
2159 virtual enum change_kind
2160 has_local_changes() const;
2161
2162 virtual void
2163 report(ostream&, const string& indent = "") const;
2164
2165 virtual void
2167}; // end class fn_parm_diff
2168
2171 const function_decl::parameter_sptr second,
2172 diff_context_sptr ctxt);
2173
2174class function_type_diff;
2175
2176/// A convenience typedef for a shared pointer to @ref
2177/// function_type_type_diff
2178typedef shared_ptr<function_type_diff> function_type_diff_sptr;
2179
2180/// Abstraction of a diff between two function types.
2182{
2183 struct priv;
2184 std::unique_ptr<priv> priv_;
2185
2186 void
2187 ensure_lookup_tables_populated();
2188
2190 deleted_parameter_at(int i) const;
2191
2193 inserted_parameter_at(int i) const;
2194
2195protected:
2197 const function_type_sptr second,
2198 diff_context_sptr ctxt);
2199
2200public:
2202 compute_diff(const function_type_sptr first,
2203 const function_type_sptr second,
2204 diff_context_sptr ctxt);
2205
2206 const function_type_sptr
2207 first_function_type() const;
2208
2209 const function_type_sptr
2210 second_function_type() const;
2211
2212 const diff_sptr
2213 return_type_diff() const;
2214
2216 subtype_changed_parms() const;
2217
2218 const string_parm_map&
2219 removed_parms() const;
2220
2221 const string_parm_map&
2222 added_parms() const;
2223
2224 const vector<function_decl::parameter_sptr>&
2225 sorted_deleted_parms() const;
2226
2227 const vector<function_decl::parameter_sptr>&
2228 sorted_added_parms() const;
2229
2230 virtual const string&
2232
2233 virtual bool
2234 has_changes() const;
2235
2236 virtual enum change_kind
2237 has_local_changes() const;
2238
2239 virtual void
2240 report(ostream&, const string& indent = "") const;
2241
2242 virtual void
2244
2245 friend class default_reporter;
2246 friend class leaf_reporter;
2247};// end class function_type_diff
2248
2251 const function_type_sptr second,
2252 diff_context_sptr ctxt);
2253
2254/// Abstraction of a diff between two function_decl.
2256{
2257 struct priv;
2258 std::unique_ptr<priv> priv_;
2259
2260 void
2261 ensure_lookup_tables_populated();
2262
2263
2264protected:
2266 const function_decl_sptr second,
2267 diff_context_sptr ctxt);
2268
2269public:
2270
2273 const function_decl_sptr second,
2274 diff_context_sptr ctxt);
2275
2276 const function_decl_sptr
2277 first_function_decl() const;
2278
2279 const function_decl_sptr
2280 second_function_decl() const;
2281
2283 type_diff() const;
2284
2285 virtual const string&
2287
2288 virtual bool
2289 has_changes() const;
2290
2291 virtual enum change_kind
2292 has_local_changes() const;
2293
2294 virtual void
2295 report(ostream&, const string& indent = "") const;
2296
2297 virtual void
2299}; // end class function_decl_diff
2300
2303 const function_decl_sptr second,
2304 diff_context_sptr ctxt);
2305
2306class type_decl_diff;
2307
2308/// Convenience typedef for a shared pointer on a @ref type_decl_diff type.
2309typedef shared_ptr<type_decl_diff> type_decl_diff_sptr;
2310
2311/// Abstraction of a diff between two basic type declarations.
2313{
2315
2316protected:
2317 type_decl_diff(const type_decl_sptr first,
2318 const type_decl_sptr second,
2320
2321public:
2322 friend type_decl_diff_sptr
2323 compute_diff(const type_decl_sptr first,
2324 const type_decl_sptr second,
2325 diff_context_sptr ctxt);
2326
2327 const type_decl_sptr
2328 first_type_decl() const;
2329
2330 const type_decl_sptr
2331 second_type_decl() const;
2332
2333 virtual const string&
2335
2336 virtual bool
2337 has_changes() const;
2338
2339 virtual enum change_kind
2340 has_local_changes() const;
2341
2342 virtual void
2343 report(ostream& out, const string& indent = "") const;
2344};// end type_decl_diff
2345
2348 const type_decl_sptr,
2350
2351class typedef_diff;
2352
2353/// Convenience typedef for a shared pointer on a typedef_diff type.
2354typedef shared_ptr<typedef_diff> typedef_diff_sptr;
2355
2356/// Abstraction of a diff between two typedef_decl.
2358{
2359 struct priv;
2360 std::unique_ptr<priv> priv_;
2361
2362 typedef_diff();
2363
2364protected:
2365 typedef_diff(const typedef_decl_sptr first,
2366 const typedef_decl_sptr second,
2369
2370public:
2371 friend typedef_diff_sptr
2372 compute_diff(const typedef_decl_sptr first,
2373 const typedef_decl_sptr second,
2374 diff_context_sptr ctxt);
2375
2376 const typedef_decl_sptr
2377 first_typedef_decl() const;
2378
2379 const typedef_decl_sptr
2380 second_typedef_decl() const;
2381
2382 const diff_sptr
2383 underlying_type_diff() const;
2384
2385 void
2387
2388 virtual const string&
2390
2391 virtual bool
2392 has_changes() const;
2393
2394 virtual enum change_kind
2395 has_local_changes() const;
2396
2397 virtual void
2398 report(ostream&, const string& indent = "") const;
2399
2400 virtual void
2402};// end class typedef_diff
2403
2406 const typedef_decl_sptr,
2407 diff_context_sptr ctxt);
2408
2409const diff*
2411
2413
2414/// Convenience typedef for a shared pointer on a
2415/// @ref translation_unit_diff type.
2416typedef shared_ptr<translation_unit_diff> translation_unit_diff_sptr;
2417
2418/// An abstraction of a diff between two translation units.
2420{
2421 struct priv;
2422 std::unique_ptr<priv> priv_;
2423
2424protected:
2426 translation_unit_sptr second,
2428
2429public:
2430
2432 first_translation_unit() const;
2433
2436
2439 const translation_unit_sptr second,
2440 diff_context_sptr ctxt);
2441
2442 virtual bool
2443 has_changes() const;
2444
2445 virtual enum change_kind
2446 has_local_changes() const;
2447
2448 virtual void
2449 report(ostream& out, const string& indent = "") const;
2450};//end class translation_unit_diff
2451
2454 const translation_unit_sptr second,
2456
2457/// An abstraction of a diff between between two abi corpus.
2459{
2460 struct priv;
2461 std::unique_ptr<priv> priv_;
2462
2463protected:
2464 corpus_diff(corpus_sptr first,
2465 corpus_sptr second,
2467
2468 void
2470
2471public:
2472
2473 class diff_stats;
2474
2475 virtual ~corpus_diff();
2476
2477 /// A convenience typedef for a shared pointer to @ref diff_stats
2478 typedef shared_ptr<diff_stats> diff_stats_sptr;
2479
2480 bool
2481 do_log() const;
2482
2483 void
2484 do_log(bool);
2485
2486 corpus_sptr
2487 first_corpus() const;
2488
2489 corpus_sptr
2490 second_corpus() const;
2491
2492 const vector<diff*>&
2493 children_nodes() const;
2494
2495 void
2497
2499 function_changes() const;
2500
2502 variable_changes() const;
2503
2504 bool
2505 soname_changed() const;
2506
2507 bool
2508 architecture_changed() const;
2509
2511 deleted_functions() const;
2512
2515
2518
2521
2522 const string_var_ptr_map&
2523 deleted_variables() const;
2524
2525 const string_var_ptr_map&
2526 added_variables() const;
2527
2530
2531 const var_diff_sptrs_type&
2533
2536
2539
2542
2545
2548
2549 const vector<type_base_sptr>&
2551
2554
2555 const vector<type_base_sptr>&
2557
2560
2561 const vector<diff_sptr>&
2563
2564 const diff_context_sptr
2565 context() const;
2566
2567 const string&
2569
2570 bool
2571 has_changes() const;
2572
2573 bool
2575
2576 bool
2578
2579 bool
2580 has_net_changes() const;
2581
2582 const diff_stats&
2584
2585 void
2587
2588 diff_maps&
2590
2591 const diff_maps&
2592 get_leaf_diffs() const;
2593
2594 virtual void
2595 report(ostream& out, const string& indent = "") const;
2596
2597 virtual bool
2599
2600 virtual void
2602
2603 friend corpus_diff_sptr
2604 compute_diff(const corpus_sptr f,
2605 const corpus_sptr s,
2606 diff_context_sptr ctxt);
2607
2608 friend void
2609 apply_suppressions(const corpus_diff* diff_tree);
2610
2611 friend void
2613 const corpus_diff::diff_stats &s,
2614 const string& indent,
2615 ostream& out);
2616
2617 friend class default_reporter;
2618 friend class leaf_reporter;
2619}; // end class corpus_diff
2620
2622compute_diff(const corpus_sptr,
2623 const corpus_sptr,
2625
2627compute_diff(const corpus_group_sptr&,
2628 const corpus_group_sptr&,
2629 diff_context_sptr ctxt);
2630
2631/// This is a document class that aims to capture statistics about the
2632/// changes carried by a @ref corpus_diff type.
2633///
2634/// Its values are populated by the member function
2635/// corpus_diff::apply_filters_and_suppressions_before_reporting()
2637{
2638 struct priv;
2639 std::unique_ptr<priv> priv_;
2640
2641 diff_stats();
2642
2643public:
2644
2646
2647 size_t num_func_removed() const;
2648 void num_func_removed(size_t);
2649
2650 size_t num_removed_func_filtered_out() const;
2651 void num_removed_func_filtered_out(size_t);
2652
2653 size_t net_num_func_removed() const;
2654
2655 size_t num_func_added() const;
2656 void num_func_added(size_t);
2657
2658 size_t num_added_func_filtered_out() const;
2659 void num_added_func_filtered_out(size_t);
2660
2661 size_t net_num_func_added() const;
2662
2663 size_t num_func_changed() const;
2664 void num_func_changed(size_t);
2665
2666 size_t num_changed_func_filtered_out() const;
2667 void num_changed_func_filtered_out(size_t);
2668
2671
2672 size_t net_num_func_changed() const;
2673
2674 size_t num_vars_removed() const;
2675 void num_vars_removed(size_t);
2676
2677 size_t num_removed_vars_filtered_out() const;
2678 void num_removed_vars_filtered_out(size_t) const;
2679
2680 size_t net_num_vars_removed() const;
2681
2682 size_t num_vars_added() const;
2683 void num_vars_added(size_t);
2684
2685 size_t num_added_vars_filtered_out() const;
2686 void num_added_vars_filtered_out(size_t);
2687
2688 size_t net_num_vars_added() const;
2689
2690 size_t num_vars_changed() const;
2691 void num_vars_changed(size_t);
2692
2693 size_t num_changed_vars_filtered_out() const;
2694 void num_changed_vars_filtered_out(size_t);
2695
2696 size_t net_num_vars_changed() const;
2697
2698 size_t num_func_syms_removed() const;
2699 void num_func_syms_removed(size_t);
2700
2703
2704 size_t num_func_syms_added() const;
2705 void num_func_syms_added(size_t);
2706
2707 size_t num_added_func_syms_filtered_out() const;
2709
2710 size_t net_num_removed_func_syms() const;
2711 size_t net_num_added_func_syms() const;
2712
2713 size_t num_var_syms_removed() const;
2714 void num_var_syms_removed(size_t);
2715
2716 size_t num_removed_var_syms_filtered_out() const;
2718
2719 size_t num_var_syms_added() const;
2720 void num_var_syms_added(size_t);
2721
2722 size_t num_added_var_syms_filtered_out() const;
2724
2725 size_t net_num_removed_var_syms() const;
2726 size_t net_num_added_var_syms() const;
2727
2728 size_t num_leaf_changes() const;
2729 void num_leaf_changes(size_t);
2730
2731 size_t num_leaf_changes_filtered_out() const;
2732 void num_leaf_changes_filtered_out(size_t);
2733
2734 size_t net_num_leaf_changes() const;
2735
2736 size_t num_leaf_type_changes() const;
2737 void num_leaf_type_changes(size_t);
2738
2741 size_t net_num_leaf_type_changes() const;
2742
2743 size_t num_leaf_func_changes() const;
2744 void num_leaf_func_changes(size_t);
2745
2748 size_t net_num_leaf_func_changes() const;
2749
2750 size_t num_leaf_var_changes() const;
2751 void num_leaf_var_changes(size_t);
2752
2753 size_t num_leaf_var_changes_filtered_out() const;
2755 size_t net_num_leaf_var_changes() const;
2756
2757 size_t num_added_unreachable_types() const;
2758 void num_added_unreachable_types(size_t);
2759
2762 size_t net_num_added_unreachable_types() const;
2763
2764 size_t num_removed_unreachable_types() const;
2765 void num_removed_unreachable_types(size_t);
2766
2769 size_t net_num_removed_unreachable_types() const;
2770
2771 size_t num_changed_unreachable_types() const;
2772 void num_changed_unreachable_types(size_t);
2773
2776 size_t net_num_changed_unreachable_types() const;
2777
2778}; // end class corpus_diff::diff_stats
2779
2780/// The base class for the node visitors. These are the types used to
2781/// visit each node traversed by the diff_traversable_base::traverse() method.
2783{
2784protected:
2785 struct priv;
2786 std::unique_ptr<priv> priv_;
2787
2788public:
2789
2791
2792 virtual ~diff_node_visitor();
2793
2795
2797 get_visiting_kind() const;
2798
2799 void
2801
2802 void
2804
2805 void
2807
2808 diff*
2810
2811 virtual void
2812 visit_begin(diff*);
2813
2814 virtual void
2816
2817 virtual void
2818 visit_end(diff*);
2819
2820 virtual void
2822
2823 virtual bool
2824 visit(diff*, bool);
2825
2826 virtual bool
2827 visit(distinct_diff*, bool);
2828
2829 virtual bool
2830 visit(var_diff*, bool);
2831
2832 virtual bool
2833 visit(pointer_diff*, bool);
2834
2835 virtual bool
2836 visit(reference_diff*, bool);
2837
2838 virtual bool
2839 visit(qualified_type_diff*, bool);
2840
2841 virtual bool
2842 visit(enum_diff*, bool);
2843
2844 virtual bool
2845 visit(class_diff*, bool);
2846
2847 virtual bool
2848 visit(base_diff*, bool);
2849
2850 virtual bool
2851 visit(scope_diff*, bool);
2852
2853 virtual bool
2854 visit(function_decl_diff*, bool);
2855
2856 virtual bool
2857 visit(type_decl_diff*, bool);
2858
2859 virtual bool
2860 visit(typedef_diff*, bool);
2861
2862 virtual bool
2864
2865 virtual bool
2866 visit(corpus_diff*, bool);
2867}; // end struct diff_node_visitor
2868
2869void
2870propagate_categories(diff* diff_tree);
2871
2872void
2874
2875void
2877
2878void
2880
2881void
2882apply_suppressions(diff* diff_tree);
2883
2884void
2885apply_suppressions(const corpus_diff* diff_tree);
2886
2887void
2888apply_suppressions(diff_sptr diff_tree);
2889
2890void
2892
2893void
2894print_diff_tree(diff* diff_tree, std::ostream&);
2895
2896void
2897print_diff_tree(corpus_diff* diff_tree,
2898 std::ostream&);
2899
2900void
2901print_diff_tree(diff_sptr diff_tree,
2902 std::ostream&);
2903
2904void
2906 std::ostream&);
2907
2908void
2909categorize_redundancy(diff* diff_tree);
2910
2911void
2913
2914void
2916
2917void
2919
2920void
2922
2923void
2925
2926void
2928
2929void
2931
2932void
2934
2935bool
2937
2938bool
2940
2941bool
2943
2944bool
2946
2947const type_diff_base*
2948is_type_diff(const diff* diff);
2949
2950const decl_diff_base*
2951is_decl_diff(const diff* diff);
2952
2953const type_decl_diff*
2955
2956const type_decl_diff*
2957is_diff_of_basic_type(const diff* diff, bool);
2958
2961
2962bool
2964
2965const enum_diff*
2966is_enum_diff(const diff *diff);
2967
2968const class_diff*
2969is_class_diff(const diff* diff);
2970
2971const union_diff*
2972is_union_diff(const diff* diff);
2973
2976
2979
2980const subrange_diff*
2981is_subrange_diff(const diff* diff);
2982
2983const array_diff*
2984is_array_diff(const diff* diff);
2985
2986const function_type_diff*
2988
2989const function_type_diff*
2991
2992const typedef_diff*
2993is_typedef_diff(const diff *diff);
2994
2995const var_diff*
2996is_var_diff(const diff* diff);
2997
2998const function_decl_diff*
3000
3001const pointer_diff*
3002is_pointer_diff(const diff* diff);
3003
3004const reference_diff*
3006
3009
3010const fn_parm_diff*
3011is_fn_parm_diff(const diff* diff);
3012
3013const base_diff*
3014is_base_diff(const diff* diff);
3015
3016const distinct_diff*
3017is_distinct_diff(const diff *diff);
3018
3019bool
3021
3022bool
3024
3025const corpus_diff*
3026is_corpus_diff(const diff* diff);
3027
3028const diff*
3029peel_typedef_diff(const diff* dif);
3030
3031const diff*
3032peel_pointer_diff(const diff* dif);
3033
3034const diff*
3035peel_reference_diff(const diff* dif);
3036
3037const diff*
3038peel_qualified_diff(const diff* dif);
3039
3040const diff*
3041peel_fn_parm_diff(const diff* dif);
3042
3043const diff*
3045
3046const diff*
3048
3049const diff*
3051}// end namespace comparison
3052
3053}// end namespace abigail
3054
3055#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 unsigned_var_diff_sptr_map & changed_data_members() const
Getter of the map of data members that got replaced by another data member. The key of the map is the...
const edit_script & member_types_changes() const
const string_member_function_sptr_map & deleted_member_fns() const
class_or_union_sptr first_class_or_union() const
const var_diff_sptrs_type & sorted_subtype_changed_data_members() const
Getter of the sorted vector of data members with a (sub-)type change.
bool lookup_tables_empty(void) const
Tests if the lookup tables are empty.
const string_decl_base_sptr_map & data_members_replaced_by_adms() const
Get the map of data members that got replaced by anonymous data members.
void clear_lookup_tables(void)
Clear the lookup tables useful for reporting.
const string_decl_base_sptr_map & deleted_data_members() const
Getter for the data members that got deleted.
virtual ~class_or_union_diff()
Destructor of class_or_union_diff.
const string_decl_base_sptr_map & inserted_data_members() const
Getter for the data members that got inserted.
void ensure_lookup_tables_populated(void) const
If the lookup tables are not yet built, walk the differences and fill them.
const string_member_function_sptr_map & inserted_member_fns() const
const function_decl_diff_sptrs_type & changed_member_fns() const
Getter for the virtual members functions that have had a change in a sub-type, without having a chang...
const edit_script & data_members_changes() const
const changed_var_sptrs_type & ordered_data_members_replaced_by_adms() const
Get an ordered vector of of data members that got replaced by anonymous data members.
virtual enum change_kind has_local_changes() const
size_t count_filtered_changed_data_members(bool local_only=false) const
Count the number of /filtered/ data members that got replaced by another data member.
const edit_script & member_fns_changes() const
class_or_union_sptr second_class_or_union() const
const var_diff_sptrs_type & sorted_changed_data_members() const
Getter of the sorted vector of data members that got replaced by another data member.
virtual void report(ostream &, const string &indent="") const
Report the changes carried by the current class_or_union_diff node in a textual format.
This is a document class that aims to capture statistics about the changes carried by a corpus_diff t...
size_t num_changed_unreachable_types_filtered_out() const
Getter of the number of changed types that are unreachable from public interfaces and that have been ...
size_t num_func_removed() const
Getter for the number of functions removed.
size_t num_removed_unreachable_types_filtered_out() const
Getter of the number of removed types that are not reachable from public interfaces and that have bee...
size_t num_vars_changed() const
Getter for the number of variables that have a change in one of their sub-types.
size_t 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:159
The context of the diff. This type holds various bits of information that is going to be used through...
void add_suppressions(const suppr::suppressions_type &supprs)
Add new suppression specifications that specify which diff node reports should be dropped on the floo...
diff_category get_allowed_category() const
Getter for the bitmap that represents the set of categories that the user wants to see reported.
void forget_visited_diffs()
Unmark all the diff nodes that were marked as being traversed.
corpus_sptr get_first_corpus() const
Getter for the first corpus of the corpus diff of the current context.
bool show_architecture_change() const
Getter for the property that says if the comparison module should show the architecture changes in it...
bool show_offsets_sizes_in_bits() const
Get the flag that indicates if diff reports using this context should show sizes and offsets in bits,...
void forbid_visiting_a_node_twice(bool f)
This sets a flag that, if it's true, then during the traversing of a diff nodes tree each node is vis...
void initialize_canonical_diff(const diff_sptr diff)
Set the canonical diff node property of a given diff node appropriately.
bool show_redundant_changes() const
A getter for the flag that says if we should report about functions or variables diff nodes that have...
void forbid_visiting_a_node_twice_per_interface(bool)
This function sets a flag os that if forbid_visiting_a_node_twice() returns true, then each time the ...
void keep_diff_alive(diff_sptr &)
Add a diff node to the set of diff nodes that are kept alive for the life time of the current instanc...
diff * diff_has_been_visited(const diff *) const
Test if a diff node has been traversed.
bool visiting_a_node_twice_is_forbidden_per_interface() const
Return a flag that, if true, then during the traversing of a diff nodes tree each node is visited at ...
void set_corpus_diff(const corpus_diff_sptr &)
Set the corpus diff relevant to this context.
bool show_leaf_changes_only() const
Get the flag that indicates if the diff using this context should show only leaf changes or not.
bool perform_change_categorization() const
Test if it's requested to perform diff node categorization.
bool show_impacted_interfaces() const
Getter of the flag that indicates if the leaf reporter should display a summary of the interfaces imp...
bool show_soname_change() const
Getter for the property that says if the comparison module should show the soname changes in its repo...
reporter_base_sptr get_reporter() const
Getter of the reporter to be used in this context.
void add_diff_filter(filtering::filter_base_sptr)
Setter for the diff filters to apply to a given diff sub-tree.
bool do_log() const
Test if logging was requested.
const suppr::suppressions_type & direct_suppressions() const
Getter of the direct suppression specification (those that are not negated) comprised in the general ...
void maybe_apply_filters(diff_sptr diff)
Apply the diff filters to a given diff sub-tree.
const suppr::suppressions_type & suppressions() const
Getter for the vector of suppressions that specify which diff node reports should be dropped on the f...
bool show_relative_offset_changes(void)
Get the flag saying if offset changes should be reported in a relative way. That is,...
bool visiting_a_node_twice_is_forbidden() const
Return a flag that, if true, then during the traversing of a diff nodes tree each node is visited at ...
void do_dump_diff_tree(const diff_sptr) const
Emit a textual representation of a diff tree to the error output stream of the current context,...
const suppr::suppressions_type & negated_suppressions() const
Getter of the negated suppression specifications that are comprised in the general vector of suppress...
void add_suppression(const suppr::suppression_sptr suppr)
Add a new suppression specification that specifies which diff node reports should be dropped on the f...
bool show_hex_values() const
Get the flag that indicates if the diff reports using this context should show sizes and offsets in a...
void switch_categories_off(diff_category c)
Setter for the bitmap that represents the set of categories that the user wants to see reported.
bool show_stats_only() const
Test if the comparison module should only show the diff stats.
const filtering::filters & diff_filters() const
Getter for the diff tree nodes filters to apply to diff sub-trees.
bool show_unreachable_types()
Getter for the flag that indicates if changes on types unreachable from global functions and variable...
const corpus_diff_sptr & get_corpus_diff() const
Get the corpus diff for the current context.
void mark_diff_as_visited(const diff *)
Mark a diff node as traversed by a traversing algorithm.
diff_sptr get_canonical_diff_for(const type_or_decl_base_sptr first, const type_or_decl_base_sptr second) const
Getter for the canonical diff node for the diff represented by their two subjects.
void switch_categories_on(diff_category c)
Setter for the bitmap that represents the set of categories that the user wants to see reported.
ostream * default_output_stream()
Getter for the default output stream used by code of the comparison engine. By default the default ou...
bool dump_diff_tree() const
Test if the comparison engine should dump the diff tree for the changed functions and variables it ha...
bool show_symbols_unreferenced_by_debug_info() const
Getter for the flag that indicates if symbols not referenced by any debug info are to be compared and...
bool show_added_symbols_unreferenced_by_debug_info() const
Getter for the flag that indicates if symbols not referenced by any debug info and that got added are...
corpus_sptr get_second_corpus() const
Getter for the second corpus of the corpus diff of the current context.
friend class_diff_sptr compute_diff(const class_decl_sptr first, const class_decl_sptr second, diff_context_sptr ctxt)
Compute the set of changes between two instances of class_decl.
void set_allowed_category(diff_category c)
Setter for the bitmap that represents the set of categories that the user wants to see reported.
void set_reporter(reporter_base_sptr &)
Setter of the reporter to be used in this context.
ostream * error_output_stream() const
Getter for the errror output stream used by code of the comparison engine. By default the error outpu...
This type contains maps. Each map associates a type name to a diff of that type. Not all kinds of dif...
const string_diff_ptr_map & get_function_decl_diff_map() const
Getter of the map that contains function decl diffs.
const string_diff_ptr_map & get_var_decl_diff_map() const
Getter of the map that contains var decl diffs.
const string_diff_ptr_map & get_enum_diff_map() const
Getter of the map that contains enum type diffs.
bool insert_diff_node(const diff *d, const type_or_decl_base_sptr &impacted_iface)
Insert a new diff node into the current instance of diff_maps.
diff_maps()
Default constructor of the diff_maps type.
const string_diff_ptr_map & get_union_diff_map() const
Getter of the map that contains union type diffs.
artifact_sptr_set_type * lookup_impacted_interfaces(const diff *d) const
Lookup the interfaces that are impacted by a given leaf diff node.
const string_diff_ptr_map & get_function_type_diff_map() const
Getter of the map that contains function type diffs.
const string_diff_ptr_map & get_typedef_diff_map() const
Getter of the map that contains typedef type diffs.
const string_diff_ptr_map & get_distinct_diff_map() const
Getter of the map that contains distinct diffs.
const string_diff_ptr_map & get_subrange_diff_map() const
Getter of the map that contains subrange type diffs.
const string_diff_ptr_map & get_reference_diff_map() const
Getter of the map that contains reference type diffs.
const string_diff_ptr_map & get_array_diff_map() const
Getter of the map that contains array type diffs.
const string_diff_ptr_map & get_type_decl_diff_map() const
Getter of the map that contains basic type diffs.
const string_diff_ptr_map & get_fn_parm_diff_map() const
Getter of the map that contains function parameter diffs.
const string_diff_ptr_map & get_class_diff_map() const
Getter of the map that contains class type diffs.
The base class for the node visitors. These are the types used to visit each node traversed by the di...
void or_visiting_kind(visiting_kind v)
Setter for the visiting policy of the traversing code while invoking this visitor....
virtual bool visit(diff *, bool)
Default visitor implementation.
void set_current_topmost_iface_diff(diff *)
Setter of the diff current topmost interface which is impacted by the current diff node being visited...
virtual void visit_begin(diff *)
This is called by the traversing code on a diff node just before visiting it. That is,...
visiting_kind get_visiting_kind() const
Getter for the visiting policy of the traversing code while invoking this visitor.
virtual void visit_end(diff *)
This is called by the traversing code on a diff node just after visiting it. That is after visiting i...
diff_node_visitor()
Default constructor of the diff_node_visitor type.
void set_visiting_kind(visiting_kind v)
Setter for the visiting policy of the traversing code while invoking this visitor.
diff * get_current_topmost_iface_diff() const
Getter of the diff current topmost interface which is impacted by the current diff node being visited...
The base class for the diff classes that are to be traversed.
virtual bool traverse(diff_node_visitor &v)
The default traverse function.
The abstraction of a change between two ABI artifacts, a.k.a an artifact change.
void begin_traversing()
Flag a given diff node as being traversed.
void set_category(diff_category c)
Set the category of the current diff node. This category includes the categories inherited from the c...
virtual void finish_diff_type()
Finish the insertion of a diff tree node into the diff graph.
virtual void chain_into_hierarchy()
This constructs the relation between this diff node and its detail diff nodes, in the generic view of...
diff_category remove_from_category(diff_category c)
Remove the current diff tree node from an a existing sef of categories. The categories include those ...
type_or_decl_base_sptr second_subject() const
Getter of the second subject of the diff.
bool is_traversing() const
Tell if a given node is being traversed or not.
type_or_decl_base_sptr first_subject() const
Getter of the first subject of the diff.
bool is_suppressed() const
Test if the current diff node has been suppressed by a user-provided suppression specification.
bool is_filtered_out_without_looking_at_allowed_changes() const
Test if this diff tree node is to be filtered out for reporting purposes, but without considering the...
diff * get_canonical_diff() const
Getter for the canonical diff of the current instance of diff.
bool has_parent_allowed_by_specific_negated_suppression() const
Test if the current diff node has a parent node which is specifically allowed by a negated suppressio...
bool has_local_changes_to_be_reported() const
Test if this diff tree node should be reported when considering the categories that were *NOT* inheri...
const vector< diff * > & children_nodes() const
Getter for the children nodes of the current diff node.
virtual void report(ostream &out, const string &indent="") const =0
Pure interface to report the diff in a serialized form that is legible for the user.
diff_category get_category() const
Getter for the category of the current diff tree node.
bool is_allowed_by_specific_negated_suppression() const
Test if this diff node is allowed (prevented from being suppressed) by at least one negated suppressi...
diff_category remove_from_local_category(diff_category c)
Remove the current diff tree node from the categories resulting from the local changes.
void add_to_local_and_inherited_categories(diff_category c)
Adds the current diff tree node to the categories resulting from the local and inherited changes of t...
bool do_log() const
Test if logging was requested.
diff_category get_local_category() const
Getter for the local category of the current diff tree node.
diff_category add_to_category(diff_category c)
Adds the current diff tree node to an additional set of categories. Note that the categories include ...
const diff_context_sptr context() const
Getter of the context of the current diff.
virtual enum change_kind has_local_changes() const =0
Pure interface to know if the current instance of @diff carries a local change. A local change is a c...
virtual bool traverse(diff_node_visitor &v)
The generic traversing code that walks a given diff sub-tree.
bool currently_reporting() const
Tests if we are currently in the middle of emitting a report for this diff.
virtual bool has_changes() const =0
Pure interface to get the length of the changes encapsulated by this diff. A length of zero means tha...
bool has_descendant_allowed_by_specific_negated_suppression() const
Test if the current diff node has a descendant node which is specifically allowed by a negated suppre...
bool to_be_reported() const
Test if this diff tree node should be reported.
const diff * parent_node() const
Getter for the parent node of the current diff node.
diff_category get_class_of_equiv_category() const
Getter of the category of the class of equivalence of the current diff tree node.
void set_canonical_diff(diff *)
Setter for the canonical diff of the current instance of diff.
bool is_filtered_out_wrt_non_inherited_categories() const
Test if this diff tree node is to be filtered out for reporting purposes, but by considering only the...
diff_category add_to_local_category(diff_category c)
Adds the current diff tree node to the categories resulting from the local changes of the current dif...
void set_local_category(diff_category c)
Set the local category of the current diff node.
virtual const string & get_pretty_representation() const
Get a pretty representation of the current diff node.
void append_child_node(diff_sptr)
Add a new child node to the vector of children nodes for the current diff node.
bool is_filtered_out() const
Test if this diff tree node is to be filtered out for reporting purposes.
void end_traversing()
Flag a given diff node as not being traversed anymore.
bool reported_once() const
Tests if a report has already been emitted for the current diff.
An abstraction of a diff between entities that are of a different kind (disctinct).
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of @distinct_d...
friend distinct_diff_sptr compute_diff_for_distinct_kinds(const type_or_decl_base_sptr first, const type_or_decl_base_sptr second, diff_context_sptr ctxt)
Try to diff entities that are of distinct kinds.
const diff_sptr compatible_child_diff() const
Getter for the child diff of this distinct_diff instance.
distinct_diff(type_or_decl_base_sptr first, type_or_decl_base_sptr second, diff_context_sptr ctxt=diff_context_sptr())
Constructor for distinct_diff.
static bool entities_are_of_distinct_kinds(type_or_decl_base_sptr first, type_or_decl_base_sptr second)
Test if the two arguments are of different kind, or that are both NULL.
virtual void report(ostream &out, const string &indent="") const
Emit a report about the current diff instance.
const type_or_decl_base_sptr first() const
Getter for the first subject of the diff.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
const type_or_decl_base_sptr second() const
Getter for the second subject of the diff.
Abstraction of a diff between two enums.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of enum_diff.
enum_diff(const enum_type_decl_sptr, const enum_type_decl_sptr, const diff_sptr, diff_context_sptr ctxt=diff_context_sptr())
Constructor for enum_diff.
diff_sptr underlying_type_diff() const
const string_changed_enumerator_map & changed_enumerators() const
virtual enum change_kind has_local_changes() const
friend enum_diff_sptr compute_diff(const enum_type_decl_sptr first, const enum_type_decl_sptr second, diff_context_sptr ctxt)
Compute the set of changes between two instances of enum_type_decl.
virtual const string & get_pretty_representation() const
const enum_type_decl_sptr first_enum() const
const string_enumerator_map & deleted_enumerators() const
const enum_type_decl_sptr second_enum() const
const string_enumerator_map & inserted_enumerators() const
virtual void report(ostream &, const string &indent="") const
Report the differences between the two enums.
Abstraction of a diff between two function parameters.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children nodes of the diff base type sub-object of this instance of fn_parm_di...
const function_decl::parameter_sptr first_parameter() const
Getter for the first subject of this diff node.
friend fn_parm_diff_sptr compute_diff(const function_decl::parameter_sptr first, const function_decl::parameter_sptr second, diff_context_sptr ctxt)
Compute the difference between two function_decl::parameter_sptr; that is, between two function param...
virtual enum change_kind has_local_changes() const
Check if the current diff node carries a local change.
virtual const string & get_pretty_representation() const
Build and return a textual representation of the current instance of fn_parm_diff.
const function_decl::parameter_sptr second_parameter() const
Getter for the second subject of this diff node.
diff_sptr type_diff() const
Getter for the diff representing the changes on the type of the function parameter involved in the cu...
virtual void report(ostream &, const string &indent="") const
Emit a textual report about the current fn_parm_diff instance.
Abstraction of a diff between two function_decl.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of function_de...
const function_decl_sptr second_function_decl() const
friend function_decl_diff_sptr compute_diff(const function_decl_sptr first, const function_decl_sptr second, diff_context_sptr ctxt)
Compute the diff between two function_decl.
function_decl_diff(const function_decl_sptr first, const function_decl_sptr second, diff_context_sptr ctxt)
Constructor for function_decl_diff.
virtual enum change_kind has_local_changes() const
const function_decl_sptr first_function_decl() const
virtual const string & get_pretty_representation() const
virtual void report(ostream &, const string &indent="") const
Serialize a report of the changes encapsulated in the current instance of function_decl_diff over to ...
Abstraction of a diff between two function types.
virtual bool has_changes() const
Test if the current diff node carries changes.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of function_ty...
const string_fn_parm_diff_sptr_map & subtype_changed_parms() const
Getter for the map of function parameter changes of the current diff.
const diff_sptr return_type_diff() const
Getter for the diff of the return types of the two function types of the current diff.
const string_parm_map & removed_parms() const
Getter for the map of parameters that got removed.
const string_parm_map & added_parms() const
Getter for the map of parameters that got added.
friend function_type_diff_sptr compute_diff(const function_type_sptr first, const function_type_sptr second, diff_context_sptr ctxt)
Compute the diff between two instances of function_type.
const vector< function_decl::parameter_sptr > & sorted_added_parms() const
Getter for the sorted vector of added parameters .
const function_type_sptr first_function_type() const
Getter for the first subject of the diff.
const function_type_sptr second_function_type() const
Getter for the second subject of the diff.
function_type_diff(const function_type_sptr first, const function_type_sptr second, diff_context_sptr ctxt)
Consutrctor of the function_type type.
virtual enum change_kind has_local_changes() const
Test if the current diff node carries local changes.
virtual const string & get_pretty_representation() const
Build and return a copy of a pretty representation of the current instance of function_type_diff.
const vector< function_decl::parameter_sptr > & sorted_deleted_parms() const
Getter for the sorted vector of deleted parameters.
virtual void report(ostream &, const string &indent="") const
Build and emit a textual report about the current function_type_diff instance.
A reporter that only reports leaf changes.
Definition: abg-reporter.h:281
The abstraction of a diff between two pointers.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
const pointer_type_def_sptr first_pointer() const
Getter for the first subject of a pointer diff.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of pointer_dif...
const pointer_type_def_sptr second_pointer() const
Getter for the second subject of a pointer diff.
diff_sptr underlying_type_diff() const
Getter for the diff between the pointed-to types of the pointers of this diff.
pointer_diff(pointer_type_def_sptr first, pointer_type_def_sptr second, diff_sptr underlying_type_diff, diff_context_sptr ctxt=diff_context_sptr())
Constructor for a pointer_diff.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
friend pointer_diff_sptr compute_diff(pointer_type_def_sptr first, pointer_type_def_sptr second, diff_context_sptr ctxt)
Compute the diff between between two pointers.
virtual void report(ostream &, const string &indent="") const
Report the diff in a serialized form.
The abstraction of a diff between two ptr_to_mbr_type.
virtual bool has_changes() const
Test whether the current diff node carries any change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of ptr_to_mbr_...
virtual ~ptr_to_mbr_diff()
Destructor of ptr_to_mbr_diff.
ptr_to_mbr_type_sptr first_ptr_to_mbr_type() const
Getter of the first pointer-to-member subject of the current diff node.
friend ptr_to_mbr_diff_sptr compute_diff(const ptr_to_mbr_type_sptr &first, const ptr_to_mbr_type_sptr &second, diff_context_sptr &ctxt)
Compute the diff between two ptr_to_mbr_type types.
const diff_sptr containing_type_diff() const
Getter of the diff node carrying changes to the containing type of first subject of the current diff ...
const diff_sptr member_type_diff() const
Getter of the diff node carrying changes to the member type of first subject of the current diff node...
ptr_to_mbr_type_sptr second_ptr_to_mbr_type() const
Getter of the second pointer-to-member subject of the current diff node.
virtual enum change_kind has_local_changes() const
Test whether the current diff node carries any local change.
virtual const string & get_pretty_representation() const
Get the pretty representation of the current ptr_to_mbr_diff node.
virtual void report(ostream &, const string &indent="") const
Pure interface to report the diff in a serialized form that is legible for the user.
Abstraction of a diff between two qualified types.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of qualified_t...
friend qualified_type_diff_sptr compute_diff(const qualified_type_def_sptr first, const qualified_type_def_sptr second, diff_context_sptr ctxt)
Compute the diff between two qualified types.
diff_sptr leaf_underlying_type_diff() const
Getter for the diff between the most underlying non-qualified types of two qualified types.
diff_sptr underlying_type_diff() const
Getter for the diff between the underlying types of the two qualified types.
qualified_type_diff(qualified_type_def_sptr first, qualified_type_def_sptr second, diff_sptr underling, diff_context_sptr ctxt=diff_context_sptr())
Constructor for qualified_type_diff.
const qualified_type_def_sptr second_qualified_type() const
Getter for the second qualified type of the diff.
virtual enum change_kind has_local_changes() const
const qualified_type_def_sptr first_qualified_type() const
Getter for the first qualified type of the diff.
virtual const string & get_pretty_representation() const
virtual void report(ostream &, const string &indent="") const
Report the diff in a serialized form.
The abstraction of a diff between two references.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of reference_d...
reference_type_def_sptr first_reference() const
Getter for the first reference of the diff.
reference_type_def_sptr second_reference() const
Getter for the second reference of the diff.
reference_diff(const reference_type_def_sptr first, const reference_type_def_sptr second, diff_sptr underlying, diff_context_sptr ctxt=diff_context_sptr())
Constructor for reference_diff.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
friend reference_diff_sptr compute_diff(reference_type_def_sptr first, reference_type_def_sptr second, diff_context_sptr ctxt)
Compute the diff between two references.
const diff_sptr & underlying_type_diff() const
Getter for the diff between the two referred-to types.
virtual void report(ostream &, const string &indent="") const
Report the diff in a serialized form.
An abstractions of the changes between two scopes.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of scope_diff.
const diff_sptrs_type & changed_types() const
const scope_decl_sptr second_scope() const
Getter for the second scope of the diff.
const scope_decl_sptr first_scope() const
Getter for the first scope of the diff.
const decl_base_sptr deleted_member_at(unsigned index) const
Accessor that eases the manipulation of the edit script associated to this instance....
const diff_sptrs_type & changed_decls() const
scope_diff(scope_decl_sptr first_scope, scope_decl_sptr second_scope, diff_context_sptr ctxt=diff_context_sptr())
Constructor for scope_diff.
friend scope_diff_sptr compute_diff(const scope_decl_sptr first, const scope_decl_sptr second, scope_diff_sptr d, diff_context_sptr ctxt)
Compute the diff between two scopes.
const decl_base_sptr inserted_member_at(unsigned i)
Accessor that eases the manipulation of the edit script associated to this instance....
virtual void report(ostream &out, const string &indent="") const
Report the changes of one scope against another.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
const edit_script & member_changes() const
Accessor of the edit script of the members of a scope.
The abstraction of the diff between two subrange types.
virtual bool has_changes() const
Test if the current subrange_diff node carries any change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of subrange_di...
const array_type_def::subrange_sptr second_subrange() const
Getter of the second subrange of the current instance subrange_diff.
friend subrange_diff_sptr compute_diff(array_type_def::subrange_sptr first, array_type_def::subrange_sptr second, diff_context_sptr ctxt)
Compute the diff between two instances of subrange_diff.
subrange_diff(const array_type_def::subrange_sptr &first, const array_type_def::subrange_sptr &second, const diff_sptr &underlying_type_diff, const diff_context_sptr ctxt=diff_context_sptr())
Constructor of the subrange_diff diff node type.
const array_type_def::subrange_sptr first_subrange() const
Getter of the first subrange of the current instance subrange_diff.
const diff_sptr underlying_type_diff() const
Getter of the diff node of the underlying types of the current subrange_diff diff node.
virtual enum change_kind has_local_changes() const
Test if the current subrange_diff node carries any local change.
virtual const string & get_pretty_representation() const
Getter the pretty representation of the subrange_diff diff node.
virtual void report(ostream &, const string &indent="") const
Report about the changes carried by this node.
An abstraction of a diff between two translation units.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
const translation_unit_sptr second_translation_unit() const
Getter for the second translation unit of this diff.
friend translation_unit_diff_sptr compute_diff(const translation_unit_sptr first, const translation_unit_sptr second, diff_context_sptr ctxt)
Compute the diff between two translation_units.
translation_unit_diff(translation_unit_sptr first, translation_unit_sptr second, diff_context_sptr ctxt=diff_context_sptr())
Constructor for translation_unit_diff.
virtual void report(ostream &out, const string &indent="") const
Report the diff in a serialized form.
virtual enum change_kind has_local_changes() const
const translation_unit_sptr first_translation_unit() const
Getter for the first translation unit of this diff.
Abstraction of a diff between two basic type declarations.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
const type_decl_sptr first_type_decl() const
Getter for the first subject of the type_decl_diff.
const type_decl_sptr second_type_decl() const
Getter for the second subject of the type_decl_diff.
friend type_decl_diff_sptr compute_diff(const type_decl_sptr first, const type_decl_sptr second, diff_context_sptr ctxt)
Compute a diff between two type_decl.
virtual void report(ostream &out, const string &indent="") const
Ouputs a report of the differences between of the two type_decl involved in the type_decl_diff.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
The base class of diff between types.
virtual enum change_kind has_local_changes() const =0
Pure interface to know if the current instance of @diff carries a local change. A local change is a c...
Abstraction of a diff between two typedef_decl.
friend typedef_diff_sptr compute_diff(const typedef_decl_sptr first, const typedef_decl_sptr second, diff_context_sptr ctxt)
Compute a diff between two typedef_decl.
virtual bool has_changes() const
Return true iff the current diff node carries a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of typedef_dif...
const typedef_decl_sptr second_typedef_decl() const
Getter for the second typedef_decl involved in the diff.
const typedef_decl_sptr first_typedef_decl() const
Getter for the firt typedef_decl involved in the diff.
const diff_sptr underlying_type_diff() const
Getter for the diff between the two underlying types of the typedefs.
virtual enum change_kind has_local_changes() const
virtual const string & get_pretty_representation() const
virtual void report(ostream &, const string &indent="") const
Reports the difference between the two subjects of the diff in a serialized form.
friend union_diff_sptr compute_diff(const union_decl_sptr first, const union_decl_sptr second, diff_context_sptr ctxt)
Compute the difference between two union_decl types.
union_diff(union_decl_sptr first_union, union_decl_sptr second_union, diff_context_sptr ctxt=diff_context_sptr())
Constructor for the union_diff type.
union_decl_sptr first_union_decl() const
union_decl_sptr second_union_decl() const
virtual ~union_diff()
Destructor of the union_diff node.
virtual const string & get_pretty_representation() const
virtual void report(ostream &, const string &indent="") const
Report the changes carried by the current union_diff node in a textual format.
Abstracts a diff between two instances of var_decl.
virtual bool has_changes() const
Return true iff the diff node has a change.
virtual void chain_into_hierarchy()
Populate the vector of children node of the diff base type sub-object of this instance of var_diff.
var_diff(var_decl_sptr first, var_decl_sptr second, diff_sptr type_diff, diff_context_sptr ctxt=diff_context_sptr())
Constructor for var_diff.
var_decl_sptr first_var() const
Getter for the first var_decl of the diff.
virtual void report(ostream &out, const string &indent="") const
Report the diff in a serialized form.
virtual enum change_kind has_local_changes() const
friend var_diff_sptr compute_diff(const var_decl_sptr first, const var_decl_sptr second, diff_context_sptr ctxt)
Compute the diff between two instances of var_decl.
virtual const string & get_pretty_representation() const
diff_sptr type_diff() const
Getter for the diff of the types of the instances of var_decl.
var_decl_sptr second_var() const
Getter for the second var_decl of the diff.
The abstraction of an edit script for transforming a sequence A into a sequence B.
shared_ptr< subrange_type > subrange_sptr
Convenience typedef for a shared pointer on a function_decl::subrange.
Definition: abg-ir.h:2537
shared_ptr< base_spec > base_spec_sptr
Convenience typedef.
Definition: abg-ir.h:4251
shared_ptr< parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
Definition: abg-ir.h:3135
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:79
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_UNION_OR_CLASS_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless union or class change.
@ HARMLESS_DECL_NAME_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries a harmless declaration name change....
@ EVERYTHING_CATEGORY
A special enumerator that is the logical 'or' all the enumerators above.
@ NO_CHANGE_CATEGORY
This means the diff node does not carry any (meaningful) change, or that it carries changes that have...
@ HAS_PARENT_WITH_ALLOWED_CHANGE_CATEGORY
A diff node in this category has a parent node that is in the HAS_ALLOWED_CHANGE_CATEGORY category....
@ BENIGN_INFINITE_ARRAY_CHANGE_CATEGORY
A diff node in this category carries a change in the size of the array type of a global variable,...
@ VAR_TYPE_CV_CHANGE_CATEGORY
A diff node in this category is for a variable which type holds a cv-qualifier change.
@ HAS_ALLOWED_CHANGE_CATEGORY
A diff node in this category carries a change that must be reported, even if the diff node is also in...
@ FN_PARM_TYPE_CV_CHANGE_CATEGORY
A diff node in this category has a function parameter type with a cv-qualifiers change.
@ FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY
A diff node in this category is a function parameter type which top cv-qualifiers change.
@ FN_RETURN_TYPE_CV_CHANGE_CATEGORY
A diff node in this category is a function return type with a cv-qualifier change.
@ HARMLESS_SYMBOL_ALIAS_CHANGE_CATEGORY
This means that a diff node in the sub-tree carries an a symbol alias change that is harmless.
shared_ptr< reporter_base > reporter_base_sptr
A convenience typedef for a shared pointer to a reporter_base.
Definition: abg-reporter.h:54
unordered_map< string, var_diff_sptr > string_var_diff_sptr_map
Convenience typedef for a map whose key is a string and whose value is a changed variable of type var...
const class_or_union_diff * is_diff_of_class_or_union_type(const diff *d)
Test if a diff node represents a diff between two class or union types.
const 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:71
shared_ptr< subrange_diff > subrange_diff_sptr
A convenience typedef for a shared pointer to subrange_diff type.
bool is_diff_of_variadic_parameter_type(const diff *d)
Test if a diff node represents the difference between a variadic parameter type and something else.
diff_category get_default_harmful_categories_bitmap()
Getter of a bitmap made of the set of change categories that are considered harmful.
unordered_map< string, function_decl::parameter_sptr > string_parm_map
Convenience typedef for a map which value is a function parameter. The key is the name of the functio...
unordered_map< string, enum_type_decl::enumerator > string_enumerator_map
Convenience typedef for a map which value is an enumerator. The key is the name of the enumerator.
shared_ptr< var_diff > var_diff_sptr
Convenience typedef for a shared pointer to a var_diff type.
unordered_map< string, method_decl_sptr > string_member_function_sptr_map
Convenience typedef for a hash map of strings and member functions.
const diff * peel_typedef_diff(const diff *dif)
If a diff node is about changes between two typedef types, get the diff node about changes between th...
shared_ptr< reference_diff > reference_diff_sptr
Convenience typedef for a shared pointer on a reference_diff type.
vector< base_diff_sptr > base_diff_sptrs_type
Convenience typedef for a vector of base_diff_sptr.
shared_ptr< function_decl_diff > function_decl_diff_sptr
Convenience typedef for a shared pointer to a function_decl type.
shared_ptr< ptr_to_mbr_diff > ptr_to_mbr_diff_sptr
Typedef of a shared_ptr to ptr_to_mbr_diff.
const function_decl_diff * is_function_decl_diff(const diff *diff)
Test if a diff node is about differences between functions.
shared_ptr< fn_parm_diff > fn_parm_diff_sptr
Convenience typedef for a shared pointer to a fn_parm_diff type.
vector< decl_diff_base_sptr > decl_diff_base_sptrs_type
Convenience typedef for a vector of decl_diff_base_sptr.
unordered_map< string, function_decl_diff_sptr > string_function_decl_diff_sptr_map
Convenience typedef for a map which key is a string and which value is a function_decl_diff_sptr.
void clear_redundancy_categorization(diff *diff_tree)
Walk a given diff sub-tree to clear the REDUNDANT_CATEGORY out of the category of the nodes.
unordered_map< string, const 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.
bool is_child_node_of_base_diff(const diff *diff)
Test if a diff node is a child node of a base diff node.
visiting_kind
An enum for the different ways to visit a diff tree node.
@ SKIP_CHILDREN_VISITING_KIND
This says that the traversing code should avoid visiting the children nodes of the current node being...
@ DEFAULT_VISITING_KIND
The default enumerator value of this enum. It doesn't have any particular meaning yet.
@ DO_NOT_MARK_VISITED_NODES_AS_VISITED
This says that the traversing code should not mark visited nodes as having been traversed....
visiting_kind operator&(visiting_kind l, visiting_kind r)
The overloaded and operator for visiting_kind.
shared_ptr< diff_traversable_base > diff_traversable_base_sptr
Convenience typedef for shared_ptr on diff_traversable_base.
std::pair< var_decl *, var_decl * > changed_var_ptr
Convenience typedef for a pair of pointer to var_decl representing a var_decl change....
pair< method_decl_sptr, method_decl_sptr > changed_member_function_sptr
Convenience typedef for a pair of class_decl::member_function_sptr representing a changed member func...
const diff * peel_fn_parm_diff(const diff *dif)
If a diff node is about changes between two function parameters get the diff node about changes betwe...
const function_type_diff * is_function_type_diff(const diff *diff)
Test if a diff node is a function_type_diff node.
const distinct_diff * is_distinct_diff(const diff *diff)
Test if a diff node is about differences between two diff nodes of different kinds.
unordered_map< string, changed_enumerator > string_changed_enumerator_map
Convenience typedef for a map which value is a changed enumerator. The key is the name of the changed...
visiting_kind operator|(visiting_kind l, visiting_kind r)
The overloaded or operator for visiting_kind.
const array_diff * is_array_diff(const diff *diff)
Test if a diff node is a array_diff node.
const diff * peel_reference_diff(const diff *dif)
If a diff node is about changes between two reference types, get the diff node about changes between ...
unordered_map< string, fn_parm_diff_sptr > string_fn_parm_diff_sptr_map
Convenience typedef for a map which value is a changed function parameter and which key is the name o...
string get_pretty_representation(diff *d)
Get a copy of the pretty representation of a diff node.
const class_or_union_diff * is_anonymous_class_or_union_diff(const diff *d)
Test if a diff node is a class_or_union_diff between two anonymous classes or unions.
shared_ptr< base_diff > base_diff_sptr
Convenience typedef for a shared pointer to a base_diff type.
shared_ptr< scope_diff > scope_diff_sptr
Convenience typedef for a shared pointer on a scope_diff.
shared_ptr< class_diff > class_diff_sptr
Convenience typedef for a shared pointer on a class_diff type.
const base_diff * is_base_diff(const diff *diff)
Test if a diff node is about differences between two base class specifiers.
const fn_parm_diff * is_fn_parm_diff(const diff *diff)
Test if a diff node is about differences between two function parameters.
const union_diff * is_union_diff(const diff *diff)
Test if a diff node is a union_diff node.
unordered_map< string, type_diff_base_sptr > string_type_diff_base_sptr_map
Convenience typedef for a map which value is a type_diff_base_sptr. The key of the map is the qualifi...
vector< changed_var_sptr > changed_var_sptrs_type
Convenience typedef for a vector of @changed_var_sptr.gg381.
shared_ptr< pointer_diff > pointer_diff_sptr
Convenience typedef for a shared pointer on a pointer_diff type.
unordered_map< unsigned, decl_base_sptr > unsigned_decl_base_sptr_map
Convenience typedef for a map which key is an unsigned integer and which value is a decl_base_sptr.
const diff * peel_pointer_diff(const diff *dif)
If a diff node is about changes between two pointer types, get the diff node about changes between th...
void apply_suppressions(diff *diff_tree)
Walk a given diff-sub tree and appply the suppressions carried by the context. If the suppression app...
const enum_diff * is_enum_diff(const diff *diff)
Test if a diff node is a enum_diff node.
unordered_map< string, base_diff_sptr > string_base_diff_sptr_map
Convenience typedef for a map of string and base_diff_sptr.
unordered_map< size_t, size_t > pointer_map
Convenience typedef for a map of pointer values. The Key is a pointer value and the value is potentia...
const class_or_union_diff * is_class_or_union_diff(const diff *d)
Test if a diff node is a class_or_union_diff node.
const corpus_diff * is_corpus_diff(const diff *diff)
Test if a diff node is a corpus_diff node.
const diff * get_typedef_diff_underlying_type_diff(const diff *diff)
Return the leaf underlying diff node of a typedef_diff node.
const typedef_diff * is_typedef_diff(const diff *diff)
Test if a diff node is a typedef_diff node.
unordered_map< unsigned, var_diff_sptr > unsigned_var_diff_sptr_map
Convenience typedef for a map whose key is an unsigned int and whose value is a changed variable of t...
const diff * peel_typedef_qualified_type_or_parameter_diff(const diff *dif)
If a diff node is about changes between two typedefs or qualified types, get the diff node about chan...
unordered_set< diff_sptr, diff_sptr_hasher > unordered_diff_sptr_set
Convenience typedef for an unoredered set of diff_sptr.
shared_ptr< array_diff > array_diff_sptr
Convenience typedef for a shared pointer on a array_diff type.
const class_diff * is_class_diff(const diff *diff)
Test if a diff node is a class_diff node.
const type_decl_diff * is_diff_of_basic_type(const diff *d)
Test if a diff node represents a diff between two basic types.
unordered_map< string, diff_sptr > string_diff_sptr_map
Convenience typedef for a map which value is a diff_sptr. The key of the map is the qualified name of...
const qualified_type_diff * is_qualified_type_diff(const diff *diff)
Test if a diff node is about differences between two qualified types.
diff_sptr compute_diff(const decl_base_sptr first, const decl_base_sptr second, diff_context_sptr ctxt)
Compute the difference between two decls. The decls can represent either type declarations,...
unordered_map< string, diff * > string_diff_ptr_map
Convenience typedef for a map which value is a diff*. The key of the map is the qualified name of the...
void print_diff_tree(diff *diff_tree, ostream &out)
Emit a textual representation of a diff sub-tree to an output stream.
vector< changed_enumerator > changed_enumerators_type
Convenience typedef for a vector of changed enumerators.
vector< function_decl_diff_sptr > function_decl_diff_sptrs_type
Convenience typedef for a vector of function_decl_diff_sptr.
bool is_child_node_of_function_parm_diff(const diff *diff)
Test if a diff node is a child node of a function parameter diff node.
shared_ptr< function_type_diff > function_type_diff_sptr
A convenience typedef for a shared pointer to function_type_type_diff.
unordered_map< string, decl_diff_base_sptr > string_decl_diff_base_sptr_map
Convenience typedef for a map which value is a decl_diff_base_sptr. The key of the map is the qualifi...
const function_type_diff * is_function_type_diff_with_local_changes(const diff *diff)
Test if a given diff node carries a function type change with local changes.
const var_diff * is_var_diff(const diff *diff)
Test if a diff node is about differences between variables.
const type_diff_base * is_type_diff(const diff *diff)
Test if a diff node is about differences between types.
unordered_map< string, elf_symbol_sptr > string_elf_symbol_map
Convenience typedef for a map whose key is a string and whose value is an elf_symbol_sptr.
const reference_diff * is_reference_diff(const diff *diff)
Test if a diff node is about differences between two references.
void apply_filters(corpus_diff_sptr diff_tree)
Apply the diff tree filters that have been associated to the context of the a given corpus_diff tree....
shared_ptr< distinct_diff > distinct_diff_sptr
Convenience typedef for a shared pointer to distinct_types_diff.
shared_ptr< corpus_diff > corpus_diff_sptr
A convenience typedef for a shared pointer to corpus_diff.
std::pair< var_decl_sptr, var_decl_sptr > changed_var_sptr
Convenience typedef for a pair of var_decl_sptr representing a var_decl change. The first member of t...
shared_ptr< typedef_diff > typedef_diff_sptr
Convenience typedef for a shared pointer on a typedef_diff type.
const diff * peel_typedef_or_qualified_type_diff(const diff *dif)
If a diff node is about changes between two typedefs or qualified types, get the diff node about chan...
unordered_map< string, const function_decl * > string_function_ptr_map
Convenience typedef for a map which key is a string and which value is a pointer to decl_base.
ostream & operator<<(ostream &o, diff_category c)
Serialize an instance of diff_category to an output stream.
shared_ptr< translation_unit_diff > translation_unit_diff_sptr
Convenience typedef for a shared pointer on a translation_unit_diff type.
shared_ptr< reference_type_def > reference_type_def_sptr
Convenience typedef for a shared pointer on a reference_type_def.
Definition: abg-fwd.h:236
shared_ptr< function_decl > function_decl_sptr
Convenience typedef for a shared pointer on a function_decl.
Definition: abg-fwd.h:270
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:550
change_kind
A bitfield that gives callers of abigail::ir::equals() some insight about how different two internal ...
Definition: abg-ir.h:1323
shared_ptr< array_type_def > array_type_def_sptr
Convenience typedef for a shared pointer on a array_type_def.
Definition: abg-fwd.h:245
shared_ptr< class_decl > class_decl_sptr
Convenience typedef for a shared pointer on a class_decl.
Definition: abg-fwd.h:194
shared_ptr< function_type > function_type_sptr
Convenience typedef for a shared pointer on a function_type.
Definition: abg-fwd.h:211
shared_ptr< typedef_decl > typedef_decl_sptr
Convenience typedef for a shared pointer on a typedef_decl.
Definition: abg-fwd.h:168
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
Definition: abg-fwd.h:257
shared_ptr< ptr_to_mbr_type > ptr_to_mbr_type_sptr
Convenience typedef for a shared pointer to a ptr_to_mbr_type.
Definition: abg-fwd.h:240
shared_ptr< scope_decl > scope_decl_sptr
Convenience typedef for a shared pointer on a scope_decl.
Definition: abg-fwd.h:265
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:121
shared_ptr< translation_unit > translation_unit_sptr
Convenience typedef for a shared pointer on a translation_unit type.
Definition: abg-fwd.h:137
unordered_map< string, decl_base_sptr > string_decl_base_sptr_map
Convenience typedef for a map which key is a string and which value is a decl_base_sptr.
Definition: abg-fwd.h:158
shared_ptr< pointer_type_def > pointer_type_def_sptr
Convenience typedef for a shared pointer on a pointer_type_def.
Definition: abg-fwd.h:227
shared_ptr< enum_type_decl > enum_type_decl_sptr
Convenience typedef for shared pointer to a enum_type_decl.
Definition: abg-fwd.h:176
shared_ptr< type_decl > type_decl_sptr
Convenience typedef for a shared pointer on a type_decl.
Definition: abg-fwd.h:162
vector< suppression_sptr > suppressions_type
Convenience typedef for a vector of suppression_sptr.
Definition: abg-fwd.h:1658
shared_ptr< suppression_base > suppression_sptr
Convenience typedef for a shared pointer to a suppression.
Definition: abg-fwd.h:1655
Toplevel namespace for libabigail.
The type of the private data (pimpl sub-object) of the class_diff type.
The type of private data of class_or_union_diff.
The type of the private data of corpus_diff::diff_stats.
The private member (pimpl) for diff_context.
size_t operator()(const diff_sptr &t) const
The actual hashing functor.
The private data structure for distinct_diff.
The internal type for the impl idiom implementation of pointer_diff.
The private data of the ptr_to_mbr_diff type.
The internal type for the impl idiom implementation of subrange_diff.
The internal type for the impl idiom implementation of var_diff.
The base class for the visitor type hierarchy used for traversing a hierarchy of nodes.
Definition: abg-traverse.h:28