PandA-2024.02
tree_node_factory.cpp
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  */
44 #include "token_interface.hpp"
46 
48 #include "ext_tree_node.hpp"
49 #include "tree_basic_block.hpp"
50 #include "tree_manager.hpp"
51 #include "tree_node.hpp"
52 #include "tree_node_factory.hpp"
53 #include "tree_reindex.hpp"
54 #include "utility.hpp"
55 
56 #define CREATE_TREE_NODE_CASE_BODY(tree_node_name, node_id) \
57  { \
58  auto tnn = new tree_node_name(node_id); \
59  tree_nodeRef cur = tree_nodeRef(tnn); \
60  TM.AddTreeNode(node_id, cur); \
61  curr_tree_node_ptr = tnn; \
62  tnn->visit(this); \
63  curr_tree_node_ptr = nullptr; \
64  break; \
65  }
66 
67 void tree_node_factory::create_tree_node(unsigned int node_id, enum kind tree_node_type)
68 {
69  switch(tree_node_type)
70  {
71  case abs_expr_K:
72  CREATE_TREE_NODE_CASE_BODY(abs_expr, node_id)
73  case addr_expr_K:
74  CREATE_TREE_NODE_CASE_BODY(addr_expr, node_id)
75  case array_range_ref_K:
76  CREATE_TREE_NODE_CASE_BODY(array_range_ref, node_id)
77  case array_ref_K:
78  CREATE_TREE_NODE_CASE_BODY(array_ref, node_id)
79  case array_type_K:
81  case alignof_expr_K:
82  CREATE_TREE_NODE_CASE_BODY(alignof_expr, node_id)
83  case arrow_expr_K:
84  CREATE_TREE_NODE_CASE_BODY(arrow_expr, node_id)
85  case gimple_asm_K:
87  case baselink_K:
89  case gimple_bind_K:
91  case binfo_K:
93  case bit_and_expr_K:
94  CREATE_TREE_NODE_CASE_BODY(bit_and_expr, node_id)
95  case bit_field_ref_K:
96  CREATE_TREE_NODE_CASE_BODY(bit_field_ref, node_id)
97  case bit_ior_expr_K:
98  CREATE_TREE_NODE_CASE_BODY(bit_ior_expr, node_id)
99  case bit_ior_concat_expr_K:
100  CREATE_TREE_NODE_CASE_BODY(bit_ior_concat_expr, node_id)
101  case bit_not_expr_K:
102  CREATE_TREE_NODE_CASE_BODY(bit_not_expr, node_id)
103  case bit_xor_expr_K:
104  CREATE_TREE_NODE_CASE_BODY(bit_xor_expr, node_id)
105  case block_K:
107  case boolean_type_K:
108  CREATE_TREE_NODE_CASE_BODY(boolean_type, node_id)
109  case buffer_ref_K:
110  CREATE_TREE_NODE_CASE_BODY(buffer_ref, node_id)
111  case call_expr_K:
113  case aggr_init_expr_K:
115  case gimple_call_K:
117  case card_expr_K:
118  CREATE_TREE_NODE_CASE_BODY(card_expr, node_id)
119  case case_label_expr_K:
121  case cast_expr_K:
123  case catch_expr_K:
124  CREATE_TREE_NODE_CASE_BODY(catch_expr, node_id)
125  case ceil_div_expr_K:
126  CREATE_TREE_NODE_CASE_BODY(ceil_div_expr, node_id)
127  case ceil_mod_expr_K:
128  CREATE_TREE_NODE_CASE_BODY(ceil_mod_expr, node_id)
129  case CharType_K:
130  CREATE_TREE_NODE_CASE_BODY(CharType, node_id)
131  case nullptr_type_K:
132  CREATE_TREE_NODE_CASE_BODY(nullptr_type, node_id)
133  case type_pack_expansion_K:
135  case cleanup_point_expr_K:
136  CREATE_TREE_NODE_CASE_BODY(cleanup_point_expr, node_id)
137  case complex_cst_K:
139  case complex_expr_K:
140  CREATE_TREE_NODE_CASE_BODY(complex_expr, node_id)
141  case complex_type_K:
143  case component_ref_K:
144  CREATE_TREE_NODE_CASE_BODY(component_ref, node_id)
145  case compound_expr_K:
146  CREATE_TREE_NODE_CASE_BODY(compound_expr, node_id)
147  case cond_expr_K:
148  CREATE_TREE_NODE_CASE_BODY(cond_expr, node_id)
149  case gimple_cond_K:
151  case conj_expr_K:
152  CREATE_TREE_NODE_CASE_BODY(conj_expr, node_id)
153  case const_decl_K:
155  case constructor_K:
157  case convert_expr_K:
158  CREATE_TREE_NODE_CASE_BODY(convert_expr, node_id)
159  case ctor_initializer_K:
160  CREATE_TREE_NODE_CASE_BODY(ctor_initializer, node_id)
161  case eh_filter_expr_K:
162  CREATE_TREE_NODE_CASE_BODY(eh_filter_expr, node_id)
163  case enumeral_type_K:
165  case eq_expr_K:
166  CREATE_TREE_NODE_CASE_BODY(eq_expr, node_id)
167  case error_mark_K:
169  case exact_div_expr_K:
170  CREATE_TREE_NODE_CASE_BODY(exact_div_expr, node_id)
171  case exit_expr_K:
172  CREATE_TREE_NODE_CASE_BODY(exit_expr, node_id)
173  case expr_stmt_K:
175  case fdesc_expr_K:
176  CREATE_TREE_NODE_CASE_BODY(fdesc_expr, node_id)
177  case field_decl_K:
179  case fix_ceil_expr_K:
180  CREATE_TREE_NODE_CASE_BODY(fix_ceil_expr, node_id)
181  case fix_floor_expr_K:
182  CREATE_TREE_NODE_CASE_BODY(fix_floor_expr, node_id)
183  case fix_round_expr_K:
184  CREATE_TREE_NODE_CASE_BODY(fix_round_expr, node_id)
185  case fix_trunc_expr_K:
186  CREATE_TREE_NODE_CASE_BODY(fix_trunc_expr, node_id)
187  case float_expr_K:
188  CREATE_TREE_NODE_CASE_BODY(float_expr, node_id)
189  case floor_div_expr_K:
190  CREATE_TREE_NODE_CASE_BODY(floor_div_expr, node_id)
191  case floor_mod_expr_K:
192  CREATE_TREE_NODE_CASE_BODY(floor_mod_expr, node_id)
193  case function_decl_K:
195  case function_type_K:
197  case ge_expr_K:
198  CREATE_TREE_NODE_CASE_BODY(ge_expr, node_id)
199  case gimple_assign_K:
201  case gimple_goto_K:
203  case goto_subroutine_K:
204  CREATE_TREE_NODE_CASE_BODY(goto_subroutine, node_id)
205  case gt_expr_K:
206  CREATE_TREE_NODE_CASE_BODY(gt_expr, node_id)
207  case handler_K:
209  case imagpart_expr_K:
210  CREATE_TREE_NODE_CASE_BODY(imagpart_expr, node_id)
211  case indirect_ref_K:
212  CREATE_TREE_NODE_CASE_BODY(indirect_ref, node_id)
213  case misaligned_indirect_ref_K:
214  CREATE_TREE_NODE_CASE_BODY(misaligned_indirect_ref, node_id)
215  case in_expr_K:
216  CREATE_TREE_NODE_CASE_BODY(in_expr, node_id)
217  case init_expr_K:
218  CREATE_TREE_NODE_CASE_BODY(init_expr, node_id)
219  case integer_cst_K:
221  case integer_type_K:
223  case label_decl_K:
224  CREATE_TREE_NODE_CASE_BODY(label_decl, node_id)
225  case gimple_label_K:
227  case lang_type_K:
228  CREATE_TREE_NODE_CASE_BODY(lang_type, node_id)
229  case le_expr_K:
230  CREATE_TREE_NODE_CASE_BODY(le_expr, node_id)
231  case loop_expr_K:
232  CREATE_TREE_NODE_CASE_BODY(loop_expr, node_id)
233  case lut_expr_K:
235  case lrotate_expr_K:
236  CREATE_TREE_NODE_CASE_BODY(lrotate_expr, node_id)
237  case lshift_expr_K:
238  CREATE_TREE_NODE_CASE_BODY(lshift_expr, node_id)
239  case lt_expr_K:
240  CREATE_TREE_NODE_CASE_BODY(lt_expr, node_id)
241  case ltgt_expr_K:
242  CREATE_TREE_NODE_CASE_BODY(ltgt_expr, node_id)
243  case max_expr_K:
244  CREATE_TREE_NODE_CASE_BODY(max_expr, node_id)
245  case method_type_K:
247  case min_expr_K:
248  CREATE_TREE_NODE_CASE_BODY(min_expr, node_id)
249  case minus_expr_K:
250  CREATE_TREE_NODE_CASE_BODY(minus_expr, node_id)
251  case modify_expr_K:
252  CREATE_TREE_NODE_CASE_BODY(modify_expr, node_id)
253  case modop_expr_K:
254  CREATE_TREE_NODE_CASE_BODY(modop_expr, node_id)
255  case mult_expr_K:
256  CREATE_TREE_NODE_CASE_BODY(mult_expr, node_id)
257  case mult_highpart_expr_K:
258  CREATE_TREE_NODE_CASE_BODY(mult_highpart_expr, node_id)
259  case gimple_multi_way_if_K:
261  case namespace_decl_K:
263  case ne_expr_K:
264  CREATE_TREE_NODE_CASE_BODY(ne_expr, node_id)
265  case negate_expr_K:
266  CREATE_TREE_NODE_CASE_BODY(negate_expr, node_id)
267  case new_expr_K:
268  CREATE_TREE_NODE_CASE_BODY(new_expr, node_id)
269  case non_lvalue_expr_K:
270  CREATE_TREE_NODE_CASE_BODY(non_lvalue_expr, node_id)
271  case nop_expr_K:
272  CREATE_TREE_NODE_CASE_BODY(nop_expr, node_id)
273  case obj_type_ref_K:
274  CREATE_TREE_NODE_CASE_BODY(obj_type_ref, node_id)
275  case offset_type_K:
276  CREATE_TREE_NODE_CASE_BODY(offset_type, node_id)
277  case ordered_expr_K:
278  CREATE_TREE_NODE_CASE_BODY(ordered_expr, node_id)
279  case overload_K:
281  case parm_decl_K:
283  case gimple_phi_K:
285  case placeholder_expr_K:
286  CREATE_TREE_NODE_CASE_BODY(placeholder_expr, node_id)
287  case plus_expr_K:
288  CREATE_TREE_NODE_CASE_BODY(plus_expr, node_id)
289  case pointer_plus_expr_K:
290  CREATE_TREE_NODE_CASE_BODY(pointer_plus_expr, node_id)
291  case pointer_type_K:
293  case postdecrement_expr_K:
294  CREATE_TREE_NODE_CASE_BODY(postdecrement_expr, node_id)
295  case postincrement_expr_K:
296  CREATE_TREE_NODE_CASE_BODY(postincrement_expr, node_id)
297  case predecrement_expr_K:
298  CREATE_TREE_NODE_CASE_BODY(predecrement_expr, node_id)
299  case preincrement_expr_K:
300  CREATE_TREE_NODE_CASE_BODY(preincrement_expr, node_id)
301  case qual_union_type_K:
302  CREATE_TREE_NODE_CASE_BODY(qual_union_type, node_id)
303  case range_expr_K:
304  CREATE_TREE_NODE_CASE_BODY(range_expr, node_id)
305  case paren_expr_K:
306  CREATE_TREE_NODE_CASE_BODY(paren_expr, node_id)
307  case rdiv_expr_K:
308  CREATE_TREE_NODE_CASE_BODY(rdiv_expr, node_id)
309  case real_cst_K:
311  case realpart_expr_K:
312  CREATE_TREE_NODE_CASE_BODY(realpart_expr, node_id)
313  case real_type_K:
315  case record_type_K:
317  case reduc_max_expr_K:
318  CREATE_TREE_NODE_CASE_BODY(reduc_max_expr, node_id)
319  case reduc_min_expr_K:
320  CREATE_TREE_NODE_CASE_BODY(reduc_min_expr, node_id)
321  case reduc_plus_expr_K:
322  CREATE_TREE_NODE_CASE_BODY(reduc_plus_expr, node_id)
323  case reference_expr_K:
324  CREATE_TREE_NODE_CASE_BODY(reference_expr, node_id)
325  case reference_type_K:
327  case reinterpret_cast_expr_K:
328  CREATE_TREE_NODE_CASE_BODY(reinterpret_cast_expr, node_id)
329  case result_decl_K:
331  case gimple_resx_K:
333  case gimple_return_K:
335  case return_stmt_K:
337  case round_div_expr_K:
338  CREATE_TREE_NODE_CASE_BODY(round_div_expr, node_id)
339  case round_mod_expr_K:
340  CREATE_TREE_NODE_CASE_BODY(round_mod_expr, node_id)
341  case rrotate_expr_K:
342  CREATE_TREE_NODE_CASE_BODY(rrotate_expr, node_id)
343  case rshift_expr_K:
344  CREATE_TREE_NODE_CASE_BODY(rshift_expr, node_id)
345  case save_expr_K:
346  CREATE_TREE_NODE_CASE_BODY(save_expr, node_id)
347  case scope_ref_K:
349  case set_le_expr_K:
350  CREATE_TREE_NODE_CASE_BODY(set_le_expr, node_id)
351  case set_type_K:
352  CREATE_TREE_NODE_CASE_BODY(set_type, node_id)
353  case sizeof_expr_K:
354  CREATE_TREE_NODE_CASE_BODY(sizeof_expr, node_id)
355  case ssa_name_K:
357  case statement_list_K:
359  case static_cast_expr_K:
360  CREATE_TREE_NODE_CASE_BODY(static_cast_expr, node_id)
361  case string_cst_K:
363  case gimple_switch_K:
365  case target_expr_K:
367  case target_mem_ref_K:
369  case target_mem_ref461_K:
371  case mem_ref_K:
372  CREATE_TREE_NODE_CASE_BODY(mem_ref, node_id)
373  case template_decl_K:
375  case template_id_expr_K:
377  case template_parm_index_K:
379  case template_type_parm_K:
380  CREATE_TREE_NODE_CASE_BODY(template_type_parm, node_id)
381  case ternary_plus_expr_K:
382  CREATE_TREE_NODE_CASE_BODY(ternary_plus_expr, node_id)
383  case ternary_pm_expr_K:
384  CREATE_TREE_NODE_CASE_BODY(ternary_pm_expr, node_id)
385  case ternary_mp_expr_K:
386  CREATE_TREE_NODE_CASE_BODY(ternary_mp_expr, node_id)
387  case ternary_mm_expr_K:
388  CREATE_TREE_NODE_CASE_BODY(ternary_mm_expr, node_id)
389  case throw_expr_K:
390  CREATE_TREE_NODE_CASE_BODY(throw_expr, node_id)
391  case translation_unit_decl_K:
392  CREATE_TREE_NODE_CASE_BODY(translation_unit_decl, node_id)
393  case tree_list_K:
395  case tree_vec_K:
397  case trunc_div_expr_K:
398  CREATE_TREE_NODE_CASE_BODY(trunc_div_expr, node_id)
399  case trunc_mod_expr_K:
400  CREATE_TREE_NODE_CASE_BODY(trunc_mod_expr, node_id)
401  case truth_and_expr_K:
402  CREATE_TREE_NODE_CASE_BODY(truth_and_expr, node_id)
403  case truth_andif_expr_K:
404  CREATE_TREE_NODE_CASE_BODY(truth_andif_expr, node_id)
405  case truth_not_expr_K:
406  CREATE_TREE_NODE_CASE_BODY(truth_not_expr, node_id)
407  case truth_or_expr_K:
408  CREATE_TREE_NODE_CASE_BODY(truth_or_expr, node_id)
409  case truth_orif_expr_K:
410  CREATE_TREE_NODE_CASE_BODY(truth_orif_expr, node_id)
411  case truth_xor_expr_K:
412  CREATE_TREE_NODE_CASE_BODY(truth_xor_expr, node_id)
413  case try_block_K:
415  case try_catch_expr_K:
416  CREATE_TREE_NODE_CASE_BODY(try_catch_expr, node_id)
417  case try_finally_K:
418  CREATE_TREE_NODE_CASE_BODY(try_finally, node_id)
419  case type_decl_K:
421  case typename_type_K:
423  case uneq_expr_K:
424  CREATE_TREE_NODE_CASE_BODY(uneq_expr, node_id)
425  case unge_expr_K:
426  CREATE_TREE_NODE_CASE_BODY(unge_expr, node_id)
427  case ungt_expr_K:
428  CREATE_TREE_NODE_CASE_BODY(ungt_expr, node_id)
429  case union_type_K:
431  case unle_expr_K:
432  CREATE_TREE_NODE_CASE_BODY(unle_expr, node_id)
433  case unlt_expr_K:
434  CREATE_TREE_NODE_CASE_BODY(unlt_expr, node_id)
435  case unordered_expr_K:
436  CREATE_TREE_NODE_CASE_BODY(unordered_expr, node_id)
437  case unsave_expr_K:
438  CREATE_TREE_NODE_CASE_BODY(unsave_expr, node_id)
439  case using_decl_K:
441  case va_arg_expr_K:
442  CREATE_TREE_NODE_CASE_BODY(va_arg_expr, node_id)
443  case var_decl_K:
445  case vec_cond_expr_K:
446  CREATE_TREE_NODE_CASE_BODY(vec_cond_expr, node_id)
447  case vec_perm_expr_K:
448  CREATE_TREE_NODE_CASE_BODY(vec_perm_expr, node_id)
449  case dot_prod_expr_K:
450  CREATE_TREE_NODE_CASE_BODY(dot_prod_expr, node_id)
451  case vec_lshift_expr_K:
452  CREATE_TREE_NODE_CASE_BODY(vec_lshift_expr, node_id)
453  case vec_rshift_expr_K:
454  CREATE_TREE_NODE_CASE_BODY(vec_rshift_expr, node_id)
455  case widen_mult_hi_expr_K:
456  CREATE_TREE_NODE_CASE_BODY(widen_mult_hi_expr, node_id)
457  case widen_mult_lo_expr_K:
458  CREATE_TREE_NODE_CASE_BODY(widen_mult_lo_expr, node_id)
459  case vec_unpack_hi_expr_K:
460  CREATE_TREE_NODE_CASE_BODY(vec_unpack_hi_expr, node_id)
461  case vec_unpack_lo_expr_K:
462  CREATE_TREE_NODE_CASE_BODY(vec_unpack_lo_expr, node_id)
463  case vec_unpack_float_hi_expr_K:
464  CREATE_TREE_NODE_CASE_BODY(vec_unpack_float_hi_expr, node_id)
465  case vec_unpack_float_lo_expr_K:
466  CREATE_TREE_NODE_CASE_BODY(vec_unpack_float_lo_expr, node_id)
467  case vec_pack_trunc_expr_K:
468  CREATE_TREE_NODE_CASE_BODY(vec_pack_trunc_expr, node_id)
469  case vec_pack_sat_expr_K:
470  CREATE_TREE_NODE_CASE_BODY(vec_pack_sat_expr, node_id)
471  case vec_pack_fix_trunc_expr_K:
472  CREATE_TREE_NODE_CASE_BODY(vec_pack_fix_trunc_expr, node_id)
473  case vec_extracteven_expr_K:
474  CREATE_TREE_NODE_CASE_BODY(vec_extracteven_expr, node_id)
475  case vec_extractodd_expr_K:
476  CREATE_TREE_NODE_CASE_BODY(vec_extractodd_expr, node_id)
477  case vec_interleavehigh_expr_K:
478  CREATE_TREE_NODE_CASE_BODY(vec_interleavehigh_expr, node_id);
479  case vec_interleavelow_expr_K:
480  CREATE_TREE_NODE_CASE_BODY(vec_interleavelow_expr, node_id);
481  case vec_new_expr_K:
482  CREATE_TREE_NODE_CASE_BODY(vec_new_expr, node_id)
483  case vector_cst_K:
485  case void_cst_K:
486  CREATE_TREE_NODE_CASE_BODY(void_cst, node_id)
487  case type_argument_pack_K:
489  case nontype_argument_pack_K:
491  case expr_pack_expansion_K:
493  case vector_type_K:
495  case view_convert_expr_K:
496  CREATE_TREE_NODE_CASE_BODY(view_convert_expr, node_id)
497  case void_type_K:
498  CREATE_TREE_NODE_CASE_BODY(void_type, node_id)
499  case vtable_ref_K:
500  CREATE_TREE_NODE_CASE_BODY(vtable_ref, node_id)
501  case with_cleanup_expr_K:
502  CREATE_TREE_NODE_CASE_BODY(with_cleanup_expr, node_id)
503  case with_size_expr_K:
504  CREATE_TREE_NODE_CASE_BODY(with_size_expr, node_id)
505  case gimple_while_K:
507  case gimple_for_K:
509  case gimple_pragma_K:
511  case omp_pragma_K:
513  case omp_atomic_pragma_K:
515  case omp_for_pragma_K:
517  case omp_critical_pragma_K:
519  case omp_declare_simd_pragma_K:
521  case omp_simd_pragma_K:
523  case omp_parallel_pragma_K:
525  case omp_sections_pragma_K:
527  case omp_parallel_sections_pragma_K:
529  case omp_section_pragma_K:
531  case omp_target_pragma_K:
533  case omp_task_pragma_K:
535  case map_pragma_K:
537  case call_hw_pragma_K:
539  case call_point_hw_pragma_K:
540  {
542  }
543  case issue_pragma_K:
545  case blackbox_pragma_K:
547  case profiling_pragma_K:
549  case statistical_profiling_K:
551  case null_node_K:
553  case identifier_node_K:
554  {
555  tree_nodeRef cur;
556  if(tree_node_schema.find(TOK(TOK_STRG)) != tree_node_schema.end())
557  {
558  cur = tree_nodeRef(new identifier_node(node_id, tree_node_schema.find(TOK(TOK_STRG))->second, &TM));
559  }
560  else if(tree_node_schema.find(TOK(TOK_OPERATOR)) != tree_node_schema.end())
561  {
562  cur = tree_nodeRef(new identifier_node(
563  node_id, static_cast<bool>(std::stoi(tree_node_schema.find(TOK(TOK_OPERATOR))->second)), &TM));
564  }
565  else
566  {
567  THROW_ERROR("Incorrect schema for identifier_node: no TOK_STRG nor TOK_OPERATOR");
568  }
569  TM.AddTreeNode(node_id, cur);
570  break;
571  }
572  case widen_sum_expr_K:
573  CREATE_TREE_NODE_CASE_BODY(widen_sum_expr, node_id)
574  case widen_mult_expr_K:
575  CREATE_TREE_NODE_CASE_BODY(widen_mult_expr, node_id)
576  case gimple_nop_K:
578  case extract_bit_expr_K:
579  CREATE_TREE_NODE_CASE_BODY(extract_bit_expr, node_id)
580  case sat_plus_expr_K:
581  CREATE_TREE_NODE_CASE_BODY(sat_plus_expr, node_id)
582  case sat_minus_expr_K:
583  CREATE_TREE_NODE_CASE_BODY(sat_minus_expr, node_id)
584  case fshl_expr_K:
585  CREATE_TREE_NODE_CASE_BODY(fshl_expr, node_id)
586  case fshr_expr_K:
587  CREATE_TREE_NODE_CASE_BODY(fshr_expr, node_id)
588  case extractvalue_expr_K:
589  CREATE_TREE_NODE_CASE_BODY(extractvalue_expr, node_id)
590  case insertvalue_expr_K:
591  CREATE_TREE_NODE_CASE_BODY(insertvalue_expr, node_id)
592  case extractelement_expr_K:
593  CREATE_TREE_NODE_CASE_BODY(extractelement_expr, node_id)
594  case insertelement_expr_K:
595  CREATE_TREE_NODE_CASE_BODY(insertelement_expr, node_id)
596  case frem_expr_K:
597  CREATE_TREE_NODE_CASE_BODY(frem_expr, node_id)
598  case assert_expr_K:
599  case do_stmt_K:
600  case for_stmt_K:
601  case gimple_predict_K:
602  case if_stmt_K:
603  case last_tree_K:
604  case none_K:
605  case trait_expr_K:
606  case tree_reindex_K:
607  case while_stmt_K:
608  {
609  THROW_UNREACHABLE("Creation of tree node of type " + STR(tree_node_type) + " not implemented");
610  break;
611  }
612  default:
613  THROW_UNREACHABLE("");
614  }
615 }
616 
617 void tree_node_factory::operator()(const tree_node* obj, unsigned int&)
618 {
619  THROW_ERROR("tree_node not supported: " + std::string(obj->get_kind_text()));
620 }
621 
622 void tree_node_factory::operator()(const tree_reindex* obj, unsigned int&)
623 {
624  THROW_ERROR("tree_node not supported: " + std::string(obj->get_kind_text()));
625 }
626 
627 void tree_node_factory::operator()(const attr* obj, unsigned int& mask)
628 {
629  THROW_ASSERT(obj == dynamic_cast<attr*>(curr_tree_node_ptr), "wrong factory setup");
630  tree_node_mask::operator()(obj, mask);
631  // cppcheck-suppress unusedVariable
632  bool attr_p;
633 
634 #define ATTR_SEQ \
635  (TOK_NEW)(TOK_DELETE)(TOK_ASSIGN)(TOK_MEMBER)(TOK_PUBLIC)(TOK_PROTECTED)(TOK_PRIVATE)(TOK_NORETURN)(TOK_VOLATILE)( \
636  TOK_NOINLINE)(TOK_ALWAYS_INLINE)(TOK_USED)(TOK_UNUSED)(TOK_CONST)(TOK_TRANSPARENT_UNION)(TOK_CONSTRUCTOR)( \
637  TOK_DESTRUCTOR)(TOK_MODE)(TOK_SECTION)(TOK_ALIGNED)(TOK_WEAK)(TOK_ALIAS)(TOK_NO_INSTRUMENT_FUNCTION)( \
638  TOK_MALLOC)(TOK_NO_STACK_LIMIT)(TOK_PURE)(TOK_DEPRECATED)(TOK_VECTOR_SIZE)(TOK_VISIBILITY)(TOK_TLS_MODEL)( \
639  TOK_NONNULL)(TOK_NOTHROW)(TOK_MAY_ALIAS)(TOK_WARN_UNUSED_RESULT)(TOK_FORMAT)(TOK_FORMAT_ARG)(TOK_NULL)( \
640  TOK_GLOBAL_INIT)(TOK_GLOBAL_FINI)(TOK_CONVERSION)(TOK_VIRTUAL)(TOK_LSHIFT)(TOK_MUTABLE)(TOK_PSEUDO_TMPL)( \
641  TOK_VECNEW)(TOK_VECDELETE)(TOK_POS)(TOK_NEG)(TOK_ADDR)(TOK_DEREF)(TOK_LNOT)(TOK_NOT)(TOK_PREINC)(TOK_PREDEC)( \
642  TOK_PLUSASSIGN)(TOK_PLUS)(TOK_MINUSASSIGN)(TOK_MINUS)(TOK_MULTASSIGN)(TOK_MULT)(TOK_DIVASSIGN)(TOK_DIV)( \
643  TOK_MODASSIGN)(TOK_MOD)(TOK_ANDASSIGN)(TOK_AND)(TOK_ORASSIGN)(TOK_OR)(TOK_XORASSIGN)(TOK_XOR)( \
644  TOK_LSHIFTASSIGN)(TOK_RSHIFTASSIGN)(TOK_RSHIFT)(TOK_EQ)(TOK_NE)(TOK_LT)(TOK_GT)(TOK_LE)(TOK_GE)(TOK_LAND)( \
645  TOK_LOR)(TOK_COMPOUND)(TOK_MEMREF)(TOK_REF)(TOK_SUBS)(TOK_POSTINC)(TOK_POSTDEC)(TOK_CALL)(TOK_THUNK)( \
646  TOK_THIS_ADJUSTING)(TOK_RESULT_ADJUSTING)(TOK_BITFIELD)
647 #define ATTR_MACRO(r, data, elem) \
648  attr_p = tree_node_schema.find(TOK(elem)) != tree_node_schema.end(); \
649  if(attr_p) \
650  dynamic_cast<attr*>(curr_tree_node_ptr)->list_attr.insert(TOK(elem));
651 
652  BOOST_PP_SEQ_FOR_EACH(ATTR_MACRO, BOOST_PP_EMPTY, ATTR_SEQ);
653 #undef ATTR_MACRO
654 #undef ATTR_SEQ
655 }
656 
657 #define SET_NODE_ID_OPT(token, field, type) \
658  if(tree_node_schema.find(TOK(token)) != tree_node_schema.end()) \
659  { \
660  auto node_id = static_cast<unsigned>(std::stoul(tree_node_schema.find(TOK(token))->second)); \
661  dynamic_cast<type*>(curr_tree_node_ptr)->field = TM.GetTreeReindex(node_id); \
662  }
663 
664 #define SET_NODE_ID(token, field, type) \
665  { \
666  THROW_ASSERT(tree_node_schema.find(TOK(token)) != tree_node_schema.end(), \
667  std::string("tree_node_schema must have ") + STOK(token) + " value"); \
668  auto node_id = static_cast<unsigned>(std::stoul(tree_node_schema.find(TOK(token))->second)); \
669  dynamic_cast<type*>(curr_tree_node_ptr)->field = TM.GetTreeReindex(node_id); \
670  }
671 
672 #define SET_VALUE_OPT(token, field, type) \
673  if(tree_node_schema.find(TOK(token)) != tree_node_schema.end()) \
674  { \
675  dynamic_cast<type*>(curr_tree_node_ptr)->field = \
676  boost::lexical_cast<decltype(type::field)>(tree_node_schema.find(TOK(token))->second); \
677  }
678 
679 #define SET_VALUE(token, field, type) \
680  THROW_ASSERT(tree_node_schema.find(TOK(token)) != tree_node_schema.end(), \
681  std::string("tree node schema must have ") + STOK(token) + " value"); \
682  dynamic_cast<type*>(curr_tree_node_ptr)->field = \
683  boost::lexical_cast<decltype(type::field)>(tree_node_schema.find(TOK(token))->second);
684 
685 #define TREE_NOT_YET_IMPLEMENTED(token) \
686  THROW_ASSERT(tree_node_schema.find(TOK(token)) == tree_node_schema.end(), \
687  std::string("field not yet supported ") + STOK(token))
688 
689 void tree_node_factory::operator()(const WeightedNode*, unsigned int&)
690 {
691 }
692 
693 void tree_node_factory::operator()(const srcp* obj, unsigned int& mask)
694 {
695  THROW_ASSERT(obj == dynamic_cast<srcp*>(curr_tree_node_ptr), "wrong factory setup");
696  tree_node_mask::operator()(obj, mask);
698  "tree_node_schema must have TOK_SRCP value");
699  const std::string& srcp_str = tree_node_schema.find(TOK(TOK_SRCP))->second;
700  std::string::size_type colon_pos2 = srcp_str.rfind(':');
701  std::string::size_type colon_pos = srcp_str.rfind(':', colon_pos2 - 1);
702  dynamic_cast<srcp*>(curr_tree_node_ptr)->include_name = srcp_str.substr(0, colon_pos);
703  dynamic_cast<srcp*>(curr_tree_node_ptr)->line_number =
704  static_cast<unsigned>(std::stoul(srcp_str.substr(colon_pos + 1, colon_pos2 - colon_pos - 1)));
705  dynamic_cast<srcp*>(curr_tree_node_ptr)->column_number =
706  static_cast<unsigned>(std::stoul(srcp_str.substr(colon_pos2 + 1)));
707 }
708 
709 void tree_node_factory::operator()(const decl_node* obj, unsigned int& mask)
710 {
711  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
712  tree_node_mask::operator()(obj, mask);
713 
721  SET_VALUE_OPT(TOK_ARTIFICIAL, artificial_flag, decl_node);
722  SET_VALUE_OPT(TOK_PACKED, packed_flag, decl_node);
723  SET_VALUE_OPT(TOK_OPERATING_SYSTEM, operating_system_flag, decl_node);
724  SET_VALUE_OPT(TOK_LIBRARY_SYSTEM, library_system_flag, decl_node);
725  SET_VALUE_OPT(TOK_LIBBAMBU, libbambu_flag, decl_node);
726  SET_VALUE_OPT(TOK_C, C_flag, decl_node);
727 }
728 
729 void tree_node_factory::operator()(const expr_node* obj, unsigned int& mask)
730 {
731  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
732  tree_node_mask::operator()(obj, mask);
734 }
735 
736 void tree_node_factory::operator()(const gimple_node* obj, unsigned int& mask)
737 {
738  tree_node_mask::operator()(obj, mask);
745 }
746 
747 void tree_node_factory::operator()(const unary_expr* obj, unsigned int& mask)
748 {
749  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
750  tree_node_mask::operator()(obj, mask);
752 }
753 
754 void tree_node_factory::operator()(const binary_expr* obj, unsigned int& mask)
755 {
756  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
757  tree_node_mask::operator()(obj, mask);
760 }
761 
762 void tree_node_factory::operator()(const ternary_expr* obj, unsigned int& mask)
763 {
764  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
765  tree_node_mask::operator()(obj, mask);
769 }
770 
771 void tree_node_factory::operator()(const quaternary_expr* obj, unsigned int& mask)
772 {
773  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
774  tree_node_mask::operator()(obj, mask);
779 }
780 
781 void tree_node_factory::operator()(const type_node* obj, unsigned int& mask)
782 {
783  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
784  tree_node_mask::operator()(obj, mask);
785  if(tree_node_schema.find(TOK(TOK_QUAL)) != tree_node_schema.end())
786  {
787  dynamic_cast<type_node*>(curr_tree_node_ptr)->qual = static_cast<TreeVocabularyTokenTypes_TokenEnum>(
788  static_cast<unsigned>(std::stoul(tree_node_schema.find(TOK(TOK_QUAL))->second)));
789  }
794  SET_VALUE_OPT(TOK_SYSTEM, packed_flag, type_node);
795  SET_VALUE_OPT(TOK_SYSTEM, system_flag, type_node);
797 }
798 
799 void tree_node_factory::operator()(const memory_tag* obj, unsigned int& mask)
800 {
801  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
802  tree_node_mask::operator()(obj, mask);
803 
804  // TREE_NOT_YET_IMPLEMENTED(TOK_ALIAS);
805  // std::vector<tree_nodeRef>::const_iterator vend = obj->list_of_aliases.end();
806  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_aliases.begin(); i != vend; i++)
807  // write_when_not_null(STOK(TOK_ALIAS), *i);
808 }
809 
810 void tree_node_factory::operator()(const cst_node* obj, unsigned int& mask)
811 {
812  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
813  tree_node_mask::operator()(obj, mask);
815 }
816 
817 void tree_node_factory::operator()(const error_mark* obj, unsigned int& mask)
818 {
819  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
820  tree_node_mask::operator()(obj, mask);
821 }
822 
823 void tree_node_factory::operator()(const array_type* obj, unsigned int& mask)
824 {
825  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
826  tree_node_mask::operator()(obj, mask);
829 }
830 
831 void tree_node_factory::operator()(const gimple_asm* obj, unsigned int& mask)
832 {
833  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
834  tree_node_mask::operator()(obj, mask);
835  SET_VALUE_OPT(TOK_CTOR, volatile_flag, gimple_asm);
840 }
841 
842 void tree_node_factory::operator()(const baselink* obj, unsigned int& mask)
843 {
844  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
845  tree_node_mask::operator()(obj, mask);
847 }
848 
849 void tree_node_factory::operator()(const gimple_bind* obj, unsigned int& mask)
850 {
851  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
852  tree_node_mask::operator()(obj, mask);
854  // std::vector<tree_nodeRef>::const_iterator vend = obj->list_of_vars.end();
855  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_vars.begin(); i != vend; i++)
856  // write_when_not_null(STOK(TOK_VARS), *i);
858 }
859 
860 void tree_node_factory::operator()(const binfo* obj, unsigned int& mask)
861 {
862  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
863  tree_node_mask::operator()(obj, mask);
865  SET_VALUE_OPT(TOK_VIRT, virt_flag, binfo);
866  SET_VALUE(TOK_BASES, bases, binfo);
868  // std::vector<std::pair< unsigned int, tree_nodeRef> >::const_iterator vend = obj->list_of_access_binf.end();
869  // for (std::vector<std::pair< unsigned int, tree_nodeRef> >::const_iterator i = obj->list_of_access_binf.begin(); i
870  // != vend; i++)
871  //{
872  // WRITE_TOKEN2(os, i->first);
873  // write_when_not_null(STOK(TOK_BINF), i->second);
874  //}
875 }
876 
877 void tree_node_factory::operator()(const block* obj, unsigned int& mask)
878 {
879  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
880  tree_node_mask::operator()(obj, mask);
881  // if (obj->bl_flag)
882  // WRITE_UFIELD_STRING(os, obj->bl);
883 }
884 
885 void tree_node_factory::operator()(const call_expr* obj, unsigned int& mask)
886 {
887  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
888  tree_node_mask::operator()(obj, mask);
890  if(tree_node_schema.find(TOK(TOK_ARG)) != tree_node_schema.end())
891  {
892  const auto args =
893  string_to_container<std::vector<unsigned int>>(tree_node_schema.find(TOK(TOK_ARG))->second, "_");
894  for(const auto arg : args)
895  {
896  dynamic_cast<call_expr*>(curr_tree_node_ptr)->args.push_back(TM.GetTreeReindex(arg));
897  }
898  }
899 }
900 
901 void tree_node_factory::operator()(const aggr_init_expr* obj, unsigned int& mask)
902 {
903  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
904  tree_node_mask::operator()(obj, mask);
907 }
908 
909 void tree_node_factory::operator()(const gimple_call* obj, unsigned int& mask)
910 {
911  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
912  tree_node_mask::operator()(obj, mask);
914  if(tree_node_schema.find(TOK(TOK_ARG)) != tree_node_schema.end())
915  {
916  const auto args =
917  string_to_container<std::vector<unsigned int>>(tree_node_schema.find(TOK(TOK_ARG))->second, "_");
918  for(const auto arg : args)
919  {
920  dynamic_cast<gimple_call*>(curr_tree_node_ptr)->args.push_back(TM.GetTreeReindex(arg));
921  }
922  }
923 }
924 
925 void tree_node_factory::operator()(const case_label_expr* obj, unsigned int& mask)
926 {
927  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
928  tree_node_mask::operator()(obj, mask);
931  SET_VALUE_OPT(TOK_DEFAULT, default_flag, case_label_expr);
933 }
934 
935 void tree_node_factory::operator()(const cast_expr* obj, unsigned int& mask)
936 {
937  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
938  tree_node_mask::operator()(obj, mask);
940 }
941 
942 void tree_node_factory::operator()(const complex_cst* obj, unsigned int& mask)
943 {
944  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
945  tree_node_mask::operator()(obj, mask);
948 }
949 
950 void tree_node_factory::operator()(const complex_type* obj, unsigned int& mask)
951 {
952  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
953  tree_node_mask::operator()(obj, mask);
954  SET_VALUE_OPT(TOK_UNSIGNED, unsigned_flag, complex_type);
956 }
957 
958 void tree_node_factory::operator()(const gimple_cond* obj, unsigned int& mask)
959 {
960  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
961  tree_node_mask::operator()(obj, mask);
963 }
964 
965 void tree_node_factory::operator()(const const_decl* obj, unsigned int& mask)
966 {
967  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
968  tree_node_mask::operator()(obj, mask);
970 }
971 
972 void tree_node_factory::operator()(const constructor* obj, unsigned int& mask)
973 {
974  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
975  tree_node_mask::operator()(obj, mask);
979  // std::vector<std::pair< tree_nodeRef, tree_nodeRef> >::const_iterator vend = obj->list_of_idx_valu.end();
980  // for (std::vector<std::pair< tree_nodeRef, tree_nodeRef> >::const_iterator i = obj->list_of_idx_valu.begin(); i !=
981  // vend; i++)
982  //{
983  // write_when_not_null(STOK(TOK_IDX), i->first);
984  // write_when_not_null(STOK(TOK_VALU), i->second);
985  //}
986 }
987 
988 void tree_node_factory::operator()(const enumeral_type* obj, unsigned int& mask)
989 {
990  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
991  tree_node_mask::operator()(obj, mask);
993  SET_VALUE_OPT(TOK_UNSIGNED, unsigned_flag, enumeral_type);
997 }
998 
999 void tree_node_factory::operator()(const expr_stmt* obj, unsigned int& mask)
1000 {
1001  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1002  tree_node_mask::operator()(obj, mask);
1003 
1007 }
1008 
1009 void tree_node_factory::operator()(const field_decl* obj, unsigned int& mask)
1010 {
1011  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1012  tree_node_mask::operator()(obj, mask);
1018 }
1019 
1020 void tree_node_factory::operator()(const function_decl* obj, unsigned int& mask)
1021 {
1022  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1023  tree_node_mask::operator()(obj, mask);
1024  SET_VALUE_OPT(TOK_OPERATOR, operator_flag, function_decl);
1025  // std::vector<std::string>::const_iterator vend = obj->list_of_op_names.end();
1026  // for (std::vector<std::string>::const_iterator i = obj->list_of_op_names.begin(); i != vend; i++)
1027  // WRITE_UFIELD_STRING(os, *i);
1030 
1032  SET_VALUE_OPT(TOK_FIXD, fixd_flag, function_decl);
1033  SET_VALUE_OPT(TOK_VIRT, virt_flag, function_decl);
1037  // std::vector<tree_nodeRef>::const_iterator vend2 = obj->list_of_args.end();
1038  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_args.begin(); i != vend2; i++)
1039  // write_when_not_null(STOK(TOK_ARGS), *i);
1040 
1041  SET_VALUE_OPT(TOK_UNDEFINED, undefined_flag, function_decl);
1042  SET_VALUE_OPT(TOK_UNDEFINED, builtin_flag, function_decl);
1043  SET_VALUE_OPT(TOK_STATIC, static_flag, function_decl);
1044  SET_VALUE_OPT(TOK_HWCALL, hwcall_flag, function_decl);
1045  SET_VALUE_OPT(TOK_REVERSE_RESTRICT, reverse_restrict_flag, function_decl);
1048  SET_VALUE_OPT(TOK_PIPELINE_ENABLED, pipeline_enabled, function_decl);
1049  SET_VALUE_OPT(TOK_SIMPLE_PIPELINE, simple_pipeline, function_decl);
1050  SET_VALUE_OPT(TOK_INITIATION_TIME, initiation_time, function_decl);
1051 #if HAVE_FROM_PRAGMA_BUILT
1055  SET_VALUE_OPT(TOK_OMP_FOR_WRAPPER, omp_for_wrapper, function_decl);
1056 #endif
1059 }
1060 
1061 void tree_node_factory::operator()(const function_type* obj, unsigned int& mask)
1062 {
1063  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1064  tree_node_mask::operator()(obj, mask);
1067  SET_VALUE_OPT(TOK_VARARGS, varargs_flag, function_type);
1068 }
1069 
1070 void tree_node_factory::operator()(const gimple_assign* obj, unsigned int& mask)
1071 {
1072  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1073  tree_node_mask::operator()(obj, mask);
1077  SET_VALUE_OPT(TOK_INIT, init_assignment, gimple_assign);
1079  SET_VALUE_OPT(TOK_ADDR, temporary_address, gimple_assign);
1080 }
1081 
1082 void tree_node_factory::operator()(const gimple_goto* obj, unsigned int& mask)
1083 {
1084  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1085  tree_node_mask::operator()(obj, mask);
1087 }
1088 
1089 void tree_node_factory::operator()(const handler* obj, unsigned int& mask)
1090 {
1091  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1092  tree_node_mask::operator()(obj, mask);
1093 
1096 }
1097 
1098 void tree_node_factory::operator()(const identifier_node* obj, unsigned int& mask)
1099 {
1100  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1101  tree_node_mask::operator()(obj, mask);
1102  THROW_ERROR("Use find_identifier_nodeID to find identifier_node objects");
1103 }
1104 
1105 void tree_node_factory::operator()(const integer_cst* obj, unsigned int& mask)
1106 {
1107  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1108  tree_node_mask::operator()(obj, mask);
1110 }
1111 
1112 void tree_node_factory::operator()(const integer_type* obj, unsigned int& mask)
1113 {
1114  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1115  tree_node_mask::operator()(obj, mask);
1117  // if (obj->str != "")
1118  // WRITE_UFIELD(os, obj->str);
1119  SET_VALUE_OPT(TOK_UNSIGNED, unsigned_flag, integer_type);
1122 }
1123 
1124 void tree_node_factory::operator()(const gimple_label* obj, unsigned int& mask)
1125 {
1126  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1127  tree_node_mask::operator()(obj, mask);
1129 }
1130 
1131 void tree_node_factory::operator()(const method_type* obj, unsigned int& mask)
1132 {
1133  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1134  tree_node_mask::operator()(obj, mask);
1136 }
1137 
1138 void tree_node_factory::operator()(const namespace_decl* obj, unsigned int& mask)
1139 {
1140  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1141  tree_node_mask::operator()(obj, mask);
1143 }
1144 
1145 void tree_node_factory::operator()(const overload* obj, unsigned int& mask)
1146 {
1147  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1148  tree_node_mask::operator()(obj, mask);
1149 
1152 }
1153 
1154 void tree_node_factory::operator()(const parm_decl* obj, unsigned int& mask)
1155 {
1156  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1157  tree_node_mask::operator()(obj, mask);
1162  SET_VALUE_OPT(TOK_REGISTER, register_flag, parm_decl);
1163  SET_VALUE_OPT(TOK_READONLY, readonly_flag, parm_decl);
1165 }
1166 
1167 void tree_node_factory::operator()(const gimple_phi* obj, unsigned int& mask)
1168 {
1169  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1170  tree_node_mask::operator()(obj, mask);
1171 
1173  SET_VALUE_OPT(TOK_VIRTUAL, virtual_flag, gimple_phi);
1174  // TREE_NOT_YET_IMPLEMENTED(TOK_DEF);
1175  // TREE_NOT_YET_IMPLEMENTED(TOK_EDGE);
1176  // std::vector<std::pair< tree_nodeRef, int> >::const_iterator vend = obj->list_of_def_edge.end();
1177  // for (std::vector<std::pair< tree_nodeRef, int> >::const_iterator i = obj->list_of_def_edge.begin(); i != vend;
1178  // i++)
1179  //{
1180  // write_when_not_null(STOK(TOK_DEF), i->first);
1181  // WRITE_NFIELD(os, STOK(TOK_EDGE), i->second);
1182  //}
1183 }
1184 
1185 void tree_node_factory::operator()(const pointer_type* obj, unsigned int& mask)
1186 {
1187  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1188  tree_node_mask::operator()(obj, mask);
1190 }
1191 
1192 void tree_node_factory::operator()(const real_cst* obj, unsigned int& mask)
1193 {
1194  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1195  tree_node_mask::operator()(obj, mask);
1196  SET_VALUE_OPT(TOK_OVERFLOW, overflow_flag, real_cst);
1199 }
1200 
1201 void tree_node_factory::operator()(const real_type* obj, unsigned int& mask)
1202 {
1203  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1204  tree_node_mask::operator()(obj, mask);
1206 }
1207 
1208 void tree_node_factory::operator()(const record_type* obj, unsigned int& mask)
1209 {
1210  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1211  tree_node_mask::operator()(obj, mask);
1214 
1215  SET_VALUE_OPT(TOK_PTRMEM, ptrmem_flag, record_type);
1220  SET_VALUE_OPT(TOK_SPEC, spec_flag, record_type);
1221  SET_VALUE_OPT(TOK_STRUCT, struct_flag, record_type);
1223  // std::vector<tree_nodeRef>::const_iterator vend1 = obj->list_of_flds.end();
1224  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_flds.begin(); i != vend1; i++)
1225  // write_when_not_null(STOK(TOK_FLDS), *i);
1227  // std::vector<tree_nodeRef>::const_iterator vend2 = obj->list_of_fncs.end();
1228  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_fncs.begin(); i != vend2; i++)
1229  // write_when_not_null(STOK(TOK_FNCS), *i);
1231 }
1232 
1233 void tree_node_factory::operator()(const reference_type* obj, unsigned int& mask)
1234 {
1235  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1236  tree_node_mask::operator()(obj, mask);
1238 }
1239 
1240 void tree_node_factory::operator()(const result_decl* obj, unsigned int& mask)
1241 {
1242  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1243  tree_node_mask::operator()(obj, mask);
1248 }
1249 
1250 void tree_node_factory::operator()(const gimple_return* obj, unsigned int& mask)
1251 {
1252  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1253  tree_node_mask::operator()(obj, mask);
1255 }
1256 
1257 void tree_node_factory::operator()(const return_stmt* obj, unsigned int& mask)
1258 {
1259  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1260  tree_node_mask::operator()(obj, mask);
1261 
1264 }
1265 
1266 void tree_node_factory::operator()(const scope_ref* obj, unsigned int& mask)
1267 {
1268  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1269  tree_node_mask::operator()(obj, mask);
1272 }
1273 
1274 void tree_node_factory::operator()(const ssa_name* obj, unsigned int& mask)
1275 {
1276  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1277  tree_node_mask::operator()(obj, mask);
1278 
1282  SET_VALUE_OPT(TOK_ORIG_VERS, orig_vers, ssa_name);
1283  // SET_NODE_ID_OPT(TOK_PTR_INFO,ptr_info,ssa_name);
1284 
1285  SET_VALUE_OPT(TOK_VOLATILE, volatile_flag, ssa_name);
1286  SET_VALUE_OPT(TOK_VIRTUAL, virtual_flag, ssa_name);
1289  SET_VALUE_OPT(TOK_BIT_VALUES, bit_values, ssa_name);
1290 }
1291 
1292 void tree_node_factory::operator()(const statement_list* obj, unsigned int& mask)
1293 {
1294  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1295  tree_node_mask::operator()(obj, mask);
1297  // std::vector<tree_nodeRef>::const_iterator vend = obj->list_of_stmt.end();
1298  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_stmt.begin(); i != vend; i++)
1299  // write_when_not_null(STOK(TOK_STMT), *i);
1301  // std::map<int, blocRef>::const_iterator mend = obj->list_of_bloc.end();
1302  // for (std::map<int, blocRef>::const_iterator i = obj->list_of_bloc.begin(); i != mend; i++)
1303  // write_when_not_null_bloc(STOK(TOK_BLOC), i->second);
1304 }
1305 
1306 void tree_node_factory::operator()(const string_cst* obj, unsigned int& mask)
1307 {
1308  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1309  tree_node_mask::operator()(obj, mask);
1311 }
1312 
1313 void tree_node_factory::operator()(const gimple_switch* obj, unsigned int& mask)
1314 {
1315  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1316  tree_node_mask::operator()(obj, mask);
1319 }
1320 
1321 void tree_node_factory::operator()(const target_expr* obj, unsigned int& mask)
1322 {
1323  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1324  tree_node_mask::operator()(obj, mask);
1328 }
1329 
1330 void tree_node_factory::operator()(const lut_expr* obj, unsigned int& mask)
1331 {
1332  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1333  tree_node_mask::operator()(obj, mask);
1343 }
1344 
1345 void tree_node_factory::operator()(const template_decl* obj, unsigned int& mask)
1346 {
1347  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1348  tree_node_mask::operator()(obj, mask);
1353 }
1354 
1355 void tree_node_factory::operator()(const template_parm_index* obj, unsigned int& mask)
1356 {
1357  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1358  tree_node_mask::operator()(obj, mask);
1366 }
1367 
1368 void tree_node_factory::operator()(const tree_list* obj, unsigned int& mask)
1369 {
1370  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1371  tree_node_mask::operator()(obj, mask);
1372 
1376 }
1377 
1378 void tree_node_factory::operator()(const tree_vec* obj, unsigned int& mask)
1379 {
1380  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1381  tree_node_mask::operator()(obj, mask);
1382 
1385  // std::vector<tree_nodeRef>::const_iterator vend = obj->list_of_op.end();
1386  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_op.begin(); i != vend; i++)
1387  // write_when_not_null(STOK(TOK_OP), *i);
1388 }
1389 
1390 void tree_node_factory::operator()(const try_block* obj, unsigned int& mask)
1391 {
1392  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1393  tree_node_mask::operator()(obj, mask);
1394 
1399 }
1400 
1401 void tree_node_factory::operator()(const type_decl* obj, unsigned int& mask)
1402 {
1403  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1404  tree_node_mask::operator()(obj, mask);
1407 }
1408 
1409 void tree_node_factory::operator()(const union_type* obj, unsigned int& mask)
1410 {
1411  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1412  tree_node_mask::operator()(obj, mask);
1414  // std::vector<tree_nodeRef>::const_iterator vend1 = obj->list_of_flds.end();
1415  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_flds.begin(); i != vend1; i++)
1416  // write_when_not_null(STOK(TOK_FLDS), *i);
1418  // std::vector<tree_nodeRef>::const_iterator vend2 = obj->list_of_fncs.end();
1419  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_fncs.begin(); i != vend2; i++)
1420  // write_when_not_null(STOK(TOK_FNCS), *i);
1422 }
1423 
1424 void tree_node_factory::operator()(const var_decl* obj, unsigned int& mask)
1425 {
1426  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1427  tree_node_mask::operator()(obj, mask);
1428 
1429  SET_VALUE_OPT(TOK_USE_TMPL, use_tmpl, var_decl);
1430  SET_VALUE_OPT(TOK_STATIC_STATIC, static_static_flag, var_decl);
1431  SET_VALUE_OPT(TOK_EXTERN, extern_flag, var_decl);
1432  SET_VALUE_OPT(TOK_ADDR_TAKEN, addr_taken, var_decl);
1433  SET_VALUE_OPT(TOK_ADDR_NOT_TAKEN, addr_not_taken, var_decl);
1434  SET_VALUE_OPT(TOK_STATIC, static_flag, var_decl);
1439  SET_VALUE_OPT(TOK_REGISTER, register_flag, var_decl);
1440  SET_VALUE_OPT(TOK_READONLY, readonly_flag, var_decl);
1441  SET_VALUE_OPT(TOK_BIT_VALUES, bit_values, var_decl);
1446 }
1447 
1448 void tree_node_factory::operator()(const vector_cst* obj, unsigned int& mask)
1449 {
1450  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1451  tree_node_mask::operator()(obj, mask);
1453  // std::vector<tree_nodeRef>::const_iterator vend = obj->list_of_valu.end();
1454  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_valu.begin(); i != vend; i++)
1455  // write_when_not_null(STOK(TOK_VALU), *i);
1456 }
1457 
1458 void tree_node_factory::operator()(const type_argument_pack* obj, unsigned int& mask)
1459 {
1460  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1461  tree_node_mask::operator()(obj, mask);
1463 }
1464 
1465 void tree_node_factory::operator()(const nontype_argument_pack* obj, unsigned int& mask)
1466 {
1467  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1468  tree_node_mask::operator()(obj, mask);
1470 }
1471 
1472 void tree_node_factory::operator()(const type_pack_expansion* obj, unsigned int& mask)
1473 {
1474  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1475  tree_node_mask::operator()(obj, mask);
1479 }
1480 
1481 void tree_node_factory::operator()(const expr_pack_expansion* obj, unsigned int& mask)
1482 {
1483  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1484  tree_node_mask::operator()(obj, mask);
1488 }
1489 
1490 void tree_node_factory::operator()(const vector_type* obj, unsigned int& mask)
1491 {
1492  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1493  tree_node_mask::operator()(obj, mask);
1495 }
1496 
1497 void tree_node_factory::operator()(const target_mem_ref* obj, unsigned int& mask)
1498 {
1499  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1500  tree_node_mask::operator()(obj, mask);
1501 
1510 }
1511 
1512 void tree_node_factory::operator()(const target_mem_ref461* obj, unsigned int& mask)
1513 {
1514  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1515  tree_node_mask::operator()(obj, mask);
1516 
1523 }
1524 
1525 void tree_node_factory::operator()(const bloc* obj, unsigned int& mask)
1526 {
1527  tree_node_mask::operator()(obj, mask);
1528  // WRITE_UFIELD(os, obj->number);
1529  SET_VALUE_OPT(TOK_HPL, hpl, bloc);
1530  SET_VALUE_OPT(TOK_LOOP_ID, loop_id, bloc);
1532  // std::vector<int>::const_iterator vend1 = obj->list_of_pred.end();
1533  // for (std::vector<int>::const_iterator i = obj->list_of_pred.begin(); i != vend1; i++)
1534  // if (*i == bloc::ENTRY_BLOCK_ID)
1535  // WRITE_NFIELD(os, STOK(TOK_PRED), STOK(TOK_ENTRY));
1536  // else
1537  // WRITE_NFIELD(os, STOK(TOK_PRED), *i);
1539  // std::vector<int>::const_iterator vend2 = obj->list_of_succ.end();
1540  // for (std::vector<int>::const_iterator i = obj->list_of_succ.begin(); i != vend2; i++)
1541  // if (*i == bloc::EXIT_BLOCK_ID)
1542  // WRITE_NFIELD(os, STOK(TOK_SUCC), STOK(TOK_EXIT));
1543  // else
1544  // WRITE_NFIELD(os, STOK(TOK_SUCC), *i);
1545  SET_VALUE_OPT(TOK_TRUE_EDGE, true_edge, bloc);
1546  SET_VALUE_OPT(TOK_FALSE_EDGE, false_edge, bloc);
1548  // std::vector<tree_nodeRef>::const_iterator vend3 = obj->list_of_phi.end();
1549  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_phi.begin(); i != vend3; i++)
1550  // write_when_not_null(STOK(TOK_PHI), *i);
1551  // std::vector<tree_nodeRef>::const_iterator vend4 = obj->list_of_stmt.end();
1553  // for (std::vector<tree_nodeRef>::const_iterator i = obj->list_of_stmt.begin(); i != vend4; i++)
1554  // write_when_not_null(STOK(TOK_STMT), *i);
1555 }
1556 
1557 void tree_node_factory::operator()(const gimple_while* obj, unsigned int& mask)
1558 {
1559  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1560  tree_node_mask::operator()(obj, mask);
1562 }
1563 
1564 void tree_node_factory::operator()(const gimple_for* obj, unsigned int& mask)
1565 {
1566  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1567  tree_node_mask::operator()(obj, mask);
1570 }
1571 
1572 void tree_node_factory::operator()(const gimple_multi_way_if* obj, unsigned int& mask)
1573 {
1574  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1575  tree_node_mask::operator()(obj, mask);
1577 }
1578 
1579 void tree_node_factory::operator()(const null_node* obj, unsigned int& mask)
1580 {
1581  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1582  tree_node_mask::operator()(obj, mask);
1583 }
1584 
1585 void tree_node_factory::operator()(const gimple_pragma* obj, unsigned int& mask)
1586 {
1587  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1588  tree_node_mask::operator()(obj, mask);
1590  SET_VALUE_OPT(TOK_OPEN, is_opening, gimple_pragma);
1595 }
1596 
1597 void tree_node_factory::operator()(const omp_pragma* obj, unsigned int& mask)
1598 {
1599  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1600  tree_node_mask::operator()(obj, mask);
1601 }
1602 
1603 void tree_node_factory::operator()(const omp_for_pragma* obj, unsigned int& mask)
1604 {
1605  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1606  tree_node_mask::operator()(obj, mask);
1607 }
1608 
1609 void tree_node_factory::operator()(const omp_simd_pragma* obj, unsigned int& mask)
1610 {
1611  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1612  tree_node_mask::operator()(obj, mask);
1613 }
1614 
1615 void tree_node_factory::operator()(const omp_declare_simd_pragma* obj, unsigned int& mask)
1616 {
1617  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1618  tree_node_mask::operator()(obj, mask);
1619 }
1620 
1621 void tree_node_factory::operator()(const omp_target_pragma* obj, unsigned int& mask)
1622 {
1623  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1624  tree_node_mask::operator()(obj, mask);
1625 }
1626 
1627 void tree_node_factory::operator()(const omp_critical_pragma* obj, unsigned int& mask)
1628 {
1629  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1630  tree_node_mask::operator()(obj, mask);
1631 }
1632 
1633 void tree_node_factory::operator()(const omp_task_pragma* obj, unsigned int& mask)
1634 {
1635  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1636  tree_node_mask::operator()(obj, mask);
1637 }
1638 
1639 void tree_node_factory::operator()(const omp_parallel_pragma* obj, unsigned int& mask)
1640 {
1641  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1642  tree_node_mask::operator()(obj, mask);
1644 }
1645 
1646 void tree_node_factory::operator()(const omp_sections_pragma* obj, unsigned int& mask)
1647 {
1648  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1649  tree_node_mask::operator()(obj, mask);
1651 }
1652 
1653 void tree_node_factory::operator()(const omp_parallel_sections_pragma* obj, unsigned int& mask)
1654 {
1655  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1656  tree_node_mask::operator()(obj, mask);
1659 }
1660 
1661 void tree_node_factory::operator()(const omp_section_pragma* obj, unsigned int& mask)
1662 {
1663  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1664  tree_node_mask::operator()(obj, mask);
1665 }
1666 
1667 void tree_node_factory::operator()(const map_pragma* obj, unsigned int& mask)
1668 {
1669  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1670  tree_node_mask::operator()(obj, mask);
1671 }
1672 
1673 void tree_node_factory::operator()(const call_hw_pragma* obj, unsigned int& mask)
1674 {
1675  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1676  tree_node_mask::operator()(obj, mask);
1679  SET_VALUE_OPT(TOK_ID_IMPLEMENTATION, ID_implementation, call_hw_pragma);
1680 }
1681 
1682 void tree_node_factory::operator()(const call_point_hw_pragma* obj, unsigned int& mask)
1683 {
1684  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1685  tree_node_mask::operator()(obj, mask);
1687  SET_VALUE_OPT(TOK_ID_IMPLEMENTATION, ID_implementation, call_hw_pragma);
1689 }
1690 
1691 void tree_node_factory::operator()(const issue_pragma* obj, unsigned int& mask)
1692 {
1693  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1694  tree_node_mask::operator()(obj, mask);
1695 }
1696 
1697 void tree_node_factory::operator()(const blackbox_pragma* obj, unsigned int& mask)
1698 {
1699  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1700  tree_node_mask::operator()(obj, mask);
1701 }
1702 
1703 void tree_node_factory::operator()(const profiling_pragma* obj, unsigned int& mask)
1704 {
1705  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1706  tree_node_mask::operator()(obj, mask);
1707 }
1708 
1709 void tree_node_factory::operator()(const statistical_profiling* obj, unsigned int& mask)
1710 {
1711  THROW_ASSERT(obj == curr_tree_node_ptr, "wrong factory setup");
1712  tree_node_mask::operator()(obj, mask);
1713 }
struct definition of the type_decl tree node.
Definition: tree_node.hpp:5470
This struct specifies the integer_cst node.
Definition: tree_node.hpp:3242
#define CREATE_TREE_NODE_CASE_BODY(tree_node_name, node_id)
parser/compiler include
struct definition of the const_decl tree node.
Definition: tree_node.hpp:2386
This struct implements the target_expr node.
Definition: tree_node.hpp:4815
() label_decl()() modop_expr() new_expr() placeholder_expr()() boolean_type() CharType() nullptr_type() lang_type() offset_type() qual_union_type() set_type() template_type_parm() typename_type(void_type)) void tree_node
Definition: tree_node.cpp:168
This struct specifies the field bloc (basic block).
() label_decl()() modop_expr() new_expr() placeholder_expr() template_id_expr(vec_new_expr)) BOOST_PP_SEQ_FOR_EACH(VISIT_TREE_NODE_MACRO
struct definition of the vector_type tree node.
Definition: tree_node.hpp:5938
#define ATTR_SEQ
struct definition of the array_type tree node.
Definition: tree_node.hpp:1520
struct definition of the real_type tree node.
Definition: tree_node.hpp:4039
Any erroneous construct is parsed into a node of this type.
Definition: tree_node.hpp:1462
char base
This version is stamped on May 10, 2016.
Definition: nussinov.c:24
const std::map< TreeVocabularyTokenTypes_TokenEnum, std::string > & tree_node_schema
tree_node_schema expresses the value of the fields of the tree node we would like to create...
This struct specifies the statement_list node.
Definition: tree_node.hpp:4662
A HANDLER wraps a catch handler for the HANDLER_TYPE.
Definition: tree_node.hpp:3141
struct definition of the source position.
Definition: tree_node.hpp:832
Represents an argument pack of types (or templates).
Definition: tree_node.hpp:5139
struct definition of the function_decl tree node.
Definition: tree_node.hpp:2759
struct definition of the method_type tree node.
Definition: tree_node.hpp:3452
tree node factory.
This struct specifies the gimple_label node.
Definition: tree_node.hpp:3343
This struct specifies the string_cst node.
Definition: tree_node.hpp:4724
void AddTreeNode(const unsigned int i, const tree_nodeRef &curr)
Add to the tree manager the current node.
struct definition of the union_type tree node.
Definition: tree_node.hpp:5540
A simple interface to token object of the raw files.
struct definition of the unary node structures.
Definition: tree_node.hpp:1177
struct definition of the record_type tree node.
Definition: tree_node.hpp:4078
GIMPLE_BIND <VARS, BLOCK, BODY> represents a lexical scope.
Definition: tree_node.hpp:1664
struct definition of the ternary node structures.
Definition: tree_node.hpp:1239
#define SET_VALUE_OPT(token, field, type)
#define min(x, y)
This struct specifies the gimple_cond node.
Definition: tree_node.hpp:2345
struct definition of the function_type tree node.
Definition: tree_node.hpp:2960
struct definition of the parm_decl tree node.
Definition: tree_node.hpp:3660
Data structure describing a basic block at tree level.
This class is used to perform the re-index of all tree nodes.
AGGR_INIT_EXPRs have a variably-sized representation similar to that of CALL_EXPRs.
Definition: tree_node.hpp:1919
Constructor: return an aggregate value made from specified components.
Definition: tree_node.hpp:2434
This struct specifies the binfo node.
Definition: tree_node.hpp:1713
struct definition of the template_decl tree node.
Definition: tree_node.hpp:4993
This struct represents a try-block statement.
Definition: tree_node.hpp:5409
#define TOK(token)
Macro used to convert a token symbol into a treeVocabularyTokenTypes.
Abstract pure class for the tree structure.
Definition: tree_node.hpp:139
struct definition of the label_decl tree node.
Definition: tree_node.hpp:3529
#define STR(s)
Macro which performs a lexical_cast to a string.
void line(int x1, int y1, int x2, int y2, unsigned int color)
Definition: main.c:110
struct definition of the label_decl tree node.
Definition: tree_node.hpp:5659
#define max
Definition: backprop.h:17
Directive represinting mapping of a software function on a component.
struct definition of the result_decl tree node.
Definition: tree_node.hpp:4266
This struct specifies the vector_cst node.
Definition: tree_node.hpp:5888
tree_manager & TM
tree manager
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Definition: exceptions.hpp:292
virtual std::string get_kind_text() const =0
Virtual function returning the name of the actual class.
This struct specifies the gimple_phi node.
Definition: tree_node.hpp:3742
() label_decl() using_decl(translation_unit_decl)) BOOST_PP_SEQ_FOR_EACH(VISIT_TREE_NODE_MACRO
This struct represents a list-like node for chaining overloading candidates.
Definition: tree_node.hpp:3621
struct definition of the Quaternary node structures.
Definition: tree_node.hpp:1276
This struct specifies the gimple_assign node (GCC 4.3 tree node).
Definition: tree_node.hpp:3015
#define SET_NODE_ID(token, field, type)
This struct specifies super class for constant nodes.
Definition: tree_node.hpp:1431
Directive represinting mapping of a function call on a component.
Low-level memory addressing.
Definition: tree_node.hpp:4938
This struct specifies the gimple_return node.
Definition: tree_node.hpp:4354
kind
tree_nodeRef GetTreeReindex(const unsigned int i)
Return a tree_reindex wrapping the i-th tree_node.
Represents an expression that will be expanded into a list of expressions when instantiated with one ...
Definition: tree_node.hpp:2186
struct definition of the function_decl tree node.
Definition: tree_node.hpp:3179
unsigned offset[NUM_VERTICES+1]
Definition: graph.h:3
struct definition of the field_decl tree node.
Definition: tree_node.hpp:2640
struct definition of the complex_type tree node.
Definition: tree_node.hpp:2282
Classes specification of the tree_node data structures.
GIMPLE_SWITCH <INDEX, DEFAULT_LAB, LAB1, ..., LABN> represents the multiway branch: ...
Definition: tree_node.hpp:4773
struct definition of the field attr on function_decl, field_decl, var_decl tree node.
Definition: tree_node.hpp:774
This file collects some utility functions and macros.
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
Definition: exceptions.hpp:263
struct definition of the pointer_type tree node.
Definition: tree_node.hpp:3896
BOOST_PP_SEQ_FOR_EACH(OPERATOR_MACRO, BOOST_PP_EMPTY, VISITED_OBJ_SEQ1)
virtual template object functor
This struct specifies the block node.
Definition: tree_node.hpp:1820
struct definition of common part of WeightedNode (gimple_assign, expr_node)
Definition: tree_node.hpp:738
struct definition of the reference_type tree node.
Definition: tree_node.hpp:4220
This struct specifies the cast_expr node.
Definition: tree_node.hpp:2057
void init(int bucket[BUCKETSIZE])
Definition: sort.c:42
struct definition of the common part of an expression
Definition: tree_node.hpp:973
This struct specifies the lut_expr node.
Definition: tree_node.hpp:6042
This struct specifies the complex_cst node.
Definition: tree_node.hpp:2237
struct definition of the type node structures.
Definition: tree_node.hpp:1318
This struct specifies the tree_list node.
Definition: tree_node.hpp:5255
tree_node * curr_tree_node_ptr
current tree node filled according to the tree_node_schema
Class specification of the tree_reindex support class.
This struct represent a statement expression.
Definition: tree_node.hpp:2592
This struct specifies the call_expr node.
Definition: tree_node.hpp:1873
void create_tree_node(const unsigned int node_id, enum kind)
tree_node visitors
#define SET_NODE_ID_OPT(token, field, type)
This struct specifies reference to particular overloaded struct method The tree walker structure of t...
Definition: tree_node.hpp:4463
struct definition of the common part of a gimple with virtual operands
Definition: tree_node.hpp:1078
This struct represent a &#39;return&#39; statement.
Definition: tree_node.hpp:4387
This struct specifies a multi-way-if construct.
This struct specifies the real_cst node.
Definition: tree_node.hpp:3990
char str[25]
Definition: fixedptc.c:8
#define SET_VALUE(token, field, type)
int level
Definition: main.c:98
This struct specifies the case_label_expr node.
Definition: tree_node.hpp:2011
Classes specification of the tree_node data structures not present in the gcc.
Low-level memory addressing.
Definition: tree_node.hpp:4865
#define TREE_NOT_YET_IMPLEMENTED(token)
refcount< tree_node > tree_nodeRef
RefCount type definition of the tree_node class structure.
Definition: tree_node.hpp:212
This struct specifies the ssa_name node.
Definition: tree_node.hpp:4523
This struct specifies the gimple_goto node.
Definition: tree_node.hpp:3089
This struct specifies the for expression Used to represent a for construct.
struct definition of the integer_type tree node.
Definition: tree_node.hpp:2513
struct definition of the integer_type tree node.
Definition: tree_node.hpp:3279
struct definition of the binary node structures.
Definition: tree_node.hpp:1206
This struct specifies the tree_vec node.
Definition: tree_node.hpp:5299
This struct specifies the gimple_asm node.
Definition: tree_node.hpp:1574
This struct specifies the gimple_call node.
Definition: tree_node.hpp:1959
struct definition of the declaration node structures.
Definition: tree_node.hpp:877
Class specification of the manager of the tree structures extracted from the raw file.
This struct specifies the while expression Used to represent a while construct.
#define ATTR_MACRO(r, data, elem)
Memory tags used in tree-ssa to represent memory locations in virtual SSA.
Definition: tree_node.hpp:1393
Represents a type expression that will be expanded into a list of types when instantiated with one or...
Definition: tree_node.hpp:2141
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...
Definition: exceptions.hpp:289

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