libabigail
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
class_diff Class Reference

This type abstracts changes for a class_decl. More...

#include <abg-comparison.h>

Inheritance diagram for class_diff:
[legend]

Classes

struct  priv
 The type of the private data (pimpl sub-object) of the class_diff type. More...
 

Public Member Functions

edit_scriptbase_changes ()
 
const edit_scriptbase_changes () const
 
virtual void chain_into_hierarchy ()
 Populate the vector of children node of the diff base type sub-object of this instance of class_diff. More...
 
const base_diff_sptrs_typechanged_bases ()
 Getter for the changed base classes of the diff. More...
 
const string_base_sptr_mapdeleted_bases () const
 Getter for the deleted base classes of the diff. More...
 
class_decl_sptr first_class_decl () const
 
virtual const string & get_pretty_representation () const
 
virtual bool has_changes () const
 Return true iff the current diff node carries a change. More...
 
virtual enum change_kind has_local_changes () const
 
const string_base_sptr_mapinserted_bases () const
 Getter for the inserted base classes of the diff. More...
 
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. If this vector is not empty, it means the bases of the underlying class type got re-ordered. More...
 
virtual void report (ostream &, const string &indent="") const
 Produce a basic report about the changes between two class_decl. More...
 
class_decl_sptr second_class_decl () const
 Getter of the second class involved in the diff. More...
 
- Public Member Functions inherited from class_or_union_diff
virtual ~class_or_union_diff ()
 Destructor of class_or_union_diff. More...
 
const unsigned_var_diff_sptr_mapchanged_data_members () const
 Getter of the map of data members that got replaced by another data member. The key of the map is the offset at which the element got replaced and the value is a pointer to the var_diff representing the replacement of the data member. More...
 
const function_decl_diff_sptrs_typechanged_member_fns () const
 Getter for the virtual members functions that have had a change in a sub-type, without having a change in their symbol name. More...
 
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. More...
 
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. More...
 
edit_scriptdata_members_changes ()
 
const edit_scriptdata_members_changes () const
 
const string_decl_base_sptr_mapdata_members_replaced_by_adms () const
 Get the map of data members that got replaced by anonymous data members. More...
 
const string_decl_base_sptr_mapdeleted_data_members () const
 Getter for the data members that got deleted. More...
 
const string_member_function_sptr_mapdeleted_member_fns () const
 
class_or_union_sptr first_class_or_union () const
 
const class_or_union_diff::priv_ptr & get_priv () const
 Getter of the private data of the class_or_union_diff type. More...
 
const string_decl_base_sptr_mapinserted_data_members () const
 Getter for the data members that got inserted. More...
 
const string_member_function_sptr_mapinserted_member_fns () const
 
edit_scriptmember_class_tmpls_changes ()
 
const edit_scriptmember_class_tmpls_changes () const
 
edit_scriptmember_fn_tmpls_changes ()
 
const edit_scriptmember_fn_tmpls_changes () const
 
edit_scriptmember_fns_changes ()
 
const edit_scriptmember_fns_changes () const
 
edit_scriptmember_types_changes ()
 
const edit_scriptmember_types_changes () const
 
const changed_var_sptrs_typeordered_data_members_replaced_by_adms () const
 Get an ordered vector of of data members that got replaced by anonymous data members. More...
 
class_or_union_sptr second_class_or_union () const
 
const var_diff_sptrs_typesorted_changed_data_members () const
 Getter of the sorted vector of data members that got replaced by another data member. More...
 
const var_diff_sptrs_typesorted_subtype_changed_data_members () const
 Getter of the sorted vector of data members with a (sub-)type change. More...
 
- Public Member Functions inherited from diff
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 thoses inherited from the children nodes of this diff node. More...
 
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 the current diff node. More...
 
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 diff node. More...
 
void append_child_node (diff_sptr)
 Add a new child node to the vector of children nodes for the current diff node. More...
 
const vector< diff * > & children_nodes () const
 Getter for the children nodes of the current diff node. More...
 
const diff_context_sptr context () const
 Getter of the context of the current diff. More...
 
void context (diff_context_sptr c)
 Setter of the context of the current diff. More...
 
bool currently_reporting () const
 Tests if we are currently in the middle of emitting a report for this diff. More...
 
void currently_reporting (bool f) const
 Sets a flag saying if we are currently in the middle of emitting a report for this diff. More...
 
type_or_decl_base_sptr first_subject () const
 Getter of the first subject of the diff. More...
 
diffget_canonical_diff () const
 Getter for the canonical diff of the current instance of diff. More...
 
diff_category get_category () const
 Getter for the category of the current diff tree node. More...
 
diff_category get_class_of_equiv_category () const
 Getter of the category of the class of equivalence of the current diff tree node. More...
 
diff_category get_local_category () const
 Getter for the local category of the current diff tree node. More...
 
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 suppression specification. More...
 
bool has_local_changes_to_be_reported () const
 Test if this diff tree node should be reported when considering the categories that were *NOT* inherited from its children nodes. More...
 
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 suppression specification. More...
 
bool is_allowed_by_specific_negated_suppression () const
 Test if this diff node is allowed (prevented from being suppressed) by at least one negated suppression specification. More...
 
bool is_filtered_out () const
 Test if this diff tree node is to be filtered out for reporting purposes. More...
 
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 categories that can /force/ the node to be unfiltered. More...
 
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 categories that were *NOT* inherited from its children nodes. More...
 
bool is_suppressed () const
 Test if the current diff node has been suppressed by a user-provided suppression specification. More...
 
bool is_suppressed (bool &is_private_type) const
 Test if the current diff node has been suppressed by a user-provided suppression specification or by an auto-generated "private type" suppression specification. More...
 
bool is_traversing () const
 Tell if a given node is being traversed or not. More...
 
const diffparent_node () const
 Getter for the parent node of the current diff node. More...
 
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 inherited from the children nodes of the current diff node. More...
 
diff_category remove_from_local_category (diff_category c)
 Remove the current diff tree node from the categories resulting from the local changes. More...
 
bool reported_once () const
 Tests if a report has already been emitted for the current diff. More...
 
void reported_once (bool f) const
 Sets a flag saying if a report has already been emitted for the current diff. More...
 
type_or_decl_base_sptr second_subject () const
 Getter of the second subject of the diff. More...
 
void set_category (diff_category c)
 Set the category of the current diff node. This category includes the categories inherited from the children nodes of the current diff node. More...
 
void set_local_category (diff_category c)
 Set the local category of the current diff node. More...
 
bool to_be_reported () const
 Test if this diff tree node should be reported. More...
 
virtual bool traverse (diff_node_visitor &v)
 The generic traversing code that walks a given diff sub-tree. More...
 
- Public Member Functions inherited from traversable_base
virtual ~traversable_base ()
 Destructor of the traversable_base type. More...
 

Protected Member Functions

 class_diff (class_decl_sptr first_scope, class_decl_sptr second_scope, diff_context_sptr ctxt=diff_context_sptr())
 Constructor of class_diff. More...
 
- Protected Member Functions inherited from class_or_union_diff
 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. More...
 
void allocate_priv_data ()
 Allocate the memory for the priv_ pimpl data member of the class_or_union_diff class. More...
 
void clear_lookup_tables (void)
 Clear the lookup tables useful for reporting. More...
 
void ensure_lookup_tables_populated (void) const
 If the lookup tables are not yet built, walk the differences and fill them. More...
 
bool lookup_tables_empty (void) const
 Tests if the lookup tables are empty. More...
 
- Protected Member Functions inherited from type_diff_base
 type_diff_base (type_base_sptr first_subject, type_base_sptr second_subject, diff_context_sptr ctxt)
 
- Protected Member Functions inherited from diff
 diff (type_or_decl_base_sptr first_subject, type_or_decl_base_sptr second_subject)
 Constructor for the diff type. More...
 
 diff (type_or_decl_base_sptr first_subject, type_or_decl_base_sptr second_subject, diff_context_sptr ctxt)
 Constructor for the diff type. More...
 
void begin_traversing ()
 Flag a given diff node as being traversed. More...
 
bool do_log () const
 Test if logging was requested. More...
 
void do_log (bool)
 Request logging (or not) More...
 
void end_traversing ()
 Flag a given diff node as not being traversed anymore. More...
 
virtual void finish_diff_type ()
 Finish the insertion of a diff tree node into the diff graph. More...
 
void set_canonical_diff (diff *)
 Setter for the canonical diff of the current instance of diff. More...
 
- Protected Member Functions inherited from traversable_base
 traversable_base ()
 Default constructor of the traversable_base type. More...
 
bool visiting () const
 This should returns false before and after the node has been visiting. During the visiting of the node (and of its children) this should return true. More...
 
void visiting (bool f)
 The traversing code should be responsible of calling this, not the user code. More...
 

Friends

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. More...
 
class default_reporter
 

Additional Inherited Members

- Protected Types inherited from class_or_union_diff
typedef std::unique_ptr< privpriv_ptr
 
- Protected Attributes inherited from class_or_union_diff
priv_ptr priv_
 
- Protected Attributes inherited from diff
std::unique_ptr< priv > priv_
 

Detailed Description

This type abstracts changes for a class_decl.

Definition at line 1778 of file abg-comparison.h.

Constructor & Destructor Documentation

◆ class_diff()

class_diff ( class_decl_sptr  first_scope,
class_decl_sptr  second_scope,
diff_context_sptr  ctxt = diff_context_sptr() 
)
protected

Constructor of class_diff.

Parameters
first_scopethe first class of the diff.
second_scopethe second class of the diff.
ctxtthe diff context to use.

Definition at line 5919 of file abg-comparison.cc.

Member Function Documentation

◆ base_changes() [1/2]

edit_script & base_changes ( )
Returns
the edit script of the bases of the two classes.

Definition at line 6050 of file abg-comparison.cc.

◆ base_changes() [2/2]

const edit_script & base_changes ( ) const
Returns
the edit script of the bases of the two classes.

Definition at line 6012 of file abg-comparison.cc.

◆ chain_into_hierarchy()

void chain_into_hierarchy ( )
virtual

Populate the vector of children node of the diff base type sub-object of this instance of class_diff.

The children node can then later be retrieved using diff::children_node().

Reimplemented from class_or_union_diff.

Definition at line 5899 of file abg-comparison.cc.

◆ changed_bases()

const base_diff_sptrs_type & changed_bases ( )

Getter for the changed base classes of the diff.

Returns
a sorted vector containing the changed base classes

Definition at line 6035 of file abg-comparison.cc.

◆ deleted_bases()

const string_base_sptr_map & deleted_bases ( ) const

Getter for the deleted base classes of the diff.

Returns
a map containing the deleted base classes, keyed with their pretty representation.

Definition at line 6020 of file abg-comparison.cc.

◆ first_class_decl()

shared_ptr< class_decl > first_class_decl ( ) const
Returns
the first class invoveld in the diff.

Definition at line 6000 of file abg-comparison.cc.

◆ get_pretty_representation()

const string & get_pretty_representation ( ) const
virtual
Returns
the pretty representation of the current instance of class_diff.

Reimplemented from diff.

Definition at line 5964 of file abg-comparison.cc.

◆ has_changes()

bool has_changes ( ) const
virtual

Return true iff the current diff node carries a change.

Returns
true iff the current diff node carries a change.

Reimplemented from class_or_union_diff.

Definition at line 5983 of file abg-comparison.cc.

◆ has_local_changes()

enum change_kind has_local_changes ( ) const
virtual
Returns
the kind of local change carried by the current diff node. The value returned is zero if the current node carries no local change.

Reimplemented from class_or_union_diff.

Definition at line 5983 of file abg-comparison.cc.

◆ inserted_bases()

const string_base_sptr_map & inserted_bases ( ) const

Getter for the inserted base classes of the diff.

Returns
a map containing the inserted base classes, keyed with their pretty representation.

Definition at line 6028 of file abg-comparison.cc.

◆ moved_bases()

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. If this vector is not empty, it means the bases of the underlying class type got re-ordered.

Returns
the vector of bases that moved.

Definition at line 6045 of file abg-comparison.cc.

◆ report()

void report ( ostream &  out,
const string &  indent = "" 
) const
virtual

Produce a basic report about the changes between two class_decl.

Parameters
outthe output stream to report the changes to.
indentthe string to use as an indentation prefix in the report.

Reimplemented from class_or_union_diff.

Definition at line 6060 of file abg-comparison.cc.

◆ second_class_decl()

shared_ptr< class_decl > second_class_decl ( ) const

Getter of the second class involved in the diff.

Returns
the second class invoveld in the diff

Definition at line 6007 of file abg-comparison.cc.

Friends And Related Function Documentation

◆ compute_diff

class_diff_sptr compute_diff ( const class_decl_sptr  first,
const class_decl_sptr  second,
diff_context_sptr  ctxt 
)
friend

Compute the set of changes between two instances of class_decl.

Note that the two types must have been created in the same environment, otherwise, this function aborts.

Parameters
firstthe first class_decl to consider.
secondthe second class_decl to consider.
Returns
changes the resulting changes.
Parameters
ctxtthe diff context to use.

Definition at line 6078 of file abg-comparison.cc.


The documentation for this class was generated from the following files: