PandA-2024.02
gimple_writer.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 "gimple_writer.hpp"
46 
47 #include "custom_map.hpp" // for unordered_map<>:...
48 #include <algorithm> // for transform
49 #include <boost/algorithm/string/replace.hpp> // for replace_all
50 #include <cctype> // for toupper
51 #include <cstddef> // for size_t
52 #include <string> // for string, operator+
53 #include <utility> // for pair, operator!=
54 #include <vector> // for vector, vector<>...
55 
57 #include "basic_block.hpp"
58 
60 #include "token_interface.hpp"
61 
63 #include "ext_tree_node.hpp"
64 #include "string_manipulation.hpp"
65 #include "tree_basic_block.hpp"
66 #include "tree_helper.hpp"
67 #include "tree_node.hpp"
68 #include "tree_reindex.hpp"
69 
70 GimpleWriter::GimpleWriter(std::ostream& _os, const bool _use_uid) : os(_os), use_uid(_use_uid), current_node_index(0)
71 {
72 }
73 
74 void GimpleWriter::operator()(const tree_node*, unsigned int&)
75 {
76 }
77 
78 void GimpleWriter::operator()(const WeightedNode* obj, unsigned int& mask)
79 {
80  mask = NO_VISIT;
81  obj->tree_node::visit(this);
82 }
83 
84 void GimpleWriter::operator()(const tree_reindex* obj, unsigned int&)
85 {
87  // obj->actual_tree_node->visit(this);
88 }
89 
90 void GimpleWriter::operator()(const attr*, unsigned int& mask)
91 {
92  mask = NO_VISIT;
93 }
94 
95 void GimpleWriter::operator()(const srcp*, unsigned int& mask)
96 {
97  mask = NO_VISIT;
98 }
99 
100 void GimpleWriter::operator()(const decl_node* obj, unsigned int& mask)
101 {
102  mask = NO_VISIT;
103  obj->tree_node::visit(this);
104  obj->srcp::visit(this);
105 }
106 
107 void GimpleWriter::operator()(const expr_node* obj, unsigned int& mask)
108 {
109  mask = NO_VISIT;
110  obj->WeightedNode::visit(this);
111  obj->srcp::visit(this);
112 }
113 
114 void GimpleWriter::operator()(const gimple_node* obj, unsigned int& mask)
115 {
116  mask = NO_VISIT;
117  obj->WeightedNode::visit(this);
118  obj->srcp::visit(this);
119 }
120 
121 void GimpleWriter::operator()(const unary_expr* obj, unsigned int& mask)
122 {
123  mask = NO_VISIT;
124  switch(obj->get_kind())
125  {
126  case abs_expr_K:
127  {
128  os << "ABS_EXPR <";
129  obj->op->visit(this);
130  os << ">";
131  break;
132  }
133  case addr_expr_K:
134  {
135  os << "&";
136  break;
137  }
138  case fix_trunc_expr_K:
139  case float_expr_K:
140  case nop_expr_K:
141  case convert_expr_K:
142  {
143  os << "(";
144  obj->type->visit(this);
145  os << ") ";
146  break;
147  }
148  case view_convert_expr_K:
149  {
150  os << "VIEW_CONVERT_EXPR<";
151  obj->type->visit(this);
152  os << ">(";
153  obj->op->visit(this);
154  os << ")";
155  obj->expr_node::visit(this);
156  return;
157  }
158  case imagpart_expr_K:
159  {
160  os << "IMAG_EXPR<";
161  obj->op->visit(this);
162  os << ">";
163  break;
164  }
165  case realpart_expr_K:
166  {
167  os << "REAL_EXPR<";
168  obj->op->visit(this);
169  os << ">";
170  break;
171  }
172  case alignof_expr_K:
173  case arrow_expr_K:
174  case bit_not_expr_K:
175  case buffer_ref_K:
176  case card_expr_K:
177  case cleanup_point_expr_K:
178  case conj_expr_K:
179  case exit_expr_K:
180  case fix_ceil_expr_K:
181  case fix_floor_expr_K:
182  case fix_round_expr_K:
183  case indirect_ref_K:
184  case misaligned_indirect_ref_K:
185  case loop_expr_K:
186  case negate_expr_K:
187  case non_lvalue_expr_K:
188  case paren_expr_K:
189  case reference_expr_K:
190  case reinterpret_cast_expr_K:
191  case sizeof_expr_K:
192  case static_cast_expr_K:
193  case throw_expr_K:
194  case truth_not_expr_K:
195  case unsave_expr_K:
196  case va_arg_expr_K:
197  case reduc_max_expr_K:
198  case reduc_min_expr_K:
199  case reduc_plus_expr_K:
200  case vec_unpack_hi_expr_K:
201  case vec_unpack_lo_expr_K:
202  case vec_unpack_float_hi_expr_K:
203  case vec_unpack_float_lo_expr_K:
204  {
205  std::string str = obj->get_kind_text();
206  std::transform(str.begin(), str.end(), str.begin(), ::toupper);
207  os << "<" << str;
208  obj->op->visit(this);
209  os << ">";
210  break;
211  }
212  case binfo_K:
213  case block_K:
214  case call_expr_K:
215  case aggr_init_expr_K:
216  case case_label_expr_K:
217  case constructor_K:
218  case identifier_node_K:
219  case ssa_name_K:
220  case statement_list_K:
221  case target_expr_K:
222  case target_mem_ref_K:
223  case target_mem_ref461_K:
224  case tree_list_K:
225  case tree_vec_K:
226  case error_mark_K:
227  case lut_expr_K:
229  case CASE_CPP_NODES:
230  case CASE_CST_NODES:
231  case CASE_DECL_NODES:
232  case CASE_FAKE_NODES:
233  case CASE_GIMPLE_NODES:
234  case CASE_PRAGMA_NODES:
237  case CASE_TYPE_NODES:
238  default:
239  THROW_UNREACHABLE("");
240  }
241  if(GET_NODE(obj->op)->get_kind() == function_decl_K)
242  {
243  GetPointer<function_decl>(GET_NODE(obj->op))->name->visit(this);
244  }
245  else
246  {
247  obj->op->visit(this);
248  }
249  obj->expr_node::visit(this);
250 }
251 
252 void GimpleWriter::operator()(const binary_expr* obj, unsigned int& mask)
253 {
254  mask = NO_VISIT;
255  switch(obj->get_kind())
256  {
257  case max_expr_K:
258  {
259  os << "MAX_EXPR <";
260  obj->op0->visit(this);
261  os << ", ";
262  obj->op1->visit(this);
263  os << ">";
264  break;
265  }
266  case min_expr_K:
267  {
268  os << "MIN_EXPR <";
269  obj->op0->visit(this);
270  os << ", ";
271  obj->op1->visit(this);
272  os << ">";
273  break;
274  }
275  case complex_expr_K:
276  {
277  os << "COMPLEX_EXPR <";
278  obj->op0->visit(this);
279  os << ", ";
280  obj->op1->visit(this);
281  os << ">";
282  break;
283  }
284  case mem_ref_K:
285  {
286  if(GET_NODE(obj->op1)->get_kind() == integer_cst_K)
287  {
288  const auto offset = tree_helper::GetConstValue(obj->op1);
289  if(offset == 0)
290  {
291  os << "*";
292  obj->op0->visit(this);
293  }
294  else
295  {
296  os << "MEM[(";
297  GET_CONST_NODE(tree_helper::CGetType(obj->op1))->visit(this);
298  os << ")";
299  obj->op0->visit(this);
300  os << ") + ";
301  obj->op1->visit(this);
302  os << "]";
303  }
304  }
305  break;
306  }
307  case uneq_expr_K:
308  {
309  obj->op0->visit(this);
310  os << " u== ";
311  obj->op1->visit(this);
312  break;
313  }
314  case lrotate_expr_K:
315  case rrotate_expr_K:
316  case vec_pack_trunc_expr_K:
317  {
318  std::string str = obj->get_kind_text();
319  std::transform(str.begin(), str.end(), str.begin(), ::toupper);
320  os << "<" << str;
321  obj->op0->visit(this);
322  os << " , ";
323  obj->op1->visit(this);
324  os << ">";
325  break;
326  }
327  case assert_expr_K:
328  case bit_and_expr_K:
329  case bit_ior_expr_K:
330  case bit_xor_expr_K:
331  case catch_expr_K:
332  case ceil_div_expr_K:
333  case ceil_mod_expr_K:
334  case compound_expr_K:
335  case eh_filter_expr_K:
336  case eq_expr_K:
337  case exact_div_expr_K:
338  case fdesc_expr_K:
339  case floor_div_expr_K:
340  case floor_mod_expr_K:
341  case ge_expr_K:
342  case gt_expr_K:
343  case goto_subroutine_K:
344  case in_expr_K:
345  case init_expr_K:
346  case le_expr_K:
347  case lshift_expr_K:
348  case lt_expr_K:
349  case minus_expr_K:
350  case modify_expr_K:
351  case mult_expr_K:
352  case mult_highpart_expr_K:
353  case ne_expr_K:
354  case plus_expr_K:
355  case pointer_plus_expr_K:
356  case postdecrement_expr_K:
357  case postincrement_expr_K:
358  case predecrement_expr_K:
359  case preincrement_expr_K:
360  case range_expr_K:
361  case rdiv_expr_K:
362  case round_div_expr_K:
363  case round_mod_expr_K:
364  case rshift_expr_K:
365  case set_le_expr_K:
366  case trunc_div_expr_K:
367  case trunc_mod_expr_K:
368  case truth_and_expr_K:
369  case truth_andif_expr_K:
370  case truth_or_expr_K:
371  case truth_orif_expr_K:
372  case truth_xor_expr_K:
373  case try_catch_expr_K:
374  case try_finally_K:
375  case unge_expr_K:
376  case ungt_expr_K:
377  case unle_expr_K:
378  case unlt_expr_K:
379  case widen_sum_expr_K:
380  case widen_mult_expr_K:
381  case with_size_expr_K:
382  case vec_lshift_expr_K:
383  case vec_rshift_expr_K:
384  case widen_mult_hi_expr_K:
385  case widen_mult_lo_expr_K:
386  case vec_pack_sat_expr_K:
387  case vec_pack_fix_trunc_expr_K:
388  case vec_extracteven_expr_K:
389  case vec_extractodd_expr_K:
390  case vec_interleavehigh_expr_K:
391  case vec_interleavelow_expr_K:
392  {
393  obj->op0->visit(this);
394  const std::string op = tree_helper::op_symbol(obj);
395  os << " " << op << " ";
396  obj->op1->visit(this);
397  break;
398  }
399  case sat_plus_expr_K:
400  {
401  obj->op0->visit(this);
402  os << " satplus ";
403  obj->op1->visit(this);
404  break;
405  }
406  case sat_minus_expr_K:
407  {
408  obj->op0->visit(this);
409  os << " satminus ";
410  obj->op1->visit(this);
411  break;
412  }
413  case frem_expr_K:
414  {
415  obj->op0->visit(this);
416  os << " frem ";
417  obj->op1->visit(this);
418  break;
419  }
420  case extract_bit_expr_K:
421  {
422  obj->op0->visit(this);
423  const std::string op = "EXTRACT_BIT_EXPR";
424  os << " " << op << " ";
425  obj->op1->visit(this);
426  break;
427  }
428  case extractvalue_expr_K:
429  {
430  obj->op0->visit(this);
431  const std::string op = "EXTRACTVALUE_EXPR";
432  os << " " << op << " ";
433  obj->op1->visit(this);
434  break;
435  }
436  case extractelement_expr_K:
437  {
438  obj->op0->visit(this);
439  const std::string op = "EXTRACTELEMENT_EXPR";
440  os << " " << op << " ";
441  obj->op1->visit(this);
442  break;
443  }
444  case ltgt_expr_K:
445  {
446  obj->op0->visit(this);
447  os << " <!=> ";
448  obj->op1->visit(this);
449  break;
450  }
451  case unordered_expr_K:
452  {
453  os << "UNORDERED_EXPR<";
454  obj->op0->visit(this);
455  os << ", ";
456  obj->op1->visit(this);
457  os << ">";
458  break;
459  }
460  case ordered_expr_K:
461  {
462  os << "ORDERED_EXPR<";
463  obj->op0->visit(this);
464  os << ", ";
465  obj->op1->visit(this);
466  os << ">";
467  break;
468  }
469  case binfo_K:
470  case block_K:
471  case call_expr_K:
472  case aggr_init_expr_K:
473  case case_label_expr_K:
474  case constructor_K:
475  case identifier_node_K:
476  case lut_expr_K:
477  {
478  os << "LUT<";
479  const auto* obj2 = dynamic_cast<const lut_expr*>(obj);
480  obj2->op0->visit(this);
481  os << ", ";
482  obj2->op1->visit(this);
483  os << ">";
484  break;
485  }
486  case ssa_name_K:
487  case statement_list_K:
488  case target_expr_K:
489  case target_mem_ref_K:
490  case target_mem_ref461_K:
491  case tree_list_K:
492  case tree_vec_K:
493  case error_mark_K:
494  case CASE_CPP_NODES:
495  case CASE_CST_NODES:
496  case CASE_DECL_NODES:
497  case CASE_FAKE_NODES:
498  case CASE_GIMPLE_NODES:
499  case CASE_PRAGMA_NODES:
502  case CASE_TYPE_NODES:
504  default:
505  THROW_UNREACHABLE("");
506  }
507  obj->expr_node::visit(this);
508 }
509 
510 void GimpleWriter::operator()(const ternary_expr* obj, unsigned int& mask)
511 {
512  mask = NO_VISIT;
513  switch(obj->get_kind())
514  {
515  case bit_field_ref_K:
516  {
517  os << "BIT_FIELD_REF <";
518  obj->op0->visit(this);
519  os << ", ";
520  obj->op1->visit(this);
521  os << ", ";
522  obj->op2->visit(this);
523  os << ">";
524  break;
525  }
526  case component_ref_K:
527  {
528  const indirect_ref* ir = GetPointer<indirect_ref>(GET_NODE(obj->op0));
529  if(ir)
530  {
531  ir->op->visit(this);
532  os << "->";
533  obj->op1->visit(this);
534  }
535  else
536  {
537  obj->op0->visit(this);
538  os << ".";
539  obj->op1->visit(this);
540  }
541  break;
542  }
543  case cond_expr_K:
544  case vec_cond_expr_K:
545  {
546  obj->op0->visit(this);
547  os << " ? ";
548  obj->op1->visit(this);
549  os << " : ";
550  obj->op2->visit(this);
551  break;
552  }
553  case ternary_plus_expr_K:
554  {
555  obj->op0->visit(this);
556  os << " + ";
557  obj->op1->visit(this);
558  os << " + ";
559  obj->op2->visit(this);
560  break;
561  }
562  case ternary_pm_expr_K:
563  {
564  obj->op0->visit(this);
565  os << " + ";
566  obj->op1->visit(this);
567  os << " - ";
568  obj->op2->visit(this);
569  break;
570  }
571  case ternary_mp_expr_K:
572  {
573  obj->op0->visit(this);
574  os << " - ";
575  obj->op1->visit(this);
576  os << " + ";
577  obj->op2->visit(this);
578  break;
579  }
580  case ternary_mm_expr_K:
581  {
582  obj->op0->visit(this);
583  os << " - ";
584  obj->op1->visit(this);
585  os << " - ";
586  obj->op2->visit(this);
587  break;
588  }
589  case fshl_expr_K:
590  {
591  os << "(";
592  obj->op0->visit(this);
593  os << " << (";
594  obj->op2->visit(this);
595  os << "%BW)) | (";
596  obj->op1->visit(this);
597  os << " >> (BW - (";
598  obj->op2->visit(this);
599  os << " % BW)))";
600  break;
601  }
602  case fshr_expr_K:
603  {
604  os << "(";
605  obj->op0->visit(this);
606  os << " << (BW - (";
607  obj->op2->visit(this);
608  os << " % BW))) | (";
609  obj->op1->visit(this);
610  os << " << (";
611  obj->op2->visit(this);
612  os << "))";
613  break;
614  }
615  case bit_ior_concat_expr_K:
616  {
617  obj->op0->visit(this);
618  os << " | ";
619  obj->op1->visit(this);
620  os << " ( ";
621  obj->op2->visit(this);
622  os << " ) ";
623  break;
624  }
625  case insertvalue_expr_K:
626  {
627  obj->op0->visit(this);
628  os << " INSERTVALUE_EXPR ";
629  obj->op1->visit(this);
630  os << " ( ";
631  obj->op2->visit(this);
632  os << " ) ";
633  break;
634  }
635  case insertelement_expr_K:
636  {
637  obj->op0->visit(this);
638  os << " INSERTELEMENT_EXPR ";
639  obj->op1->visit(this);
640  os << " ( ";
641  obj->op2->visit(this);
642  os << " ) ";
643  break;
644  }
645  case binfo_K:
646  case block_K:
647  case call_expr_K:
648  case aggr_init_expr_K:
649  case case_label_expr_K:
650  case constructor_K:
651  case dot_prod_expr_K:
652  case identifier_node_K:
653  case obj_type_ref_K:
654  case save_expr_K:
655  case ssa_name_K:
656  case statement_list_K:
657  case target_expr_K:
658  case target_mem_ref_K:
659  case target_mem_ref461_K:
660  case tree_list_K:
661  case tree_vec_K:
662  case vec_perm_expr_K:
663  case vtable_ref_K:
664  case with_cleanup_expr_K:
665  case error_mark_K:
666  case lut_expr_K:
668  case CASE_CPP_NODES:
669  case CASE_CST_NODES:
670  case CASE_DECL_NODES:
671  case CASE_FAKE_NODES:
672  case CASE_GIMPLE_NODES:
673  case CASE_PRAGMA_NODES:
675  case CASE_TYPE_NODES:
677  default:
678  {
679  break;
680  }
681  }
682  obj->expr_node::visit(this);
683 }
684 
685 void GimpleWriter::operator()(const quaternary_expr* obj, unsigned int& mask)
686 {
687  mask = NO_VISIT;
688  if(obj->get_kind() == array_ref_K)
689  {
690  obj->op0->visit(this);
691  os << "[";
692  obj->op1->visit(this);
693  os << "]";
694  }
695  obj->expr_node::visit(this);
696 }
697 
698 void GimpleWriter::operator()(const type_node* obj, unsigned int& mask)
699 {
700  mask = NO_VISIT;
702  {
703  std::string replace = tree_helper::return_C_qualifiers(obj->qual, true);
704  boost::replace_all(replace, "__restrict__ ", " restrict");
705  os << replace << " ";
706  }
707  if(obj->name)
708  {
709  obj->name->visit(this);
710  }
711  else
712  {
713  // try to get the type name
714  auto obj_type = obj->get_kind();
715  if(obj_type == integer_type_K)
716  {
717  auto* it = static_cast<const integer_type*>(obj);
718  if(it->unsigned_flag)
719  {
720  os << "unsigned ";
721  }
722  if(it->prec != obj->algn)
723  {
724  if(it->prec > 64)
725  {
726  os << "int __attribute__((vector_size(16)))";
727  }
728  else if(it->prec > 32)
729  {
730  os << "long long int";
731  }
732  else if(it->prec > 16)
733  {
734  os << "int";
735  }
736  else if(it->prec > 8)
737  {
738  os << "short";
739  }
740  else
741  {
742  os << "char";
743  }
744  }
745  else if(obj->algn == 1)
746  {
747  os << "_Bool";
748  }
749  else if(obj->algn == 8)
750  {
751  os << "char";
752  }
753  else if(obj->algn == 16)
754  {
755  os << "short";
756  }
757  else if(obj->algn == 32)
758  {
759  os << "int";
760  }
761  else if(obj->algn == 64)
762  {
763  os << "long long";
764  }
765  else if(obj->algn == 128)
766  {
767  os << "int __attribute__((vector_size(16)))";
768  }
769  else
770  {
771  os << "_BitInt(" << obj->algn << ")";
772  }
773  }
774  else if(obj_type == boolean_type_K)
775  {
776  os << "_Bool";
777  }
778  else if(obj_type == real_type_K)
779  {
780  auto* rt = static_cast<const real_type*>(obj);
781  if(rt->prec == 32)
782  {
783  os << "float";
784  }
785  else if(rt->prec == 64)
786  {
787  os << "double";
788  }
789  else if(rt->prec == 80)
790  {
791  os << "__float80";
792  }
793  else if(rt->prec == 128)
794  {
795  os << "__float128";
796  }
797  else
798  {
799  THROW_ERROR(std::string("Real type not yet supported "));
800  }
801  }
802  }
803  obj->tree_node::visit(this);
804 }
805 
806 void GimpleWriter::operator()(const memory_tag* obj, unsigned int& mask)
807 {
808  mask = NO_VISIT;
809  obj->decl_node::visit(this);
810 }
811 
812 void GimpleWriter::operator()(const cst_node* obj, unsigned int& mask)
813 {
814  mask = NO_VISIT;
815  obj->type->visit(this);
816  obj->tree_node::visit(this);
817 }
818 
819 void GimpleWriter::operator()(const error_mark* obj, unsigned int& mask)
820 {
821  mask = NO_VISIT;
822  os << "error_mark";
823  obj->tree_node::visit(this);
824 }
825 
826 void GimpleWriter::operator()(const array_type* obj, unsigned int& mask)
827 {
828  obj->elts->visit(this);
829  os << "[";
831  tree_nodeRef array_length = GET_NODE(obj->size);
832  tree_nodeRef array_element = GET_NODE(obj->elts);
833  if(array_length->get_kind() == integer_cst_K)
834  {
835  const auto tn = GetPointer<type_node>(array_element);
837  }
838 
839  os << "]";
840  mask = NO_VISIT;
841  obj->type_node::visit(this);
842 }
843 
844 void GimpleWriter::operator()(const gimple_asm* obj, unsigned int& mask)
845 {
846  mask = NO_VISIT;
847  obj->gimple_node::visit(this);
848 }
849 
850 void GimpleWriter::operator()(const baselink* obj, unsigned int& mask)
851 {
852  mask = NO_VISIT;
853  obj->tree_node::visit(this);
854 }
855 
856 void GimpleWriter::operator()(const gimple_bind* obj, unsigned int& mask)
857 {
858  mask = NO_VISIT;
859  obj->expr_node::visit(this);
860 }
861 
862 void GimpleWriter::operator()(const binfo* obj, unsigned int& mask)
863 {
864  mask = NO_VISIT;
865  obj->tree_node::visit(this);
866 }
867 
868 void GimpleWriter::operator()(const block* obj, unsigned int& mask)
869 {
870  mask = NO_VISIT;
871  obj->tree_node::visit(this);
872 }
873 
874 void GimpleWriter::operator()(const call_expr* obj, unsigned int& mask)
875 {
876  mask = NO_VISIT;
877  const addr_expr* ae = GetPointer<addr_expr>(GET_NODE(obj->fn));
878  if(ae)
879  {
880  const function_decl* fd = GetPointer<function_decl>(GET_NODE(ae->op));
881  if(fd)
882  {
883  fd->name->visit(this);
884  os << " (";
885  const std::vector<tree_nodeRef>& args = obj->args;
886  std::vector<tree_nodeRef>::const_iterator arg, arg_end = args.end();
887  for(arg = args.begin(); arg != arg_end; ++arg)
888  {
889  if(arg != args.begin())
890  {
891  os << ", ";
892  }
893  (*arg)->visit(this);
894  }
895  os << ")";
896  }
897  }
898  else
899  {
900  const ssa_name* sn = GetPointer<ssa_name>(GET_NODE(obj->fn));
901  if(sn)
902  {
903  sn->visit(this);
904  os << " (";
905  const std::vector<tree_nodeRef>& args = obj->args;
906  std::vector<tree_nodeRef>::const_iterator arg, arg_end = args.end();
907  for(arg = args.begin(); arg != arg_end; ++arg)
908  {
909  if(arg != args.begin())
910  {
911  os << ", ";
912  }
913  (*arg)->visit(this);
914  }
915  os << ")";
916  }
917  }
918 }
919 
920 void GimpleWriter::operator()(const aggr_init_expr* obj, unsigned int& mask)
921 {
922  mask = NO_VISIT;
923  const addr_expr* ae = GetPointer<addr_expr>(GET_NODE(obj->fn));
924  if(ae)
925  {
926  const function_decl* fd = GetPointer<function_decl>(GET_NODE(ae->op));
927  if(fd)
928  {
929  fd->name->visit(this);
930  os << " (";
931  const std::vector<tree_nodeRef>& args = obj->args;
932  std::vector<tree_nodeRef>::const_iterator arg, arg_end = args.end();
933  for(arg = args.begin(); arg != arg_end; ++arg)
934  {
935  if(arg != args.begin())
936  {
937  os << ", ";
938  }
939  (*arg)->visit(this);
940  }
941  os << ")";
942  }
943  }
944  else
945  {
946  const ssa_name* sn = GetPointer<ssa_name>(GET_NODE(obj->fn));
947  if(sn)
948  {
949  sn->visit(this);
950  os << " (";
951  const std::vector<tree_nodeRef>& args = obj->args;
952  std::vector<tree_nodeRef>::const_iterator arg, arg_end = args.end();
953  for(arg = args.begin(); arg != arg_end; ++arg)
954  {
955  if(arg != args.begin())
956  {
957  os << ", ";
958  }
959  (*arg)->visit(this);
960  }
961  os << ")";
962  }
963  }
964  os << "ctor: " << obj->ctor;
965  if(obj->slot)
966  {
967  obj->slot->visit(this);
968  }
969 }
970 
971 void GimpleWriter::operator()(const gimple_call* obj, unsigned int& mask)
972 {
973  obj->gimple_node::visit(this);
974  mask = NO_VISIT;
975  const addr_expr* ae = GetPointer<addr_expr>(GET_NODE(obj->fn));
976  if(ae)
977  {
978  const function_decl* fd = GetPointer<function_decl>(GET_NODE(ae->op));
979  if(fd)
980  {
981  fd->name->visit(this);
982  os << " (";
983  const std::vector<tree_nodeRef>& args = obj->args;
984  std::vector<tree_nodeRef>::const_iterator arg, arg_end = args.end();
985  for(arg = args.begin(); arg != arg_end; ++arg)
986  {
987  if(arg != args.begin())
988  {
989  os << ", ";
990  }
991  (*arg)->visit(this);
992  }
993  os << ")";
994  }
995  }
996 }
997 
998 void GimpleWriter::operator()(const case_label_expr* obj, unsigned int& mask)
999 {
1000  mask = NO_VISIT;
1001  if(obj->default_flag)
1002  {
1003  os << "default: ";
1004  }
1005  else
1006  {
1007  os << "case ";
1008  }
1009  if(obj->op0 and obj->op1)
1010  {
1011  obj->op0->visit(this);
1012  os << " ... ";
1013  obj->op1->visit(this);
1014  }
1015  else if(obj->op0)
1016  {
1017  obj->op0->visit(this);
1018  os << ": ";
1019  }
1020  if(obj->got)
1021  {
1022  obj->got->visit(this);
1023  }
1024  obj->expr_node::visit(this);
1025 }
1026 
1027 void GimpleWriter::operator()(const cast_expr* obj, unsigned int& mask)
1028 {
1029  mask = NO_VISIT;
1030  os << "cast_expr ";
1031  if(obj->op)
1032  {
1033  obj->op->visit(this);
1034  }
1035  obj->expr_node::visit(this);
1036 }
1037 
1038 void GimpleWriter::operator()(const complex_cst* obj, unsigned int& mask)
1039 {
1040  mask = NO_VISIT;
1041  obj->cst_node::visit(this);
1042 }
1043 
1044 void GimpleWriter::operator()(const complex_type* obj, unsigned int& mask)
1045 {
1046  mask = NO_VISIT;
1047  obj->type_node::visit(this);
1048 }
1049 
1050 void GimpleWriter::operator()(const gimple_cond* obj, unsigned int& mask)
1051 {
1052  mask = NO_VISIT;
1053  os << "if (";
1054  obj->op0->visit(this);
1055  os << ")";
1056  obj->gimple_node::visit(this);
1057 }
1058 
1059 void GimpleWriter::operator()(const const_decl* obj, unsigned int& mask)
1060 {
1061  mask = NO_VISIT;
1062  obj->decl_node::visit(this);
1063 }
1064 
1065 void GimpleWriter::operator()(const constructor* obj, unsigned int& mask)
1066 {
1067  os << "{";
1068  os << "}";
1069  mask = NO_VISIT;
1070  obj->tree_node::visit(this);
1071 }
1072 
1073 void GimpleWriter::operator()(const enumeral_type* obj, unsigned int& mask)
1074 {
1075  mask = NO_VISIT;
1076  obj->type_node::visit(this);
1077 }
1078 
1079 void GimpleWriter::operator()(const expr_stmt* obj, unsigned int& mask)
1080 {
1081  mask = NO_VISIT;
1082  obj->tree_node::visit(this);
1083 }
1084 
1085 void GimpleWriter::operator()(const field_decl* obj, unsigned int& mask)
1086 {
1087  mask = NO_VISIT;
1088  if(obj->name)
1089  {
1090  obj->name->visit(this);
1091  }
1092  obj->decl_node::visit(this);
1093  obj->attr::visit(this);
1094 }
1095 
1096 void GimpleWriter::operator()(const function_decl* obj, unsigned int& mask)
1097 {
1098  mask = NO_VISIT;
1099  os << std::endl;
1100  os << ";; Function ";
1101  const tree_nodeRef name = obj->name;
1102  name->visit(this);
1103  os << " (";
1104  name->visit(this);
1105  os << ")" << std::endl << std::endl;
1106  name->visit(this);
1107  os << " (";
1108  const std::vector<tree_nodeRef>& list_of_args = obj->list_of_args;
1109  std::vector<tree_nodeRef>::const_iterator arg, arg_end = list_of_args.end();
1110  for(arg = list_of_args.begin(); arg != arg_end; ++arg)
1111  {
1112  if(arg != list_of_args.begin())
1113  {
1114  os << ", ";
1115  }
1116  const parm_decl* pd = GetPointer<parm_decl>(GET_NODE(*arg));
1117  pd->type->visit(this);
1118  os << " ";
1119  pd->name->visit(this);
1120  }
1121 
1122  os << ")" << std::endl;
1123  if(obj->body)
1124  {
1125  os << "{" << std::endl;
1126  obj->body->visit(this);
1127  os << "}" << std::endl << std::endl << std::endl;
1128  }
1129  obj->decl_node::visit(this);
1130  obj->attr::visit(this);
1131 }
1132 
1133 void GimpleWriter::operator()(const function_type* obj, unsigned int& mask)
1134 {
1135  mask = NO_VISIT;
1136  obj->type_node::visit(this);
1137 }
1138 
1139 void GimpleWriter::operator()(const gimple_assign* obj, unsigned int& mask)
1140 {
1141  mask = NO_VISIT;
1142  if(obj->predicate)
1143  {
1144  os << "if(";
1145  obj->predicate->visit(this);
1146  os << ") ";
1147  }
1148  obj->op0->visit(this);
1149  os << " = ";
1150  obj->op1->visit(this);
1151  if(obj->clobber)
1152  {
1153  os << "clobber";
1154  }
1155  if(obj->temporary_address)
1156  {
1157  os << "addr";
1158  }
1159  obj->gimple_node::visit(this);
1160 }
1161 
1162 void GimpleWriter::operator()(const gimple_goto* obj, unsigned int& mask)
1163 {
1164  mask = NO_VISIT;
1165  obj->gimple_node::visit(this);
1166 }
1167 
1168 void GimpleWriter::operator()(const handler* obj, unsigned int& mask)
1169 {
1170  mask = NO_VISIT;
1171  obj->tree_node::visit(this);
1172 }
1173 
1174 void GimpleWriter::operator()(const identifier_node* obj, unsigned int& mask)
1175 {
1176  mask = NO_VISIT;
1177  os << obj->strg;
1178  obj->tree_node::visit(this);
1179 }
1180 
1181 void GimpleWriter::operator()(const integer_cst* obj, unsigned int& mask)
1182 {
1183  mask = NO_VISIT;
1185  obj->cst_node::visit(this);
1186 }
1187 
1188 void GimpleWriter::operator()(const integer_type* obj, unsigned int& mask)
1189 {
1190  mask = NO_VISIT;
1191  obj->type_node::visit(this);
1192 }
1193 
1194 void GimpleWriter::operator()(const gimple_label* obj, unsigned int& mask)
1195 {
1196  mask = NO_VISIT;
1197  obj->op->visit(this);
1198  os << ":";
1199  obj->gimple_node::visit(this);
1200 }
1201 
1202 void GimpleWriter::operator()(const method_type* obj, unsigned int& mask)
1203 {
1204  mask = NO_VISIT;
1205  obj->function_type::visit(this);
1206 }
1207 
1208 void GimpleWriter::operator()(const namespace_decl* obj, unsigned int& mask)
1209 {
1210  mask = NO_VISIT;
1211  obj->decl_node::visit(this);
1212 }
1213 
1214 void GimpleWriter::operator()(const overload* obj, unsigned int& mask)
1215 {
1216  mask = NO_VISIT;
1217  obj->tree_node::visit(this);
1218 }
1219 
1220 void GimpleWriter::operator()(const parm_decl* obj, unsigned int& mask)
1221 {
1222  mask = NO_VISIT;
1223  obj->name->visit(this);
1224  obj->decl_node::visit(this);
1225 }
1226 
1227 void GimpleWriter::operator()(const gimple_phi* obj, unsigned int& mask)
1228 {
1229  mask = NO_VISIT;
1230  os << " # ";
1231  obj->res->visit(this);
1232  os << " = PHI <";
1233  for(const auto& def_edge : obj->CGetDefEdgesList())
1234  {
1235  if(def_edge != obj->CGetDefEdgesList().front())
1236  {
1237  os << ", ";
1238  }
1239  def_edge.first->visit(this);
1240  os << "(" << def_edge.second << ")";
1241  }
1242  os << ">";
1243  obj->tree_node::visit(this);
1244 }
1245 
1246 void GimpleWriter::operator()(const pointer_type* obj, unsigned int& mask)
1247 {
1248  mask = NO_VISIT;
1249  if(not obj->name)
1250  {
1251  obj->ptd->visit(this);
1252  os << " *";
1253  }
1254  obj->type_node::visit(this);
1255 }
1256 
1257 void GimpleWriter::operator()(const real_cst* obj, unsigned int& mask)
1258 {
1259  mask = NO_VISIT;
1260  os << obj->valr;
1261  obj->cst_node::visit(this);
1262 }
1263 
1264 void GimpleWriter::operator()(const real_type* obj, unsigned int& mask)
1265 {
1266  mask = NO_VISIT;
1267  obj->type_node::visit(this);
1268 }
1269 
1270 void GimpleWriter::operator()(const record_type* obj, unsigned int& mask)
1271 {
1272  mask = NO_VISIT;
1273  if(not obj->name or GET_CONST_NODE(obj->name)->get_kind() != type_decl_K)
1274  {
1275  os << "struct ";
1276  }
1277  obj->type_node::visit(this);
1278 }
1279 
1280 void GimpleWriter::operator()(const reference_type* obj, unsigned int& mask)
1281 {
1282  mask = NO_VISIT;
1283  obj->type_node::visit(this);
1284 }
1285 
1286 void GimpleWriter::operator()(const result_decl* obj, unsigned int& mask)
1287 {
1288  mask = NO_VISIT;
1289  os << "<retval>";
1290  obj->decl_node::visit(this);
1291 }
1292 
1293 void GimpleWriter::operator()(const gimple_return* obj, unsigned int& mask)
1294 {
1295  mask = NO_VISIT;
1296  os << "return";
1297  if(obj->op)
1298  {
1299  os << " ";
1300  obj->op->visit(this);
1301  }
1302  obj->gimple_node::visit(this);
1303 }
1304 
1305 void GimpleWriter::operator()(const return_stmt* obj, unsigned int& mask)
1306 {
1307  mask = NO_VISIT;
1308  obj->tree_node::visit(this);
1309 }
1310 
1311 void GimpleWriter::operator()(const scope_ref* obj, unsigned int& mask)
1312 {
1313  mask = NO_VISIT;
1314  obj->expr_node::visit(this);
1315 }
1316 
1317 void GimpleWriter::operator()(const ssa_name* obj, unsigned int& mask)
1318 {
1319  mask = NO_VISIT;
1320  if(obj->type)
1321  {
1322  os << "(";
1323  obj->type->visit(this);
1324  os << ") ";
1325  }
1326  os << " ";
1327  if(obj->var)
1328  {
1329  obj->var->visit(this);
1330  }
1331  os << "_" << obj->vers;
1332  if(obj->orig_vers)
1333  {
1334  os << "_[" << obj->orig_vers << "]";
1335  }
1336  if(obj->default_flag)
1337  {
1338  os << "(D)";
1339  }
1340  // if(obj->min) obj->min->visit(this);
1341  // if(obj->max) obj->max->visit(this);
1342  obj->tree_node::visit(this);
1343 }
1344 
1345 void GimpleWriter::operator()(const statement_list* obj, unsigned int& mask)
1346 {
1347  mask = NO_VISIT;
1348  for(const auto& block : obj->list_of_bloc)
1349  {
1350  if(block.first == BB_ENTRY || block.first == BB_EXIT)
1351  {
1352  continue;
1353  }
1354  if(block.second->CGetStmtList().empty() ||
1355  GET_CONST_NODE(block.second->CGetStmtList().front())->get_kind() != gimple_label_K)
1356  {
1357  os << "<bb " << block.first << ">:" << std::endl;
1358  }
1359  for(const auto& phi : block.second->CGetPhiList())
1360  {
1361  phi->visit(this);
1362  os << std::endl;
1363  }
1364  for(const auto& stmt : block.second->CGetStmtList())
1365  {
1366  const auto statement = GET_CONST_NODE(stmt);
1368  if(GetPointer<const gimple_node>(statement) && GetPointer<const gimple_node>(statement)->memuse)
1369  {
1370  os << "VUSE ";
1371  GetPointer<const gimple_node>(statement)->memuse->visit(this);
1372  }
1373  if(GetPointer<const gimple_node>(statement) && GetPointer<const gimple_node>(statement)->memdef)
1374  {
1375  os << "VDEF ";
1376  GetPointer<const gimple_node>(statement)->memdef->visit(this);
1377  }
1378  stmt->visit(this);
1379  if(statement->get_kind() != gimple_cond_K && statement->get_kind() != gimple_label_K &&
1380  statement->get_kind() != gimple_switch_K && statement->get_kind() != gimple_pragma_K)
1381  {
1382  os << ";";
1383  }
1384  os << std::endl;
1385  }
1386  if(block.second->true_edge && block.second->false_edge)
1387  {
1388  os << " goto <bb " << block.second->true_edge << ">";
1389  THROW_ASSERT(obj->list_of_bloc.count(block.second->true_edge),
1390  "Could not find BB" + STR(block.second->true_edge));
1391  const auto& next_true = obj->list_of_bloc.at(block.second->true_edge);
1392  if(next_true->CGetStmtList().size() &&
1393  GET_CONST_NODE(next_true->CGetStmtList().front())->get_kind() == gimple_label_K)
1394  {
1395  const auto le = GetPointer<const gimple_label>(GET_CONST_NODE(next_true->CGetStmtList().front()));
1396  os << " (";
1397  le->op->visit(this);
1398  os << ")";
1399  }
1400  os << ";" << std::endl;
1401  os << " else" << std::endl;
1402  os << " goto <bb " << block.second->false_edge << ">";
1403  THROW_ASSERT(obj->list_of_bloc.count(block.second->false_edge),
1404  "Could not find BB" + STR(block.second->false_edge));
1405  const auto& next_false = obj->list_of_bloc.at(block.second->false_edge);
1406  if(next_false->CGetStmtList().size() &&
1407  GET_CONST_NODE(next_false->CGetStmtList().back())->get_kind() == gimple_label_K)
1408  {
1409  const auto le = GetPointer<const gimple_label>(GET_CONST_NODE(next_false->CGetStmtList().front()));
1410  os << " (";
1411  le->op->visit(this);
1412  os << ")";
1413  }
1414  os << ";" << std::endl;
1415  }
1416  else if(block.second->list_of_succ.size() == 1)
1417  {
1418  const unsigned int succ_index = block.second->list_of_succ.front();
1419  if(succ_index != (block.second->number + 1) && succ_index != BB_EXIT)
1420  {
1421  os << " goto <bb " << succ_index << ">";
1422  THROW_ASSERT(obj->list_of_bloc.count(succ_index), "Could not find BB" + STR(succ_index));
1423  const auto& next = obj->list_of_bloc.at(succ_index);
1424  if(next->CGetStmtList().size() && GET_CONST_NODE(next->CGetStmtList().back())->get_kind() == gimple_label_K)
1425  {
1426  const auto le = GetPointer<const gimple_label>(GET_CONST_NODE(next->CGetStmtList().front()));
1427  os << " (";
1428  le->op->visit(this);
1429  os << ")";
1430  }
1431  os << ";" << std::endl;
1432  }
1433  }
1434  os << std::endl;
1435  }
1436  obj->tree_node::visit(this);
1437 }
1438 
1439 void GimpleWriter::operator()(const string_cst* obj, unsigned int& mask)
1440 {
1441  mask = NO_VISIT;
1442  os << "\"" << obj->strg << "\"";
1443  obj->cst_node::visit(this);
1444 }
1445 
1446 void GimpleWriter::operator()(const gimple_switch* obj, unsigned int& mask)
1447 {
1448  mask = NO_VISIT;
1449  os << "switch (";
1450  obj->op0->visit(this);
1451  os << ") <";
1452  obj->op1->visit(this);
1453  os << ">";
1454  obj->gimple_node::visit(this);
1455 }
1456 
1457 void GimpleWriter::operator()(const target_expr* obj, unsigned int& mask)
1458 {
1459  mask = NO_VISIT;
1460  os << "target_expr (";
1461  obj->decl->visit(this);
1462  obj->init->visit(this);
1463  obj->clnp->visit(this);
1464  obj->expr_node::visit(this);
1465  os << ")";
1466 }
1467 void GimpleWriter::operator()(const lut_expr* obj, unsigned int& mask)
1468 {
1469  mask = NO_VISIT;
1470  os << "lut_expr (";
1471  obj->op0->visit(this);
1472  obj->op1->visit(this);
1473  if(obj->op2)
1474  {
1475  obj->op2->visit(this);
1476  }
1477  if(obj->op3)
1478  {
1479  obj->op3->visit(this);
1480  }
1481  if(obj->op4)
1482  {
1483  obj->op4->visit(this);
1484  }
1485  if(obj->op5)
1486  {
1487  obj->op5->visit(this);
1488  }
1489  if(obj->op6)
1490  {
1491  obj->op6->visit(this);
1492  }
1493  if(obj->op7)
1494  {
1495  obj->op7->visit(this);
1496  }
1497  if(obj->op8)
1498  {
1499  obj->op8->visit(this);
1500  }
1501  obj->expr_node::visit(this);
1502  os << ")";
1503 }
1504 
1505 void GimpleWriter::operator()(const template_decl* obj, unsigned int& mask)
1506 {
1507  mask = NO_VISIT;
1508  obj->decl_node::visit(this);
1509  os << "template_decl (";
1510  if(obj->name)
1511  {
1512  obj->name->visit(this);
1513  }
1514  if(obj->rslt)
1515  {
1516  // obj->rslt->visit(this);
1517  }
1518  if(obj->inst)
1519  {
1520  obj->inst->visit(this);
1521  }
1522  if(obj->spcs)
1523  {
1524  obj->spcs->visit(this);
1525  }
1526  if(obj->prms)
1527  {
1528  obj->prms->visit(this);
1529  }
1530  os << ")";
1531 }
1532 
1533 void GimpleWriter::operator()(const template_parm_index* obj, unsigned int& mask)
1534 {
1535  mask = NO_VISIT;
1536  obj->type->visit(this);
1537  obj->decl->visit(this);
1538  if(obj->constant_flag)
1539  {
1540  os << "_C";
1541  }
1542  if(obj->readonly_flag)
1543  {
1544  os << "_R";
1545  }
1546  os << "_" << obj->idx;
1547  os << "_" << obj->level;
1548  os << "_" << obj->orig_level;
1549 }
1550 
1551 void GimpleWriter::operator()(const tree_list* obj, unsigned int& mask)
1552 {
1553  mask = NO_VISIT;
1554  obj->valu->visit(this);
1555  if(obj->chan)
1556  {
1557  os << ", ";
1558  obj->chan->visit(this);
1559  }
1560  obj->tree_node::visit(this);
1561 }
1562 
1563 void GimpleWriter::operator()(const tree_vec* obj, unsigned int& mask)
1564 {
1565  mask = NO_VISIT;
1566  std::vector<tree_nodeRef>::const_iterator op, op_end = obj->list_of_op.end();
1567  for(op = obj->list_of_op.begin(); op != op_end; ++op)
1568  {
1569  if(op != obj->list_of_op.begin())
1570  {
1571  os << ", ";
1572  }
1573  (*op)->visit(this);
1574  }
1575  obj->tree_node::visit(this);
1576 }
1577 
1578 void GimpleWriter::operator()(const try_block* obj, unsigned int& mask)
1579 {
1580  mask = NO_VISIT;
1581  obj->tree_node::visit(this);
1582 }
1583 
1584 void GimpleWriter::operator()(const type_decl* obj, unsigned int& mask)
1585 {
1586  mask = NO_VISIT;
1587  obj->name->visit(this);
1588  obj->decl_node::visit(this);
1589 }
1590 
1591 void GimpleWriter::operator()(const union_type* obj, unsigned int& mask)
1592 {
1593  mask = NO_VISIT;
1594  obj->type_node::visit(this);
1595 }
1596 
1597 void GimpleWriter::operator()(const var_decl* obj, unsigned int& mask)
1598 {
1599  mask = NO_VISIT;
1600  if(obj->name)
1601  {
1602  obj->name->visit(this);
1603  }
1604  else
1605  {
1606  if(this->use_uid)
1607  {
1608  os << "D." << obj->uid;
1609  }
1610  else
1611  {
1612  os << "internal_" << current_node_index;
1613  }
1614  }
1615  obj->decl_node::visit(this);
1616  obj->attr::visit(this);
1617 }
1618 
1619 void GimpleWriter::operator()(const vector_cst* obj, unsigned int& mask)
1620 {
1621  os << "{ ";
1622  size_t vector_size = obj->list_of_valu.size();
1623  for(size_t i = 0; i < vector_size; i++)
1624  {
1625  obj->list_of_valu[i]->visit(this);
1626  if(i != (obj->list_of_valu).size() - 1)
1627  {
1628  os << ", ";
1629  }
1630  }
1631  os << " }";
1632 
1633  mask = NO_VISIT;
1634  obj->cst_node::visit(this);
1635 }
1636 
1637 void GimpleWriter::operator()(const type_argument_pack* obj, unsigned int& mask)
1638 {
1639  mask = NO_VISIT;
1640  if(not obj->unql and not obj->name)
1641  {
1642  os << "type_argument_pack ";
1643  obj->arg->visit(this);
1644  mask = NO_VISIT;
1645  obj->type_node::visit(this);
1646  }
1647  obj->type_node::visit(this);
1648 }
1649 
1650 void GimpleWriter::operator()(const nontype_argument_pack* obj, unsigned int& mask)
1651 {
1652  mask = NO_VISIT;
1653  os << "nontype_argument_pack ";
1654  obj->arg->visit(this);
1655  mask = NO_VISIT;
1656  obj->expr_node::visit(this);
1657 }
1658 
1659 void GimpleWriter::operator()(const type_pack_expansion* obj, unsigned int& mask)
1660 {
1661  mask = NO_VISIT;
1662  os << "type_pack_expansion ";
1663  if(obj->op)
1664  {
1665  obj->op->visit(this);
1666  }
1667  if(obj->param_packs)
1668  {
1669  obj->param_packs->visit(this);
1670  }
1671  if(obj->arg)
1672  {
1673  obj->arg->visit(this);
1674  }
1675  mask = NO_VISIT;
1676  obj->type_node::visit(this);
1677 }
1678 
1679 void GimpleWriter::operator()(const expr_pack_expansion* obj, unsigned int& mask)
1680 {
1681  mask = NO_VISIT;
1682  os << "expr_pack_expansion ";
1683  if(obj->op)
1684  {
1685  obj->op->visit(this);
1686  }
1687  if(obj->param_packs)
1688  {
1689  obj->param_packs->visit(this);
1690  }
1691  if(obj->arg)
1692  {
1693  obj->arg->visit(this);
1694  }
1695  mask = NO_VISIT;
1696  obj->expr_node::visit(this);
1697 }
1698 
1699 void GimpleWriter::operator()(const vector_type* obj, unsigned int& mask)
1700 {
1701  mask = NO_VISIT;
1702  if(not obj->unql and not obj->name)
1703  {
1704  os << "vector ";
1705  obj->elts->visit(this);
1706  mask = NO_VISIT;
1707  obj->type_node::visit(this);
1708  }
1709  obj->type_node::visit(this);
1710 }
1711 
1712 void GimpleWriter::operator()(const target_mem_ref* obj, unsigned int& mask)
1713 {
1714  os << "MEM[";
1715  if(obj->symbol)
1716  {
1717  os << "symbol:";
1718  obj->symbol->visit(this);
1719  }
1720 
1721  if(obj->idx)
1722  {
1723  os << ", index:";
1724  obj->idx->visit(this);
1725  }
1726 
1727  if(obj->step)
1728  {
1729  os << ", step:";
1730  obj->step->visit(this);
1731  }
1732 
1733  if(obj->offset)
1734  {
1735  os << ", index:";
1736  obj->offset->visit(this);
1737  }
1738  os << "]";
1739  mask = NO_VISIT;
1740  obj->WeightedNode::visit(this);
1741 }
1742 
1743 void GimpleWriter::operator()(const target_mem_ref461* obj, unsigned int& mask)
1744 {
1745  os << "MEM[";
1746  if(obj->base)
1747  {
1748  os << "symbol:";
1749  obj->base->visit(this);
1750  }
1751 
1752  if(obj->idx)
1753  {
1754  os << ", index:";
1755  obj->idx->visit(this);
1756  }
1757 
1758  if(obj->idx2)
1759  {
1760  os << ", index:";
1761  obj->idx2->visit(this);
1762  }
1763 
1764  if(obj->step)
1765  {
1766  os << ", step:";
1767  obj->step->visit(this);
1768  }
1769 
1770  if(obj->offset)
1771  {
1772  os << ", offset:";
1773  obj->offset->visit(this);
1774  }
1775  os << "]";
1776  mask = NO_VISIT;
1777  obj->WeightedNode::visit(this);
1778 }
1779 void GimpleWriter::operator()(const bloc*, unsigned int& mask)
1780 {
1781  mask = NO_VISIT;
1782 }
1783 
1784 void GimpleWriter::operator()(const null_node* obj, unsigned int& mask)
1785 {
1786  mask = NO_VISIT;
1787  obj->tree_node::visit(this);
1788 }
1789 
1790 void GimpleWriter::operator()(const gimple_pragma* obj, unsigned int& mask)
1791 {
1792  mask = NO_VISIT;
1793  obj->gimple_node::visit(this);
1794  os << "#pragma ";
1795  THROW_ASSERT(obj->scope, "Printing a gimple pragma without scope");
1796  obj->scope->visit(this);
1797  obj->directive->visit(this);
1798 }
1799 
1800 void GimpleWriter::operator()(const omp_pragma* obj, unsigned int& mask)
1801 {
1802  mask = NO_VISIT;
1803  os << "omp";
1804  obj->tree_node::visit(this);
1805 }
1806 
1807 void GimpleWriter::operator()(const omp_parallel_pragma*, unsigned int& mask)
1808 {
1809  mask = NO_VISIT;
1810  os << " parallel";
1811 }
1812 
1813 void GimpleWriter::operator()(const omp_sections_pragma*, unsigned int& mask)
1814 {
1815  mask = NO_VISIT;
1816  os << " sections";
1817 }
1818 
1819 void GimpleWriter::operator()(const omp_parallel_sections_pragma* obj, unsigned int& mask)
1820 {
1821  mask = NO_VISIT;
1822  obj->omp_pragma::visit(this);
1823 }
1824 
1825 void GimpleWriter::operator()(const omp_section_pragma*, unsigned int& mask)
1826 {
1827  mask = NO_VISIT;
1828  os << " section";
1829 }
1830 
1831 void GimpleWriter::operator()(const omp_for_pragma* obj, unsigned int& mask)
1832 {
1833  mask = NO_VISIT;
1834  os << " parallel for";
1837  for(clause = clauses.begin(); clause != clause_end; ++clause)
1838  {
1839  os << " " + clause->first + (clause->second != "" ? "(" + clause->second + ")" : "");
1840  }
1841 }
1842 
1843 void GimpleWriter::operator()(const omp_simd_pragma* obj, unsigned int& mask)
1844 {
1845  mask = NO_VISIT;
1846  os << " simd";
1849  for(clause = clauses.begin(); clause != clause_end; ++clause)
1850  {
1851  os << " " + clause->first + (clause->second != "" ? "(" + clause->second + ")" : "");
1852  }
1853 }
1854 
1855 void GimpleWriter::operator()(const omp_declare_simd_pragma* obj, unsigned int& mask)
1856 {
1857  mask = NO_VISIT;
1858  os << " declare simd";
1861  for(clause = clauses.begin(); clause != clause_end; ++clause)
1862  {
1863  os << " " + clause->first + (clause->second != "" ? "(" + clause->second + ")" : "");
1864  }
1865 }
1866 
1867 void GimpleWriter::operator()(const omp_target_pragma* obj, unsigned int& mask)
1868 {
1869  mask = NO_VISIT;
1870  os << " target";
1873  for(clause = clauses.begin(); clause != clause_end; ++clause)
1874  {
1875  os << " " + clause->first + (clause->second != "" ? "(" + clause->second + ")" : "");
1876  }
1877 }
1878 
1879 void GimpleWriter::operator()(const omp_critical_pragma* obj, unsigned int& mask)
1880 {
1881  mask = NO_VISIT;
1882  os << " critical";
1885  for(clause = clauses.begin(); clause != clause_end; ++clause)
1886  {
1887  os << " " + clause->first + (clause->second != "" ? "(" + clause->second + ")" : "");
1888  }
1889 }
1890 
1891 void GimpleWriter::operator()(const omp_task_pragma* obj, unsigned int& mask)
1892 {
1893  mask = NO_VISIT;
1894  os << " task";
1897  for(clause = clauses.begin(); clause != clause_end; ++clause)
1898  {
1899  os << " " + clause->first + (clause->second != "" ? "(" + clause->second + ")" : "");
1900  }
1901 }
1902 
1903 void GimpleWriter::operator()(const map_pragma* obj, unsigned int& mask)
1904 {
1905  mask = NO_VISIT;
1906  obj->tree_node::visit(this);
1907 }
1908 
1909 void GimpleWriter::operator()(const call_hw_pragma* obj, unsigned int& mask)
1910 {
1911  mask = NO_VISIT;
1912  obj->tree_node::visit(this);
1913 }
1914 
1915 void GimpleWriter::operator()(const call_point_hw_pragma* obj, unsigned int& mask)
1916 {
1917  mask = NO_VISIT;
1918  obj->tree_node::visit(this);
1919 }
1920 
1921 void GimpleWriter::operator()(const issue_pragma* obj, unsigned int& mask)
1922 {
1923  mask = NO_VISIT;
1924  obj->tree_node::visit(this);
1925 }
1926 
1927 void GimpleWriter::operator()(const blackbox_pragma* obj, unsigned int& mask)
1928 {
1929  mask = NO_VISIT;
1930  obj->issue_pragma::visit(this);
1931 }
1932 
1933 void GimpleWriter::operator()(const profiling_pragma* obj, unsigned int& mask)
1934 {
1935  mask = NO_VISIT;
1936  obj->tree_node::visit(this);
1937 }
1938 
1939 void GimpleWriter::operator()(const statistical_profiling* obj, unsigned int& mask)
1940 {
1941  mask = NO_VISIT;
1942  obj->profiling_pragma::visit(this);
1943 }
1944 
1945 void GimpleWriter::operator()(const gimple_while* obj, unsigned int& mask)
1946 {
1947  mask = NO_VISIT;
1948  os << "while (";
1949  obj->op0->visit(this);
1950  os << ")";
1951  obj->gimple_node::visit(this);
1952 }
1953 
1954 void GimpleWriter::operator()(const gimple_for* obj, unsigned int& mask)
1955 {
1956  mask = NO_VISIT;
1957  os << "for (";
1958  obj->op1->visit(this);
1959  os << "; ";
1960  obj->op0->visit(this);
1961  os << "; ";
1962  obj->op2->visit(this);
1963  os << ")";
1964  obj->gimple_node::visit(this);
1965 }
1966 
1967 void GimpleWriter::operator()(const gimple_multi_way_if* obj, unsigned int& mask)
1968 {
1969  mask = NO_VISIT;
1970  os << "multi_way_if (";
1971  for(const auto& cond : obj->list_of_cond)
1972  {
1973  if(cond.first)
1974  {
1975  cond.first->visit(this);
1976  }
1977  os << ":" << cond.second << " ";
1978  }
1979  os << ")";
1980  obj->gimple_node::visit(this);
1981 }
#define GET_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
Definition: tree_node.hpp:343
struct definition of the type_decl tree node.
Definition: tree_node.hpp:5470
tree_nodeRef ptd
ptd field points to the node for the type pointed to.
Definition: tree_node.hpp:3909
This struct specifies the integer_cst node.
Definition: tree_node.hpp:3242
tree_nodeRef op
the label
Definition: tree_node.hpp:3351
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
bool default_flag
default_flag is true if the label is a &#39;default&#39; label
Definition: tree_node.hpp:2025
tree_nodeRef op2
second operand
Definition: tree_node.hpp:6056
const DefEdgeList & CGetDefEdgesList() const
Return the list of def edges.
Definition: tree_node.cpp:1011
This struct specifies the field bloc (basic block).
struct definition of the vector_type tree node.
Definition: tree_node.hpp:5938
struct definition of the array_type tree node.
Definition: tree_node.hpp:1520
tree_nodeRef unql
unql field, in any member of such a chain, points to the start of the chain.
Definition: tree_node.hpp:1343
struct definition of the real_type tree node.
Definition: tree_node.hpp:4039
tree_nodeRef decl
Definition: tree_node.hpp:5079
tree_nodeRef name
name field contains info on the name used in the program for this type.It is either a TYPE_DECL node...
Definition: tree_node.hpp:1337
CustomUnorderedMapUnstable< std::string, std::string > clauses
map between the clauses that can be associated with the OpenMP parallel pragma and their value (e...
#define CASE_BINARY_EXPRESSION
This macro collects all case labels for binary_expr objects.
Definition: tree_node.hpp:463
int ctor
operand count
Definition: tree_node.hpp:1925
tree_nodeRef op1
The second operand of the binary expression.
Definition: tree_node.hpp:3024
Any erroneous construct is parsed into a node of this type.
Definition: tree_node.hpp:1462
bool temporary_address
Definition: tree_node.hpp:3033
This struct specifies the statement_list node.
Definition: tree_node.hpp:4662
std::string valr
valr is the real value
Definition: tree_node.hpp:4004
#define BB_EXIT
constant identifying the basic block node of type exit
tree_nodeRef name
name field contains an identifier_node used to represent a name.
Definition: tree_node.hpp:883
#define CASE_DECL_NODES
NOTE that cast_expr is a unary expression but it could not be included in the CASE_UNARY_EXPRESSION b...
Definition: tree_node.hpp:672
tree_nodeRef elts
field elts is the type of an vector element (tree-dump.c use the macro TREE_TYPE) ...
Definition: tree_node.hpp:5946
tree_nodeRef idx
INDEX register.
Definition: tree_node.hpp:4955
A HANDLER wraps a catch handler for the HANDLER_TYPE.
Definition: tree_node.hpp:3141
tree_nodeRef param_packs
PACK_EXPANSION_PARAMETER_PACKS.
Definition: tree_node.hpp:2197
tree_nodeRef op
op is casted node
Definition: tree_node.hpp:2065
struct definition of the source position.
Definition: tree_node.hpp:832
Represents an argument pack of types (or templates).
Definition: tree_node.hpp:5139
tree_nodeRef op1
first operand
Definition: tree_node.hpp:6053
struct definition of the function_decl tree node.
Definition: tree_node.hpp:2759
tree_nodeRef size
size field contains a tree that is an expression for the size in bits.
Definition: tree_node.hpp:1349
struct definition of the method_type tree node.
Definition: tree_node.hpp:3452
tree_nodeRef decl
it is the target of an initialization
Definition: tree_node.hpp:4822
tree_nodeRef var
var is the variable being referenced (macro SSA_NAME_VAR).
Definition: tree_node.hpp:4543
tree_nodeRef arg
PACK_EXPANSION_EXTRA_ARGS.
Definition: tree_node.hpp:2200
TreeVocabularyTokenTypes_TokenEnum qual
qual is the set of type qualifiers for this type.
Definition: tree_node.hpp:1328
static std::string return_C_qualifiers(const TreeVocabularyTokenTypes_TokenEnum quals, bool real_const)
return the qualifiers in C format
This struct specifies the gimple_label node.
Definition: tree_node.hpp:3343
This struct specifies the string_cst node.
Definition: tree_node.hpp:4724
tree_nodeRef op4
fourth operand
Definition: tree_node.hpp:6062
tree_nodeRef op2
The third operand of the ternary expression.
Definition: tree_node.hpp:1253
tree_nodeRef op1
The second operand of the Quaternary expression.
Definition: tree_node.hpp:1287
struct definition of the union_type tree node.
Definition: tree_node.hpp:5540
std::vector< tree_nodeRef > list_of_valu
list_of_valu is a list of value of the TREE_VECTOR_CST_ELTS vector elements.
Definition: tree_node.hpp:5896
virtual void visit(tree_node_visitor *const v) const
virtual function used to traverse the tree_node data structure.
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
tree_nodeRef op6
sixth operand
Definition: tree_node.hpp:6068
tree_nodeRef op0
The first operand of the binary expression.
Definition: tree_node.hpp:3021
GIMPLE_BIND <VARS, BLOCK, BODY> represents a lexical scope.
Definition: tree_node.hpp:1664
std::map< unsigned int, blocRef > list_of_bloc
list_of_bloc field is the list of basic block. If this field is null then the list_of_stmt field is n...
Definition: tree_node.hpp:4673
tree_nodeRef base
BASE register.
Definition: tree_node.hpp:4949
tree_nodeRef op
PACK_EXPANSION_PATTERN.
Definition: tree_node.hpp:2194
tree_nodeRef op1
The second operand of the binary expression.
Definition: tree_node.hpp:1217
struct definition of the ternary node structures.
Definition: tree_node.hpp:1239
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
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMapUnstable
Definition: custom_map.hpp:156
tree_nodeRef op7
seventh operand
Definition: tree_node.hpp:6071
tree_nodeRef op1
op1 is the operand 1 (macro CASE_HIGH) of the case label expression
Definition: tree_node.hpp:2022
std::vector< tree_nodeRef > args
The arguments of the gimple_call.
Definition: tree_node.hpp:1968
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
redefinition of map to manage ordered/unordered structures
This struct represents a try-block statement.
Definition: tree_node.hpp:5409
tree_nodeRef spcs
prms field holds the specialization parameters vector.
Definition: tree_node.hpp:5009
Abstract pure class for the tree structure.
Definition: tree_node.hpp:139
std::ostream & os
tree_node visitors
tree_nodeRef arg
arguments stored in the argument pack
Definition: tree_node.hpp:5185
tree_nodeRef res
res is the new SSA_NAME node created by the PHI node.
Definition: tree_node.hpp:3772
virtual enum kind get_kind() const =0
Virtual function returning the type of the actual class.
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.
Auxiliary methods for manipulating string.
struct definition of the label_decl tree node.
Definition: tree_node.hpp:5659
std::vector< tree_nodeRef > args
The arguments of the call_expr.
Definition: tree_node.hpp:1882
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1243
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
CustomUnorderedMapUnstable< std::string, std::string > clauses
map between the clauses that can be associated with the OpenMP parallel pragma and their value (e...
#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
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
tree_nodeRef init
it is the initializer for the target
Definition: tree_node.hpp:4825
This struct specifies the gimple_assign node (GCC 4.3 tree node).
Definition: tree_node.hpp:3015
#define CASE_QUATERNARY_EXPRESSION
This macro collects all case labels for quaternary_expr objects.
Definition: tree_node.hpp:574
#define CASE_UNARY_EXPRESSION
This macro collects all case labels for unary_expr objects.
Definition: tree_node.hpp:371
This struct specifies super class for constant nodes.
Definition: tree_node.hpp:1431
Directive represinting mapping of a function call on a component.
static integer_cst_t get_integer_cst_value(const integer_cst *ic)
Convert a integer_cst in a long long value.
CustomUnorderedMapUnstable< std::string, std::string > clauses
Clauses associated with the directives.
const unsigned int index
Represent the index read from the raw file and the index-1 of the vector of tree_node associated to t...
Definition: tree_node.hpp:146
Low-level memory addressing.
Definition: tree_node.hpp:4938
This struct specifies the gimple_return node.
Definition: tree_node.hpp:4354
tree_nodeRef body
body field is the saved representation of the body of the entire function.
Definition: tree_node.hpp:2870
unsigned int uid
The uid.
Definition: tree_node.hpp:942
tree_nodeRef idx
INDEX register.
Definition: tree_node.hpp:4882
tree_nodeRef prms
prms field holds the template parameters vector.
Definition: tree_node.hpp:5012
Represents an expression that will be expanded into a list of expressions when instantiated with one ...
Definition: tree_node.hpp:2186
tree_nodeRef slot
slot is the slot which was allocated for this expression
Definition: tree_node.hpp:1928
std::list< std::pair< tree_nodeRef, unsigned int > > list_of_cond
The list of pair condition basic block.
#define BB_ENTRY
constant identifying the basic block node of type entry
bool default_flag
Nonzero if this SSA_NAME is the default definition for the underlying symbol.
Definition: tree_node.hpp:4565
struct definition of the function_decl tree node.
Definition: tree_node.hpp:3179
tree_nodeRef op3
third operand
Definition: tree_node.hpp:6059
tree_nodeRef chan
purp is the TREE_CHAIN field: tree_list nodes are made into lists by chaining through the TREE_CHAIN ...
Definition: tree_node.hpp:5269
tree_nodeRef param_packs
PACK_EXPANSION_PARAMETER_PACKS.
Definition: tree_node.hpp:2152
unsigned offset[NUM_VERTICES+1]
Definition: graph.h:3
tree_nodeRef fn
fn is the operand 0 of the call expression: this is the function
Definition: tree_node.hpp:1879
struct definition of the field_decl tree node.
Definition: tree_node.hpp:2640
tree_nodeRef step
STEP integer constant.
Definition: tree_node.hpp:4958
tree_nodeRef op0
the branch var
Definition: tree_node.hpp:4781
struct definition of the complex_type tree node.
Definition: tree_node.hpp:2282
#define GET_CONST_NODE(t)
Definition: tree_node.hpp:347
tree_nodeRef predicate
The predicate.
Definition: tree_node.hpp:3027
tree_nodeRef arg
PACK_EXPANSION_EXTRA_ARGS.
Definition: tree_node.hpp:2155
Classes specification of the tree_node data structures.
GIMPLE_SWITCH <INDEX, DEFAULT_LAB, LAB1, ..., LABN> represents the multiway branch: ...
Definition: tree_node.hpp:4773
bool use_uid
If true gcc uid instead of tree node index.
tree_nodeRef op0
The first operand of the ternary expression.
Definition: tree_node.hpp:2353
struct definition of the field attr on function_decl, field_decl, var_decl tree node.
Definition: tree_node.hpp:774
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
Definition: exceptions.hpp:263
tree_nodeRef offset
OFFSET integer constant.
Definition: tree_node.hpp:4888
struct definition of the pointer_type tree node.
Definition: tree_node.hpp:3896
tree_nodeRef got
got field is the operand 2 (macro CASE_LABEL) of the case label expression
Definition: tree_node.hpp:2028
unsigned int algn
algn field is the alignment necessary for objects of this type.
Definition: tree_node.hpp:1362
tree_nodeRef op0
true table constant
Definition: tree_node.hpp:6050
This struct specifies the block node.
Definition: tree_node.hpp:1820
#define CASE_TYPE_NODES
This macro collects all case labels for type objects.
Definition: tree_node.hpp:581
This file collects some utility functions.
tree_nodeRef op0
The first operand of the binary expression.
Definition: tree_node.hpp:1214
std::vector< tree_nodeRef > list_of_args
args field holds a chain of parm_decl nodes for the arguments.
Definition: tree_node.hpp:2841
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
static std::string op_symbol(const tree_nodeConstRef &op)
Function return the symbol related with the operator op passed as parameter.
struct definition of the common part of an expression
Definition: tree_node.hpp:973
unsigned int vers
vers is the SSA version number of this SSA name.
Definition: tree_node.hpp:4547
This struct specifies the lut_expr node.
Definition: tree_node.hpp:6042
tree_nodeRef directive
this node represents the directive of the pragma
#define CASE_CST_NODES
This macro collects all case labels for cast nodes.
Definition: tree_node.hpp:689
CustomUnorderedMapUnstable< std::string, std::string > clauses
map between the clauses that can be associated with the OpenMP parallel pragma and their value (e...
This struct specifies the complex_cst node.
Definition: tree_node.hpp:2237
tree_nodeRef type
type of the expression
Definition: tree_node.hpp:981
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_nodeRef rslt
rslt is null for struct templates and declaration for object to be created for non-struct templates ...
Definition: tree_node.hpp:5003
Class specification of the tree_reindex support class.
tree_nodeRef clnp
it is the cleanup for this node
Definition: tree_node.hpp:4828
#define CASE_FAKE_NODES
This macro collects all case labels for fake or empty nodes.
Definition: tree_node.hpp:635
This struct represent a statement expression.
Definition: tree_node.hpp:2592
This struct specifies the call_expr node.
Definition: tree_node.hpp:1873
std::string strg
strg is the TREE_STRING_POINTER.
Definition: tree_node.hpp:4732
tree_nodeRef op1
initialization
tree_nodeRef scope
this node defines the scope of the pragma
Class specification of the basic_block structure.
tree_nodeRef op0
op0 is the operand 0 (macro CASE_LOW) of the case label expression
Definition: tree_node.hpp:2019
tree_nodeRef step
STEP integer constant.
Definition: tree_node.hpp:4885
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.
unsigned int current_node_index
The index of the currently visited node.
This struct specifies the real_cst node.
Definition: tree_node.hpp:3990
std::vector< tree_nodeRef > list_of_op
list_of_op is the array of tree node stored in tree_vec node.(macro TREE_VEC_ELT) ...
Definition: tree_node.hpp:5310
tree_nodeRef op0
The first operand of the Quaternary expression.
Definition: tree_node.hpp:1284
tree_nodeRef op0
The first operand of the ternary expression.
Definition: tree_node.hpp:1247
static tree_nodeConstRef CGetType(const tree_nodeConstRef &node)
Return the treenode of the type of node.
char str[25]
Definition: fixedptc.c:8
tree node writer.
tree_nodeRef idx2
INDEX register.
Definition: tree_node.hpp:4961
This struct specifies the case_label_expr node.
Definition: tree_node.hpp:2011
tree_nodeRef type
type field holds the data type of the object, when relevant.
Definition: tree_node.hpp:907
GimpleWriter(std::ostream &_os, const bool _use_uid)
default constructor
Classes specification of the tree_node data structures not present in the gcc.
tree_nodeRef inst
inst field holds the template instantiation vector.
Definition: tree_node.hpp:5006
#define CASE_CPP_NODES
This macro collects all case labels for cpp nodes.
Definition: tree_node.hpp:644
Low-level memory addressing.
Definition: tree_node.hpp:4865
tree_nodeRef valu
purp is the TREE_VALUE field which stores the elements of the list.
Definition: tree_node.hpp:5266
std::string strg
Store the identifier string associated with the identifier_node.
Definition: tree_node.hpp:3189
This struct specifies the ssa_name node.
Definition: tree_node.hpp:4523
tree_nodeRef elts
field elts is the type of an array element (tree-dump.c use the macro TREE_TYPE)
Definition: tree_node.hpp:1530
tree_nodeRef op
op field is the operand of this node
Definition: tree_node.hpp:4362
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
tree_nodeRef op1
the vec of CASE_LABEL_EXPRs
Definition: tree_node.hpp:4784
#define NO_VISIT
constant used to avoid member visit
Definition: visitor.hpp:69
static integer_cst_t GetConstValue(const tree_nodeConstRef &tn, bool is_signed=true)
Get value from integer constant.
#define CASE_GIMPLE_NODES
This macro collects all cases labels for gimple nodes.
Definition: tree_node.hpp:700
tree_nodeRef op2
postincrement
tree_nodeRef type
starting from GCC 4.7.2 ssa_name has a type
Definition: tree_node.hpp:4540
tree_nodeRef op
PACK_EXPANSION_PATTERN.
Definition: tree_node.hpp:2149
struct definition of the binary node structures.
Definition: tree_node.hpp:1206
tree_nodeRef type
type field is the type of the node
Definition: tree_node.hpp:1439
This struct specifies the tree_vec node.
Definition: tree_node.hpp:5299
unsigned int orig_vers
original SSA version number from GCC
Definition: tree_node.hpp:4550
tree_nodeRef arg
arguments stored in the argument pack
Definition: tree_node.hpp:5147
tree_nodeRef op8
eighth operand
Definition: tree_node.hpp:6074
tree_nodeRef op
op field is the operand of the unary expression
Definition: tree_node.hpp:1185
tree_nodeRef op0
The boolean condition.
tree_nodeRef symbol
static or global variable
Definition: tree_node.hpp:4876
This struct specifies the gimple_asm node.
Definition: tree_node.hpp:1574
tree_nodeRef op1
The second operand of the ternary expression.
Definition: tree_node.hpp:1250
CustomUnorderedMapUnstable< std::string, std::string > clauses
Clauses associated with the directives.
CustomUnorderedMapUnstable< std::string, std::string > clauses
Clauses associated with the directives.
tree_nodeRef type
Definition: tree_node.hpp:5078
This struct specifies the gimple_call node.
Definition: tree_node.hpp:1959
tree_nodeRef op5
fifth operand
Definition: tree_node.hpp:6065
tree_nodeRef offset
OFFSET integer constant.
Definition: tree_node.hpp:4952
struct definition of the declaration node structures.
Definition: tree_node.hpp:877
#define CASE_TERNARY_EXPRESSION
This macro collects all case labels for ternary_expr objects.
Definition: tree_node.hpp:550
This struct specifies the while expression Used to represent a while construct.
tree_nodeRef fn
fn is the operand 0 of the call expression: this is the function
Definition: tree_node.hpp:1965
#define CASE_PRAGMA_NODES
This macro collects all case labels for pragma objects.
Definition: tree_node.hpp:610
Represents a type expression that will be expanded into a list of types when instantiated with one or...
Definition: tree_node.hpp:2141
Memory tags used in tree-ssa to represent memory locations in virtual SSA.
Definition: tree_node.hpp:1393
#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:55 for PandA-2024.02 by doxygen 1.8.13