PandA-2024.02
tree_common.hpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2004-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
45 #ifndef TREE_COMMON_HPP
46 #define TREE_COMMON_HPP
47 
49 #include <string>
50 
52 #include "refcount.hpp"
53 #include <boost/preprocessor/cat.hpp>
54 #include <boost/preprocessor/seq/for_each.hpp>
55 
56 #define TREE_NODE_NAME(r, data, elem) #elem,
57 
58 #define TREE_NODE_KIND(r, data, elem) BOOST_PP_CAT(elem, _K),
59 
60 #define UNARY_EXPRESSION_TREE_NODES \
61  (abs_expr)(addr_expr)(alignof_expr)(arrow_expr)(bit_not_expr)(buffer_ref)(card_expr)(cleanup_point_expr)( \
62  conj_expr)(convert_expr)(exit_expr)(fix_ceil_expr)(fix_floor_expr)(fix_round_expr)(fix_trunc_expr)(float_expr)( \
63  imagpart_expr)(indirect_ref)(misaligned_indirect_ref)(loop_expr)(negate_expr)(non_lvalue_expr)(nop_expr)( \
64  realpart_expr)(reference_expr)(reinterpret_cast_expr)(sizeof_expr)(static_cast_expr)(throw_expr)( \
65  truth_not_expr)(unsave_expr)(va_arg_expr)(view_convert_expr)(reduc_max_expr)(reduc_min_expr)(reduc_plus_expr)( \
66  vec_unpack_hi_expr)(vec_unpack_lo_expr)(vec_unpack_float_hi_expr)(vec_unpack_float_lo_expr)(paren_expr)
67 
68 #define BINARY_EXPRESSION_TREE_NODES \
69  (assert_expr)(bit_and_expr)(bit_ior_expr)(bit_xor_expr)(catch_expr)(ceil_div_expr)(ceil_mod_expr)(complex_expr)( \
70  compound_expr)(eh_filter_expr)(eq_expr)(exact_div_expr)(fdesc_expr)(floor_div_expr)(floor_mod_expr)(ge_expr)( \
71  gt_expr)(goto_subroutine)(in_expr)(init_expr)(le_expr)(lrotate_expr)(lshift_expr)(lt_expr)(max_expr)(mem_ref)( \
72  min_expr)(minus_expr)(modify_expr)(mult_expr)(mult_highpart_expr)(ne_expr)(ordered_expr)(plus_expr)( \
73  pointer_plus_expr)(postdecrement_expr)(postincrement_expr)(predecrement_expr)(preincrement_expr)(range_expr)( \
74  rdiv_expr)(round_div_expr)(round_mod_expr)(rrotate_expr)(rshift_expr)(set_le_expr)(trunc_div_expr)( \
75  trunc_mod_expr)(truth_and_expr)(truth_andif_expr)(truth_or_expr)(truth_orif_expr)(truth_xor_expr)( \
76  try_catch_expr)(try_finally)(uneq_expr)(ltgt_expr)(unge_expr)(ungt_expr)(unle_expr)(unlt_expr)(unordered_expr)( \
77  widen_sum_expr)(widen_mult_expr)(with_size_expr)(vec_lshift_expr)(vec_rshift_expr)(widen_mult_hi_expr)( \
78  widen_mult_lo_expr)(vec_pack_trunc_expr)(vec_pack_sat_expr)(vec_pack_fix_trunc_expr)(vec_extracteven_expr)( \
79  vec_extractodd_expr)(vec_interleavehigh_expr)(vec_interleavelow_expr)(extract_bit_expr)(sat_plus_expr)( \
80  sat_minus_expr)(extractvalue_expr)(extractelement_expr)(frem_expr)
81 
82 #define TERNARY_EXPRESSION_TREE_NODES \
83  (bit_field_ref)(bit_ior_concat_expr)(component_ref)(cond_expr)(vec_cond_expr)(vec_perm_expr)(dot_prod_expr)( \
84  obj_type_ref)(save_expr)(ternary_plus_expr)(ternary_pm_expr)(ternary_mp_expr)(ternary_mm_expr)(vtable_ref)( \
85  with_cleanup_expr)(fshl_expr)(fshr_expr)(insertvalue_expr)(insertelement_expr)
86 
87 #define QUATERNARY_EXPRESSION_TREE_NODES (array_range_ref)(array_ref)
88 
89 #define MISCELLANEOUS_EXPR_TREE_NODES \
90  (call_expr)(aggr_init_expr)(case_label_expr)(lut_expr)(modop_expr)(new_expr)(placeholder_expr)(scope_ref)( \
91  target_expr)(target_mem_ref)(target_mem_ref461)(template_id_expr)(trait_expr)(vec_new_expr)( \
92  nontype_argument_pack)(expr_pack_expansion)(cast_expr)
93 
94 #define PANDA_GIMPLE_NODES (gimple_for)(gimple_multi_way_if)(gimple_pragma)(gimple_while)
95 
96 #define GIMPLE_NODES \
97  (gimple_asm)(gimple_assign)(gimple_bind)(gimple_call)(gimple_cond)(gimple_goto)(gimple_label)(gimple_nop)( \
98  gimple_phi)(gimple_predict)(gimple_resx)(gimple_return)(gimple_switch)
99 
100 #define MISCELLANEOUS_OBJ_TREE_NODES \
101  (baselink)(binfo)(block)(constructor)(ctor_initializer)(error_mark)(expr_stmt)(handler)(identifier_node)(none)( \
102  null_node)(overload)(return_stmt)(ssa_name)(statement_list)(template_parm_index)(tree_list)(tree_reindex)( \
103  tree_vec)(try_block)
104 
105 #define TYPE_NODE_TREE_NODES \
106  (array_type)(boolean_type)(CharType)(nullptr_type)(type_pack_expansion)(complex_type)(enumeral_type)( \
107  function_type)(integer_type)(lang_type)(method_type)(offset_type)(pointer_type)(qual_union_type)(real_type)( \
108  record_type)(reference_type)(set_type)(template_type_parm)(typename_type)(union_type)(vector_type)( \
109  type_argument_pack)(void_type)
110 
111 #define CONST_OBJ_TREE_NODES (complex_cst)(integer_cst)(real_cst)(string_cst)(vector_cst)(void_cst)
112 
113 #define DECL_NODE_TREE_NODES \
114  (const_decl)(field_decl)(function_decl)(namespace_decl)(parm_decl)(result_decl)(template_decl)(label_decl)( \
115  translation_unit_decl)(type_decl)(using_decl)(var_decl)
116 
117 #define CPP_NODES \
118  (aggr_init_expr)(ctor_initializer)(expr_stmt)(if_stmt)(for_stmt)(handler)(modop_expr)(new_expr)(nullptr_type)( \
119  overload)(return_stmt)(scope_ref)(template_decl)(template_id_expr)(template_parm_index)(trait_expr)(try_block)( \
120  vec_new_expr)(while_stmt)(nontype_argument_pack)(expr_pack_expansion)
121 
122 #define CPP_STMT_NODES (do_stmt)(if_stmt)(for_stmt)(while_stmt)
123 
125 #define BASIC_BLOCK_TREE_NODES (bloc)
126 
128 #define PANDA_PRAGMA_TREE_NODES \
129  (blackbox_pragma)(call_hw_pragma)(call_point_hw_pragma)(issue_pragma)(map_pragma)(omp_atomic_pragma)( \
130  omp_critical_pragma)(omp_declare_simd_pragma)(omp_for_pragma)(omp_parallel_pragma)( \
131  omp_parallel_sections_pragma)(omp_pragma)(omp_section_pragma)(omp_sections_pragma)(omp_simd_pragma)( \
132  omp_target_pragma)(omp_task_pragma)(profiling_pragma)(statistical_profiling)
133 
134 #define PANDA_EXTENSION_TREE_NODES \
135  PANDA_PRAGMA_TREE_NODES \
136  PANDA_GIMPLE_NODES
137 
138 enum kind : int
139 {
142  CONST_OBJ_TREE_NODES) BOOST_PP_SEQ_FOR_EACH(TREE_NODE_KIND, BOOST_PP_EMPTY, CPP_STMT_NODES)
143  BOOST_PP_SEQ_FOR_EACH(TREE_NODE_KIND, BOOST_PP_EMPTY, DECL_NODE_TREE_NODES)
144  BOOST_PP_SEQ_FOR_EACH(TREE_NODE_KIND, BOOST_PP_EMPTY, GIMPLE_NODES)
145  BOOST_PP_SEQ_FOR_EACH(TREE_NODE_KIND, BOOST_PP_EMPTY, MISCELLANEOUS_EXPR_TREE_NODES)
146  BOOST_PP_SEQ_FOR_EACH(TREE_NODE_KIND, BOOST_PP_EMPTY, MISCELLANEOUS_OBJ_TREE_NODES)
147  BOOST_PP_SEQ_FOR_EACH(TREE_NODE_KIND, BOOST_PP_EMPTY, PANDA_EXTENSION_TREE_NODES)
148  BOOST_PP_SEQ_FOR_EACH(TREE_NODE_KIND, BOOST_PP_EMPTY, QUATERNARY_EXPRESSION_TREE_NODES)
149  BOOST_PP_SEQ_FOR_EACH(TREE_NODE_KIND, BOOST_PP_EMPTY, TERNARY_EXPRESSION_TREE_NODES)
150  BOOST_PP_SEQ_FOR_EACH(TREE_NODE_KIND, BOOST_PP_EMPTY, TYPE_NODE_TREE_NODES)
151  BOOST_PP_SEQ_FOR_EACH(TREE_NODE_KIND, BOOST_PP_EMPTY,
152  UNARY_EXPRESSION_TREE_NODES(last_tree))
153 };
154 
158 #define GET_KIND(meth) \
159  enum kind get_kind() const override \
160  { \
161  return (meth##_K); \
162  }
163 
164 #endif
#define CPP_STMT_NODES
#define TREE_NODE_KIND(r, data, elem)
Definition: tree_common.hpp:58
#define MISCELLANEOUS_OBJ_TREE_NODES
#define DECL_NODE_TREE_NODES
#define PANDA_EXTENSION_TREE_NODES
#define GIMPLE_NODES
Definition: tree_common.hpp:96
#define QUATERNARY_EXPRESSION_TREE_NODES
Definition: tree_common.hpp:87
kind
#define MISCELLANEOUS_EXPR_TREE_NODES
Definition: tree_common.hpp:89
#define TYPE_NODE_TREE_NODES
Template definition of refcount.
#define UNARY_EXPRESSION_TREE_NODES
Definition: tree_common.hpp:60
#define TERNARY_EXPRESSION_TREE_NODES
Definition: tree_common.hpp:82
#define BINARY_EXPRESSION_TREE_NODES
Definition: tree_common.hpp:68
#define CONST_OBJ_TREE_NODES

Generated on Mon Feb 12 2024 13:02:55 for PandA-2024.02 by doxygen 1.8.13