libabigail
Public Member Functions | List of all members
ir_node_visitor Class Reference

The base class for the visitor type hierarchy used for traversing a translation unit. More...

#include <abg-ir.h>

Inheritance diagram for ir_node_visitor:
[legend]

Public Member Functions

 ir_node_visitor ()
 Default Constructor of the ir_node_visitor type. More...
 
bool allow_visiting_already_visited_type_node () const
 Get if the walker using this visitor is allowed to re-visit a type node that was previously visited or not. More...
 
void allow_visiting_already_visited_type_node (bool)
 Set if the walker using this visitor is allowed to re-visit a type node that was previously visited or not. More...
 
void forget_visited_type_nodes ()
 Un-mark all visited type nodes. More...
 
void mark_type_node_as_visited (type_base *)
 Mark a given type node as having been visited. More...
 
bool type_node_has_been_visited (type_base *) const
 Test if a given type node has been marked as visited. More...
 
virtual bool visit_begin (array_type_def *)
 
virtual bool visit_begin (array_type_def::subrange_type *)
 
virtual bool visit_begin (class_decl *)
 
virtual bool visit_begin (class_decl::base_spec *)
 
virtual bool visit_begin (class_or_union *)
 
virtual bool visit_begin (class_tdecl *)
 
virtual bool visit_begin (decl_base *)
 
virtual bool visit_begin (enum_type_decl *)
 
virtual bool visit_begin (function_decl *)
 
virtual bool visit_begin (function_decl::parameter *)
 
virtual bool visit_begin (function_tdecl *)
 
virtual bool visit_begin (function_type *)
 
virtual bool visit_begin (member_class_template *)
 
virtual bool visit_begin (member_function_template *)
 
virtual bool visit_begin (namespace_decl *)
 
virtual bool visit_begin (pointer_type_def *)
 
virtual bool visit_begin (ptr_to_mbr_type *)
 
virtual bool visit_begin (qualified_type_def *)
 
virtual bool visit_begin (reference_type_def *)
 
virtual bool visit_begin (scope_decl *)
 
virtual bool visit_begin (scope_type_decl *)
 
virtual bool visit_begin (type_base *)
 
virtual bool visit_begin (type_decl *)
 
virtual bool visit_begin (typedef_decl *)
 
virtual bool visit_begin (union_decl *)
 
virtual bool visit_begin (var_decl *)
 
virtual bool visit_end (array_type_def *)
 
virtual bool visit_end (array_type_def::subrange_type *)
 
virtual bool visit_end (class_decl *)
 
virtual bool visit_end (class_decl::base_spec *)
 
virtual bool visit_end (class_or_union *)
 
virtual bool visit_end (class_tdecl *)
 
virtual bool visit_end (decl_base *)
 
virtual bool visit_end (enum_type_decl *)
 
virtual bool visit_end (function_decl *)
 
virtual bool visit_end (function_decl::parameter *)
 
virtual bool visit_end (function_tdecl *)
 
virtual bool visit_end (function_type *)
 
virtual bool visit_end (member_class_template *)
 
virtual bool visit_end (member_function_template *)
 
virtual bool visit_end (namespace_decl *)
 
virtual bool visit_end (pointer_type_def *)
 
virtual bool visit_end (ptr_to_mbr_type *)
 
virtual bool visit_end (qualified_type_def *)
 
virtual bool visit_end (reference_type_def *)
 
virtual bool visit_end (scope_decl *)
 
virtual bool visit_end (scope_type_decl *)
 
virtual bool visit_end (type_base *)
 
virtual bool visit_end (type_decl *)
 
virtual bool visit_end (typedef_decl *)
 
virtual bool visit_end (union_decl *)
 
virtual bool visit_end (var_decl *)
 

Detailed Description

The base class for the visitor type hierarchy used for traversing a translation unit.

Client code willing to get notified for a certain kind of node during the IR traversal might want to define a visitor class that inherit ir_node_visitor, overload the ir_node_visitor::visit_begin() or ir_node_visitor::visit_end() method of its choice, and provide and implementation for it. If either ir_node_visitor::visit_begin() or ir_node_visitor::visit_end() return false, it means the traversal has to stop immediately after the methods' return. If the methods return true, it means the traversal keeps going.

That new visitor class would then be passed to e.g, translation_unit::traverse or to the traverse method of any type where the traversal is supposed to start from.

Definition at line 4808 of file abg-ir.h.

Constructor & Destructor Documentation

◆ ir_node_visitor()

Default Constructor of the ir_node_visitor type.

Definition at line 30030 of file abg-ir.cc.

Member Function Documentation

◆ allow_visiting_already_visited_type_node() [1/2]

bool allow_visiting_already_visited_type_node ( ) const

Get if the walker using this visitor is allowed to re-visit a type node that was previously visited or not.

Returns
true iff the walker using this visitor is allowed to re-visit a type node that was previously visited.

Definition at line 30051 of file abg-ir.cc.

◆ allow_visiting_already_visited_type_node() [2/2]

void allow_visiting_already_visited_type_node ( bool  f)

Set if the walker using this visitor is allowed to re-visit a type node that was previously visited or not.

Parameters
fif true, then the walker using this visitor is allowed to re-visit a type node that was previously visited.

Definition at line 30042 of file abg-ir.cc.

◆ forget_visited_type_nodes()

void forget_visited_type_nodes ( )

Un-mark all visited type nodes.

That is, no type node is going to be considered as having been visited anymore.

In other words, after invoking this funciton, ir_node_visitor::type_node_has_been_visited() is going to return false on all type nodes.

Definition at line 30090 of file abg-ir.cc.

◆ mark_type_node_as_visited()

void mark_type_node_as_visited ( type_base p)

Mark a given type node as having been visited.

Note that for this function to work, the type node must have been canonicalized. Otherwise the process is aborted.

Parameters
pthe type to mark as having been visited.

Definition at line 30061 of file abg-ir.cc.

◆ type_node_has_been_visited()

bool type_node_has_been_visited ( type_base p) const

Test if a given type node has been marked as visited.

Parameters
pthe type node to consider.
Returns
true iff the type node p has been marked as visited by the function ir_node_visitor::mark_type_node_as_visited.

Definition at line 30100 of file abg-ir.cc.

◆ visit_begin() [1/26]

bool visit_begin ( array_type_def t)
virtual

Definition at line 30205 of file abg-ir.cc.

◆ visit_begin() [2/26]

bool visit_begin ( array_type_def::subrange_type t)
virtual

Definition at line 30213 of file abg-ir.cc.

◆ visit_begin() [3/26]

bool visit_begin ( class_decl t)
virtual

Definition at line 30293 of file abg-ir.cc.

◆ visit_begin() [4/26]

bool visit_begin ( class_decl::base_spec d)
virtual

Definition at line 30309 of file abg-ir.cc.

◆ visit_begin() [5/26]

bool visit_begin ( class_or_union t)
virtual

Definition at line 30285 of file abg-ir.cc.

◆ visit_begin() [6/26]

bool visit_begin ( class_tdecl d)
virtual

Definition at line 30277 of file abg-ir.cc.

◆ visit_begin() [7/26]

bool visit_begin ( decl_base )
virtual

Definition at line 30125 of file abg-ir.cc.

◆ visit_begin() [8/26]

bool visit_begin ( enum_type_decl t)
virtual

Definition at line 30221 of file abg-ir.cc.

◆ visit_begin() [9/26]

bool visit_begin ( function_decl d)
virtual

Definition at line 30253 of file abg-ir.cc.

◆ visit_begin() [10/26]

bool visit_begin ( function_decl::parameter d)
virtual

Definition at line 30261 of file abg-ir.cc.

◆ visit_begin() [11/26]

bool visit_begin ( function_tdecl d)
virtual

Definition at line 30269 of file abg-ir.cc.

◆ visit_begin() [12/26]

bool visit_begin ( function_type t)
virtual

Definition at line 30237 of file abg-ir.cc.

◆ visit_begin() [13/26]

bool visit_begin ( member_class_template d)
virtual

Definition at line 30325 of file abg-ir.cc.

◆ visit_begin() [14/26]

bool visit_begin ( member_function_template d)
virtual

Definition at line 30317 of file abg-ir.cc.

◆ visit_begin() [15/26]

bool visit_begin ( namespace_decl d)
virtual

Definition at line 30165 of file abg-ir.cc.

◆ visit_begin() [16/26]

bool visit_begin ( pointer_type_def t)
virtual

Definition at line 30181 of file abg-ir.cc.

◆ visit_begin() [17/26]

bool visit_begin ( ptr_to_mbr_type t)
virtual

Definition at line 30197 of file abg-ir.cc.

◆ visit_begin() [18/26]

bool visit_begin ( qualified_type_def t)
virtual

Definition at line 30173 of file abg-ir.cc.

◆ visit_begin() [19/26]

bool visit_begin ( reference_type_def t)
virtual

Definition at line 30189 of file abg-ir.cc.

◆ visit_begin() [20/26]

bool visit_begin ( scope_decl )
virtual

Definition at line 30133 of file abg-ir.cc.

◆ visit_begin() [21/26]

bool visit_begin ( scope_type_decl t)
virtual

Definition at line 30149 of file abg-ir.cc.

◆ visit_begin() [22/26]

bool visit_begin ( type_base )
virtual

Definition at line 30141 of file abg-ir.cc.

◆ visit_begin() [23/26]

bool visit_begin ( type_decl t)
virtual

Definition at line 30157 of file abg-ir.cc.

◆ visit_begin() [24/26]

bool visit_begin ( typedef_decl t)
virtual

Definition at line 30229 of file abg-ir.cc.

◆ visit_begin() [25/26]

bool visit_begin ( union_decl t)
virtual

Definition at line 30301 of file abg-ir.cc.

◆ visit_begin() [26/26]

bool visit_begin ( var_decl d)
virtual

Definition at line 30245 of file abg-ir.cc.

◆ visit_end() [1/26]

bool visit_end ( array_type_def t)
virtual

Definition at line 30209 of file abg-ir.cc.

◆ visit_end() [2/26]

bool visit_end ( array_type_def::subrange_type t)
virtual

Definition at line 30217 of file abg-ir.cc.

◆ visit_end() [3/26]

bool visit_end ( class_decl t)
virtual

Definition at line 30297 of file abg-ir.cc.

◆ visit_end() [4/26]

bool visit_end ( class_decl::base_spec d)
virtual

Definition at line 30313 of file abg-ir.cc.

◆ visit_end() [5/26]

bool visit_end ( class_or_union t)
virtual

Definition at line 30289 of file abg-ir.cc.

◆ visit_end() [6/26]

bool visit_end ( class_tdecl d)
virtual

Definition at line 30281 of file abg-ir.cc.

◆ visit_end() [7/26]

bool visit_end ( decl_base )
virtual

Definition at line 30129 of file abg-ir.cc.

◆ visit_end() [8/26]

bool visit_end ( enum_type_decl t)
virtual

Definition at line 30225 of file abg-ir.cc.

◆ visit_end() [9/26]

bool visit_end ( function_decl d)
virtual

Definition at line 30257 of file abg-ir.cc.

◆ visit_end() [10/26]

bool visit_end ( function_decl::parameter d)
virtual

Definition at line 30265 of file abg-ir.cc.

◆ visit_end() [11/26]

bool visit_end ( function_tdecl d)
virtual

Definition at line 30273 of file abg-ir.cc.

◆ visit_end() [12/26]

bool visit_end ( function_type t)
virtual

Definition at line 30241 of file abg-ir.cc.

◆ visit_end() [13/26]

bool visit_end ( member_class_template d)
virtual

Definition at line 30329 of file abg-ir.cc.

◆ visit_end() [14/26]

bool visit_end ( member_function_template d)
virtual

Definition at line 30321 of file abg-ir.cc.

◆ visit_end() [15/26]

bool visit_end ( namespace_decl d)
virtual

Definition at line 30169 of file abg-ir.cc.

◆ visit_end() [16/26]

bool visit_end ( pointer_type_def t)
virtual

Definition at line 30185 of file abg-ir.cc.

◆ visit_end() [17/26]

bool visit_end ( ptr_to_mbr_type t)
virtual

Definition at line 30201 of file abg-ir.cc.

◆ visit_end() [18/26]

bool visit_end ( qualified_type_def t)
virtual

Definition at line 30177 of file abg-ir.cc.

◆ visit_end() [19/26]

bool visit_end ( reference_type_def t)
virtual

Definition at line 30193 of file abg-ir.cc.

◆ visit_end() [20/26]

bool visit_end ( scope_decl )
virtual

Definition at line 30137 of file abg-ir.cc.

◆ visit_end() [21/26]

bool visit_end ( scope_type_decl t)
virtual

Definition at line 30153 of file abg-ir.cc.

◆ visit_end() [22/26]

bool visit_end ( type_base )
virtual

Definition at line 30145 of file abg-ir.cc.

◆ visit_end() [23/26]

bool visit_end ( type_decl t)
virtual

Definition at line 30161 of file abg-ir.cc.

◆ visit_end() [24/26]

bool visit_end ( typedef_decl t)
virtual

Definition at line 30233 of file abg-ir.cc.

◆ visit_end() [25/26]

bool visit_end ( union_decl t)
virtual

Definition at line 30305 of file abg-ir.cc.

◆ visit_end() [26/26]

bool visit_end ( var_decl d)
virtual

Definition at line 30249 of file abg-ir.cc.


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