PandA-2024.02
Data Structures | Macros
visitor.hpp File Reference

Visitor/walker design pattern. More...

#include "refcount.hpp"
#include <algorithm>
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <deque>
Include dependency graph for visitor.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  object_visitor
 object visitor template. More...
 
class  for_each_functor< T, visitor_obj >
 functor used to traverse sequences with std::for_each More...
 

Macros

#define GETID(field)   field##_ID
 return the id given a super class or a class member More...
 
#define VISIT_SC(mask, superclass, method)
 macro used to visit the super class More...
 
#define VISIT_MEMBER_NAMED(ref_obj_name, mask, ref_obj, method)
 macro used to visit a non null member More...
 
#define VISIT_MEMBER(mask, ref_obj, method)   VISIT_MEMBER_NAMED(ref_obj, mask, ref_obj, method)
 
#define SEQ_VISIT_MEMBER(mask, seq, seqbasetype, method, visitor_type, visitor_obj)
 macro used to traverse non empty sequences More...
 
#define NO_VISIT   ~0U
 constant used to avoid member visit More...
 
#define ALL_VISIT   0U
 constant used to allow member visit More...
 
#define SET_NO_VISIT_INDEX(mask, index)   ((mask) |= (1U << GETID(index)))
 macro used to selectively avoid member visit More...
 
#define SET_VISIT_INDEX(mask, index)   ((mask) &= ~(1U << GETID(index)))
 macro used to selectively allow member visit More...
 
#define OPERATOR_MACRO_HEADER(r, data, elem)   virtual void operator()(const elem*, unsigned int&)
 
#define OPERATOR_MACRO_DECL(r, data, elem)   OPERATOR_MACRO_HEADER(r, data, elem);
 
#define OPERATOR_MACRO(r, data, elem)
 
#define OPERATOR_MACRO_HEADERO(r, data, elem)   void operator()(const elem*, unsigned int&) override
 
#define OPERATOR_MACRO_DECLO(r, data, elem)   OPERATOR_MACRO_HEADERO(r, data, elem);
 
#define OPERATOR_MACROO(r, data, elem)
 
#define FORWARD_DECLARATION_MACRO(r, data, elem)   class elem;
 forward declaration macro More...
 

Detailed Description

Visitor/walker design pattern.

Author
Fabrizio Ferrandi fabri.nosp@m.zio..nosp@m.ferra.nosp@m.ndi@.nosp@m.polim.nosp@m.i.it $Revision$ $Date$ Last modified by $Author$

Definition in file visitor.hpp.

Macro Definition Documentation

◆ ALL_VISIT

#define ALL_VISIT   0U

constant used to allow member visit

Definition at line 71 of file visitor.hpp.

Referenced by typename_type(), null_node::visit(), tree_reindex::visit(), gimple_pragma::visit(), profiling_pragma::visit(), statistical_profiling::visit(), map_pragma::visit(), call_hw_pragma::visit(), bloc::visit(), call_point_hw_pragma::visit(), issue_pragma::visit(), blackbox_pragma::visit(), omp_pragma::visit(), omp_parallel_pragma::visit(), omp_sections_pragma::visit(), omp_parallel_sections_pragma::visit(), omp_section_pragma::visit(), omp_target_pragma::visit(), omp_task_pragma::visit(), omp_critical_pragma::visit(), omp_atomic_pragma::visit(), omp_for_pragma::visit(), omp_simd_pragma::visit(), omp_declare_simd_pragma::visit(), gimple_while::visit(), gimple_for::visit(), WeightedNode::visit(), gimple_multi_way_if::visit(), attr::visit(), srcp::visit(), decl_node::visit(), expr_node::visit(), PointToSolution::visit(), gimple_node::visit(), unary_expr::visit(), binary_expr::visit(), ternary_expr::visit(), quaternary_expr::visit(), type_node::visit(), memory_tag::visit(), cst_node::visit(), error_mark::visit(), array_type::visit(), gimple_asm::visit(), baselink::visit(), gimple_bind::visit(), binfo::visit(), block::visit(), call_expr::visit(), aggr_init_expr::visit(), gimple_call::visit(), case_label_expr::visit(), cast_expr::visit(), type_pack_expansion::visit(), expr_pack_expansion::visit(), complex_cst::visit(), complex_type::visit(), gimple_cond::visit(), const_decl::visit(), constructor::visit(), enumeral_type::visit(), expr_stmt::visit(), field_decl::visit(), function_decl::visit(), function_type::visit(), gimple_assign::visit(), gimple_nop::visit(), gimple_goto::visit(), handler::visit(), identifier_node::visit(), integer_cst::visit(), integer_type::visit(), gimple_label::visit(), method_type::visit(), namespace_decl::visit(), overload::visit(), parm_decl::visit(), gimple_phi::visit(), gimple_predict::visit(), pointer_type::visit(), real_cst::visit(), real_type::visit(), record_type::visit(), reference_type::visit(), result_decl::visit(), gimple_resx::visit(), gimple_return::visit(), return_stmt::visit(), scope_ref::visit(), ssa_name::visit(), statement_list::visit(), string_cst::visit(), gimple_switch::visit(), target_expr::visit(), target_mem_ref::visit(), target_mem_ref461::visit(), template_decl::visit(), template_parm_index::visit(), type_argument_pack::visit(), nontype_argument_pack::visit(), tree_list::visit(), tree_vec::visit(), try_block::visit(), type_decl::visit(), union_type::visit(), var_decl::visit(), vector_cst::visit(), vector_type::visit(), and lut_expr::visit().

◆ FORWARD_DECLARATION_MACRO

#define FORWARD_DECLARATION_MACRO (   r,
  data,
  elem 
)    class elem;

forward declaration macro

Definition at line 98 of file visitor.hpp.

◆ GETID

#define GETID (   field)    field##_ID

return the id given a super class or a class member

Definition at line 53 of file visitor.hpp.

◆ NO_VISIT

#define NO_VISIT   ~0U

constant used to avoid member visit

Definition at line 69 of file visitor.hpp.

Referenced by GimpleWriter::GimpleWriter(), type_casting::operator()(), and raw_writer::write_when_not_null_point_to().

◆ OPERATOR_MACRO

#define OPERATOR_MACRO (   r,
  data,
  elem 
)

◆ OPERATOR_MACRO_DECL

#define OPERATOR_MACRO_DECL (   r,
  data,
  elem 
)    OPERATOR_MACRO_HEADER(r, data, elem);

◆ OPERATOR_MACRO_DECLO

#define OPERATOR_MACRO_DECLO (   r,
  data,
  elem 
)    OPERATOR_MACRO_HEADERO(r, data, elem);

Definition at line 91 of file visitor.hpp.

Referenced by type_casting::type_casting().

◆ OPERATOR_MACRO_HEADER

#define OPERATOR_MACRO_HEADER (   r,
  data,
  elem 
)    virtual void operator()(const elem*, unsigned int&)

Definition at line 84 of file visitor.hpp.

◆ OPERATOR_MACRO_HEADERO

#define OPERATOR_MACRO_HEADERO (   r,
  data,
  elem 
)    void operator()(const elem*, unsigned int&) override

Definition at line 90 of file visitor.hpp.

◆ OPERATOR_MACROO

#define OPERATOR_MACROO (   r,
  data,
  elem 
)
Value:
OPERATOR_MACRO_HEADERO(r, data, elem) \
{ \
}
#define OPERATOR_MACRO_HEADERO(r, data, elem)
Definition: visitor.hpp:90

Definition at line 92 of file visitor.hpp.

Referenced by type_casting::type_casting().

◆ SEQ_VISIT_MEMBER

#define SEQ_VISIT_MEMBER (   mask,
  seq,
  seqbasetype,
  method,
  visitor_type,
  visitor_obj 
)
Value:
if(((1 << GETID(seq)) & (mask)) == 0 && !(seq).empty()) \
std::for_each((seq).begin(), (seq).end(), \
for_each_functor<seqbasetype, visitor_type>(&seqbasetype::method, visitor_obj))
base seq[MAX_SIZE]
#define GETID(field)
return the id given a super class or a class member
Definition: visitor.hpp:53
functor used to traverse sequences with std::for_each
Definition: visitor.hpp:133

macro used to traverse non empty sequences

Definition at line 64 of file visitor.hpp.

Referenced by bloc::visit(), PointToSolution::visit(), gimple_node::visit(), memory_tag::visit(), gimple_bind::visit(), call_expr::visit(), gimple_call::visit(), function_decl::visit(), record_type::visit(), ssa_name::visit(), statement_list::visit(), tree_vec::visit(), union_type::visit(), and vector_cst::visit().

◆ SET_NO_VISIT_INDEX

#define SET_NO_VISIT_INDEX (   mask,
  index 
)    ((mask) |= (1U << GETID(index)))

macro used to selectively avoid member visit

Definition at line 73 of file visitor.hpp.

◆ SET_VISIT_INDEX

#define SET_VISIT_INDEX (   mask,
  index 
)    ((mask) &= ~(1U << GETID(index)))

macro used to selectively allow member visit

Definition at line 75 of file visitor.hpp.

◆ VISIT_MEMBER

#define VISIT_MEMBER (   mask,
  ref_obj,
  method 
)    VISIT_MEMBER_NAMED(ref_obj, mask, ref_obj, method)

Definition at line 62 of file visitor.hpp.

Referenced by tree_reindex::visit(), gimple_pragma::visit(), omp_parallel_sections_pragma::visit(), gimple_while::visit(), gimple_for::visit(), decl_node::visit(), expr_node::visit(), gimple_node::visit(), unary_expr::visit(), binary_expr::visit(), ternary_expr::visit(), quaternary_expr::visit(), type_node::visit(), cst_node::visit(), array_type::visit(), gimple_asm::visit(), baselink::visit(), gimple_bind::visit(), binfo::visit(), call_expr::visit(), aggr_init_expr::visit(), gimple_call::visit(), case_label_expr::visit(), cast_expr::visit(), type_pack_expansion::visit(), expr_pack_expansion::visit(), complex_cst::visit(), gimple_cond::visit(), const_decl::visit(), constructor::visit(), enumeral_type::visit(), expr_stmt::visit(), field_decl::visit(), function_decl::visit(), function_type::visit(), gimple_assign::visit(), gimple_goto::visit(), handler::visit(), integer_type::visit(), gimple_label::visit(), method_type::visit(), namespace_decl::visit(), overload::visit(), parm_decl::visit(), gimple_phi::visit(), pointer_type::visit(), record_type::visit(), reference_type::visit(), result_decl::visit(), gimple_return::visit(), return_stmt::visit(), scope_ref::visit(), ssa_name::visit(), gimple_switch::visit(), target_expr::visit(), target_mem_ref::visit(), target_mem_ref461::visit(), template_decl::visit(), template_parm_index::visit(), type_argument_pack::visit(), nontype_argument_pack::visit(), tree_list::visit(), try_block::visit(), type_decl::visit(), union_type::visit(), var_decl::visit(), vector_type::visit(), and lut_expr::visit().

◆ VISIT_MEMBER_NAMED

#define VISIT_MEMBER_NAMED (   ref_obj_name,
  mask,
  ref_obj,
  method 
)
Value:
if(((1 << GETID(ref_obj_name)) & (mask)) == 0 && (ref_obj)) \
(ref_obj)->method
#define GETID(field)
return the id given a super class or a class member
Definition: visitor.hpp:53

macro used to visit a non null member

Definition at line 59 of file visitor.hpp.

Referenced by gimple_multi_way_if::visit(), binfo::visit(), constructor::visit(), gimple_phi::visit(), and statement_list::visit().

◆ VISIT_SC

#define VISIT_SC (   mask,
  superclass,
  method 
)
Value:
if(((1 << GETID(superclass)) & (mask)) == 0) \
this->superclass::method
#define GETID(field)
return the id given a super class or a class member
Definition: visitor.hpp:53

macro used to visit the super class

Definition at line 55 of file visitor.hpp.

Referenced by null_node::visit(), gimple_pragma::visit(), profiling_pragma::visit(), statistical_profiling::visit(), map_pragma::visit(), call_hw_pragma::visit(), call_point_hw_pragma::visit(), issue_pragma::visit(), blackbox_pragma::visit(), omp_pragma::visit(), omp_parallel_pragma::visit(), omp_sections_pragma::visit(), omp_parallel_sections_pragma::visit(), omp_section_pragma::visit(), omp_target_pragma::visit(), omp_task_pragma::visit(), omp_critical_pragma::visit(), omp_atomic_pragma::visit(), omp_for_pragma::visit(), omp_simd_pragma::visit(), omp_declare_simd_pragma::visit(), gimple_while::visit(), gimple_for::visit(), gimple_multi_way_if::visit(), decl_node::visit(), expr_node::visit(), gimple_node::visit(), unary_expr::visit(), binary_expr::visit(), ternary_expr::visit(), quaternary_expr::visit(), type_node::visit(), memory_tag::visit(), cst_node::visit(), error_mark::visit(), array_type::visit(), gimple_asm::visit(), baselink::visit(), gimple_bind::visit(), binfo::visit(), block::visit(), call_expr::visit(), aggr_init_expr::visit(), gimple_call::visit(), case_label_expr::visit(), cast_expr::visit(), type_pack_expansion::visit(), expr_pack_expansion::visit(), complex_cst::visit(), complex_type::visit(), gimple_cond::visit(), const_decl::visit(), enumeral_type::visit(), expr_stmt::visit(), field_decl::visit(), function_decl::visit(), function_type::visit(), gimple_assign::visit(), gimple_nop::visit(), gimple_goto::visit(), handler::visit(), identifier_node::visit(), integer_cst::visit(), integer_type::visit(), gimple_label::visit(), method_type::visit(), namespace_decl::visit(), overload::visit(), parm_decl::visit(), gimple_phi::visit(), gimple_predict::visit(), pointer_type::visit(), real_cst::visit(), real_type::visit(), record_type::visit(), reference_type::visit(), result_decl::visit(), gimple_resx::visit(), gimple_return::visit(), return_stmt::visit(), scope_ref::visit(), ssa_name::visit(), statement_list::visit(), string_cst::visit(), gimple_switch::visit(), target_expr::visit(), target_mem_ref::visit(), target_mem_ref461::visit(), template_decl::visit(), template_parm_index::visit(), type_argument_pack::visit(), nontype_argument_pack::visit(), tree_vec::visit(), try_block::visit(), type_decl::visit(), union_type::visit(), var_decl::visit(), vector_cst::visit(), vector_type::visit(), and lut_expr::visit().


Generated on Mon Feb 12 2024 13:03:36 for PandA-2024.02 by doxygen 1.8.13