libabigail
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
diff Class Referenceabstract

The abstraction of a change between two ABI artifacts, a.k.a an artifact change. More...

#include <abg-comparison.h>

Inheritance diagram for diff:
[legend]

Public Member Functions

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...
 
virtual void chain_into_hierarchy ()
 This constructs the relation between this diff node and its detail diff nodes, in the generic view of the 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...
 
virtual const string & get_pretty_representation () const
 Get a pretty representation of the current diff node. More...
 
virtual bool has_changes () const =0
 Pure interface to get the length of the changes encapsulated by this diff. A length of zero means that the current instance of diff doesn't carry any change. 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...
 
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 change that is on the diff object itself, as opposed to a change that is carried by some of its children nodes. 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...
 
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. 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

 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...
 

Protected Attributes

std::unique_ptr< priv > priv_
 

Friends

class diff_context
 

Detailed Description

The abstraction of a change between two ABI artifacts, a.k.a an artifact change.

In the grand scheme of things, a diff is strongly typed; for instance, a change between two enums is represented by an enum_diff type. A change between two function_type is represented by a function_type_diff type and a change between two class_decl is represented by a class_diff type. All of these types derive from the diff parent class.

An artifact change D can have one (or more) details named D'. A detail is an artifact change that "belongs" to another one. Here, D' belongs to D. Or said otherwise, D' is a child change of D. Said otherwise, D and D' are related, and the relation is a "child relation".

For instance, if we consider a change carried by a class_diff, the detail change might be a change on one data member of the class. In other word, the class_diff change might have a child diff node that would be a var_diff node.

There are two ways to get the child var_diff node (for the data member change detail) of the class_diff.

The first way is through the typed API, that is, through the class_diff::sorted_changed_data_members() member function which returns var_diff nodes.

The second way is through the generic API, that is, through the diff::children_nodes() member function which returns generic diff nodes. This second way enables us to walk the diff nodes graph in a generic way, regardless of the types of the diff nodes.

Said otherwise, there are two views for a given diff node. There is typed view, and there is the generic view. In the typed view, the details are accessed through the typed API. In the generic view, the details are gathered through the generic view.

Please read more about the IR of the comparison engine to learn more about this.

This type encapsulates an edit script (a set of insertions and deletions) for two constructs that are to be diff'ed. The two constructs are called the "subjects" of the diff.

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

Constructor & Destructor Documentation

◆ diff() [1/2]

diff ( type_or_decl_base_sptr  first_subject,
type_or_decl_base_sptr  second_subject 
)
protected

Constructor for the diff type.

This constructs a diff between two subjects that are actually declarations; the first and the second one.

Parameters
first_subjectthe first decl (subject) of the diff.
second_subjectthe second decl (subject) of the diff.

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

◆ diff() [2/2]

diff ( type_or_decl_base_sptr  first_subject,
type_or_decl_base_sptr  second_subject,
diff_context_sptr  ctxt 
)
protected

Constructor for the diff type.

This constructs a diff between two subjects that are actually declarations; the first and the second one.

Parameters
first_subjectthe first decl (subject) of the diff.
second_subjectthe second decl (subject) of the diff.
ctxtthe context of the diff. Note that this context object must stay alive during the entire life time of the current instance of diff. Otherwise, memory corruption issues occur.

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

Member Function Documentation

◆ add_to_category()

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.

Parameters
ca bit-map representing the set of categories to add the current diff tree node to.
Returns
the resulting bit-map representing the categories this current diff tree node belongs to, including those inherited from its children nodes.

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

◆ add_to_local_and_inherited_categories()

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.

Parameters
ca bit-map representing the set of categories to add the current diff tree node to.

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

◆ add_to_local_category()

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.

Parameters
ca bit-map representing the set of categories to add the current diff tree node to.
Returns
the resulting bit-map representing the categories this current diff tree node belongs to.

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

◆ append_child_node()

void append_child_node ( diff_sptr  d)

Add a new child node to the vector of children nodes for the current diff node.

Parameters
dthe new child node to add to the children nodes.

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

◆ begin_traversing()

void begin_traversing ( )
protected

Flag a given diff node as being traversed.

For certain diff nodes like class_diff, it's important to avoid traversing the node again while it's already being traversed; otherwise this leads to infinite loops. So the diff::begin_traversing() and diff::end_traversing() methods flag a given node as being traversed (or not), so that diff::is_traversing() can tell if the node is being traversed.

Note that traversing a node means visiting it *and* visiting its children nodes.

The canonical node is marked as being traversed too.

These functions are called by the traversing code.

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

◆ chain_into_hierarchy()

void chain_into_hierarchy ( )
virtual

This constructs the relation between this diff node and its detail diff nodes, in the generic view of the diff node.

Default implementation of the hierachy chaining virtual function.

Each specific typed diff node should implement how the typed view "links" itself to its detail nodes in the generic sense.

There are several types of diff nodes that have logical children nodes; for instance, a typedef_diff has the diff of the underlying type as a child node. A var_diff has the diff of the types of the variables as a child node, etc.

But because the diff base has a generic representation for children nodes of the all the types of diff nodes (regardless of the specific most-derived type of diff node) that one can get using the method diff::children_nodes(), one need to populate that vector of children node.

Populating that vector of children node is done by this function; it must be overloaded by each most-derived type of diff node that extends the diff type.

Reimplemented in typedef_diff, function_decl_diff, function_type_diff, fn_parm_diff, scope_diff, base_diff, class_diff, class_or_union_diff, enum_diff, qualified_type_diff, array_diff, subrange_diff, ptr_to_mbr_diff, reference_diff, pointer_diff, var_diff, and distinct_diff.

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

◆ children_nodes()

const vector< diff * > & children_nodes ( ) const

Getter for the children nodes of the current diff node.

Returns
a vector of the children nodes.

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

◆ context() [1/2]

const diff_context_sptr context ( ) const

Getter of the context of the current diff.

Returns
the context of the current diff.

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

◆ context() [2/2]

void context ( diff_context_sptr  c)

Setter of the context of the current diff.

Parameters
cthe new context to set.

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

◆ currently_reporting() [1/2]

bool currently_reporting ( ) const

Tests if we are currently in the middle of emitting a report for this diff.

Returns
true if we are currently emitting a report for the current diff, false otherwise.

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

◆ currently_reporting() [2/2]

void currently_reporting ( bool  f) const

Sets a flag saying if we are currently in the middle of emitting a report for this diff.

Parameters
ftrue if we are currently emitting a report for the current diff, false otherwise.

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

◆ do_log() [1/2]

bool do_log ( ) const
protected

Test if logging was requested.

Returns
true iff logging was requested.

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

◆ do_log() [2/2]

void do_log ( bool  f)
protected

Request logging (or not)

Parameters
ftrue iff logging is to be requested.

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

◆ end_traversing()

void end_traversing ( )
protected

Flag a given diff node as not being traversed anymore.

Note that traversing a node means visiting it *and* visiting its children nodes.

Please read the comments of the function diff::begin_traversing() for mode context.

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

◆ finish_diff_type()

void finish_diff_type ( )
protectedvirtual

Finish the insertion of a diff tree node into the diff graph.

This function might be called several times. It must perform the insertion only once.

For instance, certain kinds of diff tree node have specific children nodes that are populated after the constructor of the diff tree node has been called. In that case, calling overloads of this method ensures that these children nodes are properly gathered and setup.

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

◆ first_subject()

type_or_decl_base_sptr first_subject ( ) const

Getter of the first subject of the diff.

Returns
the first subject of the diff.

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

◆ get_canonical_diff()

diff * get_canonical_diff ( ) const

Getter for the canonical diff of the current instance of diff.

Note that the canonical diff node for the current instanc eof diff node must have been set by invoking class_diff::initialize_canonical_diff() on the current instance of diff node.

Returns
the canonical diff node or null if none was set.

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

◆ get_category()

diff_category get_category ( ) const

Getter for the category of the current diff tree node.

This category represents the union of the local category and the categories inherited from the children diff nodes.

Returns
the category of the current diff tree node.

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

◆ get_class_of_equiv_category()

diff_category get_class_of_equiv_category ( ) const

Getter of the category of the class of equivalence of the current diff tree node.

That is, if the current diff tree node has a canonical node, return the category of that canonical node. Otherwise, return the category of the current node.

Returns
the category of the class of equivalence of the current tree node.

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

◆ get_local_category()

diff_category get_local_category ( ) const

Getter for the local category of the current diff tree node.

The local category represents the set of categories of a diff node, not taking in account the categories inherited from its children nodes.

Returns
the local category of the current diff tree node.

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

◆ get_pretty_representation()

const string & get_pretty_representation ( ) const
virtual

Get a pretty representation of the current diff node.

This is suitable for e.g. emitting debugging traces for the diff tree nodes.

Returns
the pretty representation of the diff node.

Reimplemented in typedef_diff, type_decl_diff, function_decl_diff, function_type_diff, fn_parm_diff, scope_diff, base_diff, union_diff, class_diff, enum_diff, qualified_type_diff, array_diff, subrange_diff, ptr_to_mbr_diff, reference_diff, pointer_diff, var_diff, and distinct_diff.

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

◆ has_changes()

virtual bool has_changes ( ) const
pure virtual

Pure interface to get the length of the changes encapsulated by this diff. A length of zero means that the current instance of diff doesn't carry any change.

This is to be implemented by all descendants of this type.

Implemented in translation_unit_diff, typedef_diff, type_decl_diff, function_decl_diff, function_type_diff, fn_parm_diff, scope_diff, base_diff, class_diff, class_or_union_diff, enum_diff, qualified_type_diff, array_diff, subrange_diff, ptr_to_mbr_diff, reference_diff, pointer_diff, var_diff, and distinct_diff.

◆ has_descendant_allowed_by_specific_negated_suppression()

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.

Returns
true iff the current diff node has a descendant node which is specifically allowed by a negated suppression specification.

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

◆ has_local_changes()

virtual enum change_kind has_local_changes ( ) const
pure virtual

Pure interface to know if the current instance of @diff carries a local change. A local change is a change that is on the diff object itself, as opposed to a change that is carried by some of its children nodes.

This is to be implemented by all descendants of this type.

Implemented in decl_diff_base, type_diff_base, translation_unit_diff, typedef_diff, type_decl_diff, function_decl_diff, function_type_diff, fn_parm_diff, scope_diff, base_diff, class_diff, class_or_union_diff, enum_diff, qualified_type_diff, array_diff, subrange_diff, ptr_to_mbr_diff, reference_diff, pointer_diff, var_diff, and distinct_diff.

◆ has_local_changes_to_be_reported()

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.

Returns
true iff the current node should be reported.

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

◆ has_parent_allowed_by_specific_negated_suppression()

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.

Returns
true iff the current diff node has a parent node which is specifically allowed by a negated suppression specification.

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

◆ is_allowed_by_specific_negated_suppression()

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.

Returns
true if this diff node is meant to be allowed by at least one negated suppression specification.

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

◆ is_filtered_out()

bool is_filtered_out ( ) const

Test if this diff tree node is to be filtered out for reporting purposes.

There is a difference between a diff node being filtered out and being suppressed. Being suppressed means that there is a suppression specification that suppresses the diff node specifically. Being filtered out mean the node is either suppressed, or it's filtered out because the suppression of a set of (children) nodes caused this node to be filtered out as well. For instance, if a function diff has all its children diff nodes suppressed and if the function diff node carries no local change, then the function diff node itself is going to be filtered out.

The function tests if the categories of the diff tree node are "forbidden" by the context or not.

Returns
true iff the current diff node should NOT be reported.

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

◆ is_filtered_out_without_looking_at_allowed_changes()

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.

The function tests if the categories of the diff tree node are "forbidden" by the context or not.

Returns
true iff the current diff node should should NOT be reported, with respect to the categories that might filter it out only.

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

◆ is_filtered_out_wrt_non_inherited_categories()

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.

The function tests if the local categories of the diff tree node are "forbidden" by the context or not.

Returns
true iff the current diff node should NOT be reported, with respect to its local categories.

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

◆ is_suppressed() [1/2]

bool is_suppressed ( ) const

Test if the current diff node has been suppressed by a user-provided suppression specification.

Returns
true if the current diff node has been suppressed by a user-provided suppression list.

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

◆ is_suppressed() [2/2]

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.

Note that private type suppressions are auto-generated from the path to where public headers are, as given by the user.

Here is the current algorithm:

First, suppress this diff node if it's not matched by any negated suppression specifications. If it's not suppressed, then suppress it if it's matched by direct suppression specifications.

Parameters
is_private_typeout parameter if the current diff node was suppressed because it's a private type then this parameter is set to true.
Returns
true if the current diff node has been suppressed by a user-provided suppression list.

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

◆ is_traversing()

bool is_traversing ( ) const

Tell if a given node is being traversed or not.

Note that traversing a node means visiting it *and* visiting its children nodes.

It's the canonical node which is looked at, actually.

Please read the comments for the diff::begin_traversing() for mode context.

Returns
true if the current instance of @diff is being traversed.

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

◆ parent_node()

const diff * parent_node ( ) const

Getter for the parent node of the current diff node.

Returns
the parent node of the current diff node.

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

◆ remove_from_category()

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.

Parameters
ca bit-map representing the set of categories to add the current diff tree node to.
Returns
the resulting bit-map representing the categories this current diff tree onde belongs to, including the categories inherited from the children nodes of the current diff node.

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

◆ remove_from_local_category()

diff_category remove_from_local_category ( diff_category  c)

Remove the current diff tree node from the categories resulting from the local changes.

Parameters
ca bit-map representing the set of categories to add the current diff tree node to.
Returns
the resulting bit-map representing the categories this current diff tree onde belongs to.

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

◆ report()

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

Pure interface to report the diff in a serialized form that is legible for the user.

Note that the serializd report has to leave one empty line at the end of its content.

Parameters
outthe output stream to serialize the report to.
indentthe indentation string to use.

Implemented in translation_unit_diff, type_decl_diff, scope_diff, var_diff, distinct_diff, typedef_diff, function_decl_diff, function_type_diff, fn_parm_diff, base_diff, union_diff, class_diff, class_or_union_diff, enum_diff, qualified_type_diff, array_diff, subrange_diff, ptr_to_mbr_diff, reference_diff, and pointer_diff.

◆ reported_once() [1/2]

bool reported_once ( ) const

Tests if a report has already been emitted for the current diff.

Returns
true if a report has already been emitted for the current diff, false otherwise.

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

◆ reported_once() [2/2]

void reported_once ( bool  f) const

Sets a flag saying if a report has already been emitted for the current diff.

Parameters
ftrue if a report has already been emitted for the current diff, false otherwise.

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

◆ second_subject()

type_or_decl_base_sptr second_subject ( ) const

Getter of the second subject of the diff.

Returns
the second subject of the diff.

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

◆ set_canonical_diff()

void set_canonical_diff ( diff d)
protected

Setter for the canonical diff of the current instance of diff.

Parameters
dthe new canonical node to set.

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

◆ set_category()

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.

Parameters
cthe new category for the current diff node.

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

◆ set_local_category()

void set_local_category ( diff_category  c)

Set the local category of the current diff node.

Parameters
cthe new category for the current diff node.

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

◆ to_be_reported()

bool to_be_reported ( ) const

Test if this diff tree node should be reported.

Returns
true iff the current node should be reported.

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

◆ traverse()

bool traverse ( diff_node_visitor v)
virtual

The generic traversing code that walks a given diff sub-tree.

Note that there is a difference between traversing a diff node and visiting it. Basically, traversing a diff node means visiting it and visiting its children nodes too. So one can visit a node without traversing it. But traversing a node without visiting it is not possible.

Note that the insertion of the "generic view" of the diff node into the graph being traversed is done "on the fly". The insertion of the "typed view" of the diff node into the graph is done implicitely. To learn more about the generic and typed view of the diff node, please read the introductory comments of the diff class.

Note that by default this traversing code visits a given class of equivalence of a diff node only once. This behaviour can been changed by calling diff_context::visiting_a_node_twice_is_forbidden(), but this is very risky as it might create endless loops while visiting a diff tree graph that has changes that refer to themselves; that is, diff tree graphs with cycles.

When a diff node is encountered, the diff_node_visitor::visit_begin() method is invoked on the diff node first.

If the diff node has already been visited, then node_visitor::visit_end() is called on it and the node traversing is done; the children of the diff node are not visited in this case.

If the diff node has *NOT* been visited yet, then the diff_node_visitor::visit() method is invoked with it's 'pre' argument set to true. Then if the diff_node_visitor::visit() returns true, then the children nodes of the diff node are visited. Otherwise, no children nodes of the diff node is visited and the diff_node_visitor::visit_end() is called. After the children nodes are visited (and only if they are visited) the diff_node_visitor::visit() method is invoked with it's 'pre' argument set to false. And then the diff_node_visitor::visit_end() is called.

Parameters
vthe entity that visits each node of the diff sub-tree.
Returns
true to tell the caller that all of the sub-tree could be walked. This instructs the caller to keep walking the rest of the tree. Return false otherwise.

Reimplemented from diff_traversable_base.

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


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