libabigail
|
Facilities to walk, categorize and possibly filter nodes of the diff tree. More...
Classes | |
struct | filter_base |
The base class for the diff tree node filter. More... | |
class | harmless_filter |
A filter that walks the diff nodes tree and tags relevant diff nodes into categories considered to represent harmless changes. More... | |
class | harmless_harmful_filter |
A filter that walks the diff nodes tree and tags relevant diff nodes into categories considered to represent potentially harmless or harmful changes. More... | |
Typedefs | |
typedef shared_ptr< filter_base > | filter_base_sptr |
Convenience typedef for a shared pointer to filter_base. More... | |
typedef std::vector< filter_base_sptr > | filters |
Convenience typedef for a vector of filter_base_sptr. More... | |
typedef shared_ptr< harmless_harmful_filter > | harmful_harmless_filter_sptr |
A convenience typedef for a shared pointer to harmful_filter. More... | |
typedef shared_ptr< harmless_filter > | harmless_filter_sptr |
Convenience typedef for a shared pointer to a harmless_filter. More... | |
Functions | |
void | apply_filter (filter_base &filter, corpus_diff_sptr d) |
Walk the diff sub-trees of a a corpus_diff and apply a filter to the nodes visted. The filter categorizes each node, assigning it into one or several categories. More... | |
void | apply_filter (filter_base &filter, diff_sptr d) |
Walk a diff sub-tree and apply a filter to the nodes visted. The filter categorizes each node, assigning it into one or several categories. More... | |
void | apply_filter (filter_base_sptr filter, diff_sptr d) |
Walk a diff sub-tree and apply a filter to the nodes visted. The filter categorizes each node, assigning it into one or several categories. More... | |
bool | has_anonymous_data_member_change (const diff *d) |
Test if a diff node carries a non-anonymous data member to anonymous data member change, or vice-versa. More... | |
bool | has_anonymous_data_member_change (const diff_sptr &d) |
Test if a diff node carries a non-anonymous data member to anonymous data member change, or vice-versa. More... | |
bool | has_basic_or_class_type_name_change (const diff *d) |
Test if a diff node carries a basic or class type name change. More... | |
bool | has_basic_type_name_change (const diff *d) |
Test if a diff node carries a basic type name change. More... | |
bool | has_class_decl_only_def_change (const class_or_union_sptr &first, const class_or_union_sptr &second) |
Test if two class_or_union_sptr are different just by the fact that one is decl-only and the other one is defined. More... | |
bool | has_class_decl_only_def_change (const diff *diff) |
Test if a class_or_union_diff carries a change in which the two classes are different by the fact that one is a decl-only and the other one is defined. More... | |
bool | has_class_or_union_type_name_change (const diff *d) |
Test if a diff node carries a class or union type name change. More... | |
bool | has_data_member_replaced_by_anon_dm (const diff *diff) |
Test if a class_or_union_diff has a data member replaced by an anonymous data member in a harmless way. That means, the new anonymous data member somehow contains the replaced data member and it doesn't break the layout of the containing class. More... | |
bool | has_decl_only_def_change (const decl_base_sptr &first, const decl_base_sptr &second) |
Test if two decl_base_sptr are different just by the fact that one is decl-only and the other one is defined. More... | |
bool | has_decl_only_def_change (const diff *d) |
Test if a diff carries a change in which the two decls are different by the fact that one is a decl-only and the other one is defined. More... | |
bool | has_enum_decl_only_def_change (const diff *diff) |
Test if a enum_diff carries a change in which the two enums are different by the fact that one is a decl-only and the other one is defined. More... | |
bool | has_enum_decl_only_def_change (const enum_type_decl_sptr &first, const enum_type_decl_sptr &second) |
Test if two enum_sptr are different just by the fact that one is decl-only and the other one is defined. More... | |
bool | has_harmful_name_change (const decl_base_sptr &f, const decl_base_sptr &s) |
Test if two decls represents a harmful name change. More... | |
bool | has_harmful_name_change (const diff *dif) |
Test if a diff node represents a harmful name change. More... | |
bool | has_harmless_name_change (const decl_base_sptr &f, const decl_base_sptr &s) |
Test if two decls represents a harmless name change. More... | |
bool | has_virtual_mem_fn_change (const function_decl_diff *diff) |
Test if the function_decl_diff node has a change involving virtual member functions. More... | |
bool | is_decl_only_class_with_size_change (const class_or_union &first, const class_or_union &second) |
Test if two classes that are decl-only (have the decl-only flag and carry no data members) but are different just by their size. More... | |
bool | is_decl_only_class_with_size_change (const class_or_union_sptr &first, const class_or_union_sptr &second) |
Test if two classes that are decl-only (have the decl-only flag and carry no data members) but are different just by their size. More... | |
bool | is_decl_only_class_with_size_change (const diff *diff) |
Test if a diff node is for two classes that are decl-only (have the decl-only flag and carry no data members) but are different just by their size. More... | |
bool | is_mostly_distinct_diff (const diff *d) |
Test if a diff node carries a distinct type change or a pointer/reference/typedef to distinct type change. More... | |
bool | is_var_1_dim_unknown_size_array_change (const diff *diff) |
Test if we are looking at a diff that carries a change of variables which types are both one dimension array, with one of them being of unknow size and the two variables having the same symbol size. More... | |
bool | is_var_1_dim_unknown_size_array_change (const var_decl_sptr &var1, const var_decl_sptr &var2) |
Test if we are looking at two variables which types are both one dimension array, with one of them being of unknow size and the two variables having the same symbol size. More... | |
bool | union_diff_has_harmless_changes (const diff *d) |
Test if a union diff node does have changes that don't impact its size. More... | |
Facilities to walk, categorize and possibly filter nodes of the diff tree.
typedef shared_ptr< filter_base > filter_base_sptr |
Convenience typedef for a shared pointer to filter_base.
Definition at line 103 of file abg-comp-filter.h.
typedef std::vector< filter_base_sptr > filters |
Convenience typedef for a vector of filter_base_sptr.
Definition at line 105 of file abg-comp-filter.h.
typedef shared_ptr<harmless_harmful_filter> harmful_harmless_filter_sptr |
A convenience typedef for a shared pointer to harmful_filter.
Definition at line 144 of file abg-comp-filter.h.
typedef shared_ptr<harmless_filter> harmless_filter_sptr |
Convenience typedef for a shared pointer to a harmless_filter.
Definition at line 129 of file abg-comp-filter.h.
void apply_filter | ( | filter_base & | filter, |
corpus_diff_sptr | d | ||
) |
Walk the diff sub-trees of a a corpus_diff and apply a filter to the nodes visted. The filter categorizes each node, assigning it into one or several categories.
filter | the filter to apply to the diff nodes |
d | the corpus diff to apply the filter to. |
Definition at line 41 of file abg-comp-filter.cc.
void apply_filter | ( | filter_base & | filter, |
diff_sptr | d | ||
) |
Walk a diff sub-tree and apply a filter to the nodes visted. The filter categorizes each node, assigning it into one or several categories.
Note that this function makes sure to avoid visiting a node (or any other node equivalent to it) more than once. This helps avoid infinite loops for diff trees that involve type changes that reference themselves.
filter | the filter to apply to the nodes of the sub-tree. |
d | the diff sub-tree to walk and apply the filter to. |
Definition at line 62 of file abg-comp-filter.cc.
void apply_filter | ( | filter_base_sptr | filter, |
diff_sptr | d | ||
) |
Walk a diff sub-tree and apply a filter to the nodes visted. The filter categorizes each node, assigning it into one or several categories.
Note that this function makes sure to avoid visiting a node (or any other node equivalent to it) more than once. This helps avoid infinite loops for diff trees that involve type changes that reference themselves.
filter | the filter to apply to the nodes of the sub-tree. |
d | the diff sub-tree to walk and apply the filter to. |
Definition at line 84 of file abg-comp-filter.cc.
bool has_anonymous_data_member_change | ( | const diff * | d | ) |
Test if a diff node carries a non-anonymous data member to anonymous data member change, or vice-versa.
d | the diff node to consider. |
d
carries a non-anonymous to anonymous data member change, or vice-versa. Definition at line 1337 of file abg-comp-filter.cc.
bool has_anonymous_data_member_change | ( | const diff_sptr & | d | ) |
Test if a diff node carries a non-anonymous data member to anonymous data member change, or vice-versa.
d | the diff node to consider. |
d
carries a non-anonymous to anonymous data member change, or vice-versa. Definition at line 1353 of file abg-comp-filter.cc.
bool has_basic_or_class_type_name_change | ( | const diff * | d | ) |
Test if a diff node carries a basic or class type name change.
d | the diff node to consider. |
Definition at line 1273 of file abg-comp-filter.cc.
bool has_basic_type_name_change | ( | const diff * | d | ) |
Test if a diff node carries a basic type name change.
d | the diff node to consider. |
Definition at line 1241 of file abg-comp-filter.cc.
bool has_class_decl_only_def_change | ( | const class_or_union_sptr & | first, |
const class_or_union_sptr & | second | ||
) |
Test if two class_or_union_sptr are different just by the fact that one is decl-only and the other one is defined.
first | the first class or union to consider. |
second | the second class or union to consider. |
Definition at line 1147 of file abg-comp-filter.cc.
bool has_class_decl_only_def_change | ( | const diff * | diff | ) |
Test if a class_or_union_diff carries a change in which the two classes are different by the fact that one is a decl-only and the other one is defined.
diff | the diff node to consider. |
Definition at line 1199 of file abg-comp-filter.cc.
bool has_class_or_union_type_name_change | ( | const diff * | d | ) |
Test if a diff node carries a class or union type name change.
d | the diff node to consider. |
Definition at line 1257 of file abg-comp-filter.cc.
bool has_data_member_replaced_by_anon_dm | ( | const diff * | diff | ) |
Test if a class_or_union_diff has a data member replaced by an anonymous data member in a harmless way. That means, the new anonymous data member somehow contains the replaced data member and it doesn't break the layout of the containing class.
diff | the diff node to consider. |
Definition at line 627 of file abg-comp-filter.cc.
bool has_decl_only_def_change | ( | const decl_base_sptr & | first, |
const decl_base_sptr & | second | ||
) |
Test if two decl_base_sptr are different just by the fact that one is decl-only and the other one is defined.
first | the first decl to consider. |
second | the second decl to consider. |
Definition at line 1096 of file abg-comp-filter.cc.
bool has_decl_only_def_change | ( | const diff * | d | ) |
Test if a diff carries a change in which the two decls are different by the fact that one is a decl-only and the other one is defined.
diff | the diff node to consider. |
Definition at line 1123 of file abg-comp-filter.cc.
bool has_enum_decl_only_def_change | ( | const diff * | diff | ) |
Test if a enum_diff carries a change in which the two enums are different by the fact that one is a decl-only and the other one is defined.
diff | the diff node to consider. |
Definition at line 1223 of file abg-comp-filter.cc.
bool has_enum_decl_only_def_change | ( | const enum_type_decl_sptr & | first, |
const enum_type_decl_sptr & | second | ||
) |
Test if two enum_sptr are different just by the fact that one is decl-only and the other one is defined.
first | the first enum to consider. |
second | the second enum to consider. |
Definition at line 1174 of file abg-comp-filter.cc.
bool has_harmful_name_change | ( | const decl_base_sptr & | f, |
const decl_base_sptr & | s | ||
) |
Test if two decls represents a harmful name change.
A harmful name change is a name change that is not harmless, so this function uses the function has_harmless_name_change.
f | the first decl to consider in the comparison. |
s | the second decl to consider in the comparison. |
s
represents a harmful name change over f
. Definition at line 552 of file abg-comp-filter.cc.
bool has_harmful_name_change | ( | const diff * | dif | ) |
Test if a diff node represents a harmful name change.
A harmful name change is a name change that is not harmless, so this function uses the function has_harmless_name_change.
f | the first decl to consider in the comparison. |
s | the second decl to consider in the comparison. |
s
represents a harmful name change over f
. Definition at line 567 of file abg-comp-filter.cc.
bool has_harmless_name_change | ( | const decl_base_sptr & | f, |
const decl_base_sptr & | s | ||
) |
Test if two decls represents a harmless name change.
For now, a harmless name change is considered only for a typedef, enum or a data member.
f | the first decl to consider in the comparison. |
s | the second decl to consider in the comparison. |
s
represents a harmless change over f
. Definition at line 505 of file abg-comp-filter.cc.
bool has_virtual_mem_fn_change | ( | const function_decl_diff * | diff | ) |
Test if the function_decl_diff node has a change involving virtual member functions.
That means whether there is an added, removed or changed virtual member function.
diff | the function_decl_diff node to consider. |
Definition at line 886 of file abg-comp-filter.cc.
bool is_decl_only_class_with_size_change | ( | const class_or_union & | first, |
const class_or_union & | second | ||
) |
Test if two classes that are decl-only (have the decl-only flag and carry no data members) but are different just by their size.
In some weird DWARF representation, it happens that a decl-only class (with no data member) actually carries a non-zero size. That shouldn't happen, but hey, we need to deal with real life. So we need to detect that case first.
first | the first class or union to consider. |
seconf | the second class or union to consider. |
Definition at line 1016 of file abg-comp-filter.cc.
bool is_decl_only_class_with_size_change | ( | const class_or_union_sptr & | first, |
const class_or_union_sptr & | second | ||
) |
Test if two classes that are decl-only (have the decl-only flag and carry no data members) but are different just by their size.
In some weird DWARF representation, it happens that a decl-only class (with no data member) actually carries a non-zero size. That shouldn't happen, but hey, we need to deal with real life. So we need to detect that case first.
first | the first class or union to consider. |
seconf | the second class or union to consider. |
Definition at line 1046 of file abg-comp-filter.cc.
bool is_decl_only_class_with_size_change | ( | const diff * | diff | ) |
Test if a diff node is for two classes that are decl-only (have the decl-only flag and carry no data members) but are different just by their size.
In some weird DWARF representation, it happens that a decl-only class (with no data member) actually carries a non-zero size. That shouldn't happen, but hey, we need to deal with real life. So we need to detect that case first.
diff | the diff node to consider. |
Definition at line 1072 of file abg-comp-filter.cc.
bool is_mostly_distinct_diff | ( | const diff * | d | ) |
Test if a diff node carries a distinct type change or a pointer/reference/typedef to distinct type change.
Note that a distinct type change is a change where the two subjects of the change are not of the same kind, e.g, a basic type that got changed into a qualified type.
d | the diff node to consider. |
d
is mostly a distinct diff. Definition at line 1290 of file abg-comp-filter.cc.
bool is_var_1_dim_unknown_size_array_change | ( | const diff * | diff | ) |
Test if we are looking at a diff that carries a change of variables which types are both one dimension array, with one of them being of unknow size and the two variables having the same symbol size.
This can happen in the case of these two declarations, for instance:
unsigned int array[];
and:
unsigned int array[] ={0};
In both cases, the size of the ELF symbol of the variable 'array' is 32 bits, but, at least in the first case
Definition at line 703 of file abg-comp-filter.cc.
bool is_var_1_dim_unknown_size_array_change | ( | const var_decl_sptr & | var1, |
const var_decl_sptr & | var2 | ||
) |
Test if we are looking at two variables which types are both one dimension array, with one of them being of unknow size and the two variables having the same symbol size.
This can happen in the case of these two declarations, for instance:
unsigned int array[];
and:
unsigned int array[] ={0};
In both cases, the size of the ELF symbol of the variable 'array' is 32 bits, but, at least in the first case
Definition at line 651 of file abg-comp-filter.cc.
bool union_diff_has_harmless_changes | ( | const diff * | d | ) |
Test if a union diff node does have changes that don't impact its size.
d | the union diff node to consider. |
d
is a diff node which has changes that don't impact its size. Definition at line 1734 of file abg-comp-filter.cc.