PandA-2024.02
tree_node.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  */
47 #include "config_HAVE_TREE_MANIPULATION_BUILT.hpp"
49 #include "config_HAVE_TREE_PARSER_BUILT.hpp"
50 
52 #include "token_interface.hpp"
53 
54 #include <ostream> // for operator<<
55 
57 #include "dbgPrintHelper.hpp" // for INDENT_DBG_MEX
58 #include "gimple_writer.hpp"
59 #include "string_manipulation.hpp" // for STR
60 #include "tree_basic_block.hpp"
61 #include "tree_helper.hpp"
62 #include "tree_manager.hpp"
63 #include "tree_node.hpp"
64 #include "tree_reindex.hpp"
65 
67 #include <boost/preprocessor/facilities/empty.hpp>
68 #include <boost/preprocessor/seq/for_each.hpp>
69 #include <iostream>
70 #include <unordered_map>
71 #include <utility>
72 
73 #include "config_HAVE_ASSERTS.hpp"
74 
76 #define VISIT_TREE_NODE_MACRO(r, data, elem) \
77  void elem::visit(tree_node_visitor* const v) const \
78  { \
79  unsigned int mask = ALL_VISIT; \
80  (*v)(this, mask); \
81  VISIT_SC(mask, data, visit(v)); \
82  }
83 
84 enum kind tree_node::get_kind(const std::string& input_name)
85 {
86  static std::unordered_map<std::string, enum kind> to_kind = []() {
87  std::unordered_map<std::string, enum kind> out;
88  std::string name;
89 
90 #define NAME_KIND(r, data, elem) \
91  name = #elem; \
92  name = name.substr(19); \
93  name = name.substr(name.front() == ' ', name.find(')') - (name.front() == ' ')); \
94  out[name] = BOOST_PP_CAT(elem, _K);
95 
100  BOOST_PP_SEQ_FOR_EACH(NAME_KIND, BOOST_PP_EMPTY, GIMPLE_NODES);
107  BOOST_PP_SEQ_FOR_EACH(NAME_KIND, BOOST_PP_EMPTY, UNARY_EXPRESSION_TREE_NODES(last_tree));
108 #if HAVE_ASSERTS
109  for(const auto& sk : out)
110  {
111  THROW_ASSERT(sk.first.find(' ') == std::string::npos,
112  "Kind name string should not contain spaces: '" + sk.first + "'");
113  }
114 #endif
115  return out;
116  }();
117  return to_kind[input_name];
118 }
119 
120 std::string tree_node::GetString(enum kind k)
121 {
122  static std::unordered_map<enum kind, std::string> to_string = []() {
123  std::unordered_map<enum kind, std::string> out;
124  std::string name;
125 
126 #define KIND_NAME(r, data, elem) \
127  name = #elem; \
128  name = name.substr(19); \
129  name = name.substr(name.front() == ' ', name.find(')') - (name.front() == ' ')); \
130  out[BOOST_PP_CAT(elem, _K)] = name;
131 
136  BOOST_PP_SEQ_FOR_EACH(KIND_NAME, BOOST_PP_EMPTY, GIMPLE_NODES);
143  BOOST_PP_SEQ_FOR_EACH(KIND_NAME, BOOST_PP_EMPTY, UNARY_EXPRESSION_TREE_NODES(last_tree))
144 #if HAVE_ASSERTS
145  for(const auto& ks : out)
146  {
147  THROW_ASSERT(ks.second.find(' ') == std::string::npos,
148  "Kind name string should not contain spaces: '" + ks.second + "'");
149  }
150 #endif
151 
152  return out;
153  }();
154  return to_string[k];
155 }
156 
162 BOOST_PP_SEQ_FOR_EACH(VISIT_TREE_NODE_MACRO, tree_node, (ctor_initializer)(trait_expr))
163 BOOST_PP_SEQ_FOR_EACH(VISIT_TREE_NODE_MACRO, decl_node, (label_decl)(using_decl)(translation_unit_decl))
165  (modop_expr)(new_expr)(placeholder_expr)(template_id_expr)(vec_new_expr))
167  (boolean_type)(CharType)(nullptr_type)(lang_type)(offset_type)(qual_union_type)(set_type)(
168  template_type_parm)(typename_type)(void_type))
169 #undef VISIT_TREE_NODE_MACRO
170 
171 void tree_node::visit(tree_node_visitor* const v) const
172 {
173  unsigned int mask = ALL_VISIT;
174  (*v)(this, mask);
175 }
176 
177 std::string tree_node::ToString() const
178 {
179  std::stringstream temp;
180  temp << "@" << index << " ";
181  temp << this;
182  return temp.str();
183 }
184 
185 std::ostream& operator<<(std::ostream& os, const tree_node* tn)
186 {
187  GimpleWriter gimple_writer(os, false);
188  tn->visit(&gimple_writer);
189  return os;
190 }
191 
192 std::ostream& operator<<(std::ostream& os, const tree_nodeRef& tn)
193 {
194  os << tn.get();
195  return os;
196 }
197 
199 {
200 }
201 
203 {
204  unsigned int mask = ALL_VISIT;
205  (*v)(this, mask);
206  // VISIT_SC(mask, tree_node, visit(v));
207 }
208 
209 attr::~attr() = default;
210 
211 void attr::visit(tree_node_visitor* const v) const
212 {
213  unsigned int mask = ALL_VISIT;
214  (*v)(this, mask);
215 }
216 
218 {
220 }
221 
223 {
225 }
226 
227 bool attr::is_member() const
228 {
229  return list_attr.count(TreeVocabularyTokenTypes_TokenEnum::TOK_MEMBER);
230 }
231 
232 bool attr::is_call() const
233 {
234  return list_attr.count(TreeVocabularyTokenTypes_TokenEnum::TOK_CALL);
235 }
236 
237 bool attr::is_new() const
238 {
239  return list_attr.count(TreeVocabularyTokenTypes_TokenEnum::TOK_NEW);
240 }
241 
242 bool attr::is_public() const
243 {
244  return list_attr.count(TreeVocabularyTokenTypes_TokenEnum::TOK_PUBLIC);
245 }
246 
247 bool attr::is_protected() const
248 {
250 }
251 
252 bool attr::is_private() const
253 {
254  return list_attr.count(TreeVocabularyTokenTypes_TokenEnum::TOK_PRIVATE);
255 }
256 
257 bool attr::is_bitfield() const
258 {
259  return list_attr.count(TreeVocabularyTokenTypes_TokenEnum::TOK_BITFIELD);
260 }
261 
262 srcp::~srcp() = default;
263 
264 void srcp::visit(tree_node_visitor* const v) const
265 {
266  unsigned int mask = ALL_VISIT;
267  (*v)(this, mask);
268 }
269 
270 decl_node::decl_node(unsigned int i)
271  : tree_node(i),
272  artificial_flag(false),
273  packed_flag(false),
274  operating_system_flag(false),
275  library_system_flag(false),
276  libbambu_flag(false),
277  C_flag(false),
278  uid(0)
279 {
280 }
281 
283 {
284  unsigned int mask = ALL_VISIT;
285  (*v)(this, mask);
286  VISIT_SC(mask, tree_node, visit(v));
287  VISIT_SC(mask, srcp, visit(v));
288  VISIT_MEMBER(mask, name, visit(v));
289  VISIT_MEMBER(mask, mngl, visit(v));
290  VISIT_MEMBER(mask, orig, visit(v));
291  VISIT_MEMBER(mask, type, visit(v));
292  VISIT_MEMBER(mask, scpe, visit(v));
293  VISIT_MEMBER(mask, attributes, visit(v));
294  VISIT_MEMBER(mask, chan, visit(v));
295 }
296 
298 {
299  unsigned int mask = ALL_VISIT;
300  (*v)(this, mask);
301  VISIT_SC(mask, WeightedNode, visit(v));
302  VISIT_SC(mask, srcp, visit(v));
303  VISIT_MEMBER(mask, type, visit(v));
304 }
305 
307  : WeightedNode(i),
308  use_set(new PointToSolution()),
309  clobbered_set(new PointToSolution()),
310  bb_index(0),
311  artificial(false),
312  keep(false)
313 {
314 }
315 
317 {
318  THROW_ASSERT(!GET_CONST_NODE(_vdef) || (GET_CONST_NODE(_vdef)->get_kind() == ssa_name_K &&
319  GetPointerS<const ssa_name>(GET_CONST_NODE(_vdef))->virtual_flag),
320  "");
321  vdef = _vdef;
322 }
323 
325 {
326  THROW_ASSERT(!GET_CONST_NODE(vuse) || (GET_CONST_NODE(vuse)->get_kind() == ssa_name_K &&
327  GetPointerS<const ssa_name>(GET_CONST_NODE(vuse))->virtual_flag),
328  "");
329  return vuses.insert(vuse).second;
330 }
331 
333 {
334  THROW_ASSERT(!GET_CONST_NODE(vover) || (GET_CONST_NODE(vover)->get_kind() == ssa_name_K &&
335  GetPointerS<const ssa_name>(GET_CONST_NODE(vover))->virtual_flag),
336  "");
337  return vovers.insert(vover).second;
338 }
339 
341 {
342  unsigned int mask = ALL_VISIT;
343  (*v)(this, mask);
344  VISIT_SC(mask, WeightedNode, visit(v));
345  VISIT_SC(mask, srcp, visit(v));
346  VISIT_MEMBER(mask, memuse, visit(v));
347  VISIT_MEMBER(mask, memdef, visit(v));
349  VISIT_MEMBER(mask, vdef, visit(v));
351  VISIT_MEMBER(mask, use_set, visit(v));
352  VISIT_MEMBER(mask, clobbered_set, visit(v));
353  VISIT_MEMBER(mask, scpe, visit(v));
354 }
355 
357 {
358  unsigned int mask = ALL_VISIT;
359  (*v)(this, mask);
360  VISIT_SC(mask, expr_node, visit(v));
361  VISIT_MEMBER(mask, op, visit(v));
362 }
363 
365 {
366  unsigned int mask = ALL_VISIT;
367  (*v)(this, mask);
368  VISIT_SC(mask, expr_node, visit(v));
369  VISIT_MEMBER(mask, op0, visit(v));
370  VISIT_MEMBER(mask, op1, visit(v));
371 }
372 
374 {
375  unsigned int mask = ALL_VISIT;
376  (*v)(this, mask);
377  VISIT_SC(mask, expr_node, visit(v));
378  VISIT_MEMBER(mask, op0, visit(v));
379  VISIT_MEMBER(mask, op1, visit(v));
380  VISIT_MEMBER(mask, op2, visit(v));
381 }
382 
384 {
385  unsigned int mask = ALL_VISIT;
386  (*v)(this, mask);
387  VISIT_SC(mask, expr_node, visit(v));
388  VISIT_MEMBER(mask, op0, visit(v));
389  VISIT_MEMBER(mask, op1, visit(v));
390  VISIT_MEMBER(mask, op2, visit(v));
391  VISIT_MEMBER(mask, op3, visit(v));
392 }
393 
394 type_node::type_node(unsigned int i)
395  : tree_node(i),
397  algn(0),
398  packed_flag(false),
399  system_flag(false),
400  libbambu_flag(false)
401 {
402 }
403 
405 {
406  unsigned int mask = ALL_VISIT;
407  (*v)(this, mask);
408  VISIT_SC(mask, tree_node, visit(v));
409  VISIT_MEMBER(mask, name, visit(v));
410  VISIT_MEMBER(mask, unql, visit(v));
411  VISIT_MEMBER(mask, size, visit(v));
412  VISIT_MEMBER(mask, scpe, visit(v));
413 }
414 
416 {
417  unsigned int mask = ALL_VISIT;
418  (*v)(this, mask);
419  VISIT_SC(mask, decl_node, visit(v));
420  SEQ_VISIT_MEMBER(mask, list_of_aliases, tree_node, visit, tree_node_visitor, v);
421 }
422 
423 void cst_node::visit(tree_node_visitor* const v) const
424 {
425  unsigned int mask = ALL_VISIT;
426  (*v)(this, mask);
427  VISIT_SC(mask, tree_node, visit(v));
428  VISIT_MEMBER(mask, type, visit(v));
429 }
430 
432 {
433  unsigned int mask = ALL_VISIT;
434  (*v)(this, mask);
435  VISIT_SC(mask, tree_node, visit(v));
436 }
437 
439 {
440  unsigned int mask = ALL_VISIT;
441  (*v)(this, mask);
442  VISIT_SC(mask, type_node, visit(v));
443  VISIT_MEMBER(mask, elts, visit(v));
444  VISIT_MEMBER(mask, domn, visit(v));
445 }
446 
448 {
449  unsigned int mask = ALL_VISIT;
450  (*v)(this, mask);
451  VISIT_SC(mask, gimple_node, visit(v));
452  VISIT_MEMBER(mask, out, visit(v));
453  VISIT_MEMBER(mask, in, visit(v));
454  VISIT_MEMBER(mask, clob, visit(v));
455 }
456 
457 void baselink::visit(tree_node_visitor* const v) const
458 {
459  unsigned int mask = ALL_VISIT;
460  (*v)(this, mask);
461  VISIT_SC(mask, tree_node, visit(v));
462  VISIT_MEMBER(mask, type, visit(v));
463 }
464 
466 {
467  unsigned int mask = ALL_VISIT;
468  (*v)(this, mask);
469  VISIT_SC(mask, expr_node, visit(v));
470  SEQ_VISIT_MEMBER(mask, list_of_vars, tree_node, visit, tree_node_visitor, v);
471  VISIT_MEMBER(mask, body, visit(v));
472 }
473 
474 void binfo::visit(tree_node_visitor* const v) const
475 {
476  unsigned int mask = ALL_VISIT;
477  (*v)(this, mask);
478  VISIT_SC(mask, tree_node, visit(v));
479  VISIT_MEMBER(mask, type, visit(v));
480  auto vend = list_of_access_binf.end();
481  for(auto i = list_of_access_binf.begin(); i != vend; ++i)
482  {
483  VISIT_MEMBER_NAMED(list_of_access_binf, mask, i->second, visit(v));
484  }
485 }
486 
488 {
489  list_of_access_binf.emplace_back(access, binf);
490 }
491 
492 void block::visit(tree_node_visitor* const v) const
493 {
494  unsigned int mask = ALL_VISIT;
495  (*v)(this, mask);
496  VISIT_SC(mask, tree_node, visit(v));
497 }
498 
499 PointToSolution::PointToSolution() : anything(false), escaped(false), ipa_escaped(false), nonlocal(false), null(false)
500 {
501 }
502 
504 
505 void PointToSolution::Add(const std::string& variable)
506 {
507  if(variable == "anything")
508  {
509  anything = true;
510  }
511  else if(variable == "escaped")
512  {
513  escaped = true;
514  }
515  else if(variable == "ipa_escaped")
516  {
517  ipa_escaped = true;
518  }
519  else if(variable == "nonlocal")
520  {
521  nonlocal = true;
522  }
523  else if(variable == "null")
524  {
525  null = true;
526  }
527  else
528  {
529  THROW_ERROR_CODE(NODE_NOT_YET_SUPPORTED_EC, "Symbolic variable " + variable + " of point to set unknown");
530  }
531 }
532 
533 void PointToSolution::Add(const tree_nodeRef& variable)
534 {
535  variables.push_back(variable);
536 }
537 
539 {
540  return !anything && !escaped && !ipa_escaped && !nonlocal && variables.size() == 1;
541 }
542 
544 {
545  return !anything && !escaped && !ipa_escaped && !nonlocal && !variables.empty();
546 }
547 
548 std::string PointToSolution::ToString() const
549 {
550  std::string res;
551  if(anything)
552  {
553  res += "anything ";
554  }
555  if(escaped)
556  {
557  res += "escaped ";
558  }
559  if(ipa_escaped)
560  {
561  res += "ipa_escaped ";
562  }
563  if(nonlocal)
564  {
565  res += "nonlocal ";
566  }
567  if(null)
568  {
569  res += "null ";
570  }
571  for(const auto& var : variables)
572  {
573  res += GET_NODE(var)->ToString() + " ";
574  }
575  return res;
576 }
577 
579 {
580  unsigned int mask = ALL_VISIT;
581  (*v)(this, mask);
583 }
584 
586 {
587  unsigned int mask = ALL_VISIT;
588  (*v)(this, mask);
589  VISIT_SC(mask, expr_node, visit(v));
590  VISIT_MEMBER(mask, fn, visit(v));
592 }
593 
594 call_expr::call_expr(const unsigned int i) : expr_node(i)
595 {
596 }
597 
599 {
600  this->args.push_back(arg);
601 }
602 
604 {
605  unsigned int mask = ALL_VISIT;
606  (*v)(this, mask);
607  VISIT_SC(mask, call_expr, visit(v));
608  VISIT_MEMBER(mask, slot, visit(v));
609 }
610 
611 aggr_init_expr::aggr_init_expr(const unsigned int i) : call_expr(i), ctor(0)
612 {
613 }
614 
615 gimple_call::gimple_call(const unsigned int i) : gimple_node(i)
616 {
617 }
618 
620 {
621  unsigned int mask = ALL_VISIT;
622  (*v)(this, mask);
623  VISIT_SC(mask, gimple_node, visit(v));
624  VISIT_MEMBER(mask, fn, visit(v));
626 }
627 
629 {
630  this->args.push_back(arg);
631 }
632 
634 {
635  unsigned int mask = ALL_VISIT;
636  (*v)(this, mask);
637  VISIT_SC(mask, expr_node, visit(v));
638  VISIT_MEMBER(mask, op0, visit(v));
639  VISIT_MEMBER(mask, op1, visit(v));
640  VISIT_MEMBER(mask, got, visit(v));
641 }
642 
644 {
645  unsigned int mask = ALL_VISIT;
646  (*v)(this, mask);
647  VISIT_SC(mask, expr_node, visit(v));
648  VISIT_MEMBER(mask, op, visit(v));
649 }
650 
652 {
653  unsigned int mask = ALL_VISIT;
654  (*v)(this, mask);
655  VISIT_SC(mask, cst_node, visit(v));
656  VISIT_MEMBER(mask, real, visit(v));
657  VISIT_MEMBER(mask, imag, visit(v));
658 }
659 
661 {
662  unsigned int mask = ALL_VISIT;
663  (*v)(this, mask);
664  VISIT_SC(mask, type_node, visit(v));
665 }
666 
668 {
669  unsigned int mask = ALL_VISIT;
670  (*v)(this, mask);
671  VISIT_SC(mask, gimple_node, visit(v));
672  VISIT_MEMBER(mask, op0, visit(v));
673 }
674 
676 {
677  unsigned int mask = ALL_VISIT;
678  (*v)(this, mask);
679  VISIT_SC(mask, decl_node, visit(v));
680  VISIT_MEMBER(mask, cnst, visit(v));
681 }
682 
684 {
685  unsigned int mask = ALL_VISIT;
686  (*v)(this, mask);
687  VISIT_MEMBER(mask, type, visit(v));
688  auto vend = list_of_idx_valu.end();
689  for(auto i = list_of_idx_valu.begin(); i != vend; ++i)
690  {
691  VISIT_MEMBER_NAMED(list_of_idx_valu, mask, i->first, visit(v));
692  VISIT_MEMBER_NAMED(list_of_idx_valu, mask, i->second, visit(v));
693  }
694 }
695 
697 {
698  unsigned int mask = ALL_VISIT;
699  (*v)(this, mask);
700  VISIT_SC(mask, type_node, visit(v));
701  VISIT_MEMBER(mask, min, visit(v));
702  VISIT_MEMBER(mask, max, visit(v));
703  VISIT_MEMBER(mask, csts, visit(v));
704 }
705 
707 {
708  unsigned int mask = ALL_VISIT;
709  (*v)(this, mask);
710  VISIT_SC(mask, tree_node, visit(v));
711  VISIT_MEMBER(mask, expr, visit(v));
712  VISIT_MEMBER(mask, next, visit(v));
713 }
714 
716 {
717  if(bpos)
718  {
719  return tree_helper::GetConstValue(bpos);
720  }
721  return 0;
722 }
723 
725 {
726  unsigned int mask = ALL_VISIT;
727  (*v)(this, mask);
728  VISIT_SC(mask, decl_node, visit(v));
729  VISIT_SC(mask, attr, visit(v));
730  VISIT_MEMBER(mask, init, visit(v));
731  VISIT_MEMBER(mask, size, visit(v));
732  VISIT_MEMBER(mask, bpos, visit(v));
733  VISIT_MEMBER(mask, smt_ann, visit(v));
734 }
735 
737  : decl_node(i),
738  attr(),
739  operator_flag(false),
740  fixd_flag(false),
741  virt_flag(false),
742  reverse_restrict_flag(false),
743  writing_memory(false),
744  reading_memory(false),
745  pipeline_enabled(false),
746  simple_pipeline(false),
747  initiation_time(1),
748 #if HAVE_FROM_PRAGMA_BUILT
749  omp_for_wrapper(0),
750  omp_body_loop(false),
751  omp_critical(""),
752  omp_atomic(false),
753 #endif
754  fixd(0),
755  virt(0),
756  undefined_flag(false),
757  builtin_flag(false),
758  hwcall_flag(false),
759  static_flag(false)
760 {
761 }
762 
764 {
765  unsigned int mask = ALL_VISIT;
766  (*v)(this, mask);
767  VISIT_SC(mask, decl_node, visit(v));
768  VISIT_SC(mask, attr, visit(v));
769  VISIT_MEMBER(mask, fn, visit(v));
770  VISIT_MEMBER(mask, tmpl_parms, visit(v));
771  VISIT_MEMBER(mask, tmpl_args, visit(v));
773  VISIT_MEMBER(mask, body, visit(v));
774  VISIT_MEMBER(mask, inline_body, visit(v));
775 }
776 
778 {
779  list_of_args.push_back(a);
780 }
781 
783 {
784  return attr::is_constructor();
785 }
787 {
788  return attr::is_destructor();
789 }
790 
792 {
793  return operator_flag;
794 }
795 
797 {
798  return attr::is_public();
799 }
800 
802 {
803  return attr::is_private();
804 }
805 
807 {
808  return attr::is_protected();
809 }
810 
812 {
813  return pipeline_enabled;
814 }
815 
817 {
818  pipeline_enabled = v;
819 }
820 
822 {
823  return simple_pipeline;
824 }
825 
827 {
828  simple_pipeline = v;
829 }
830 
832 {
833  return initiation_time;
834 }
835 
837 {
838  initiation_time = time;
839 }
840 
842 {
843  unsigned int mask = ALL_VISIT;
844  (*v)(this, mask);
845  VISIT_SC(mask, type_node, visit(v));
846  VISIT_MEMBER(mask, retn, visit(v));
847  VISIT_MEMBER(mask, prms, visit(v));
848 }
849 
851  : gimple_node(i), init_assignment(false), clobber(false), temporary_address(false)
852 {
853 }
854 
856 {
857  unsigned int mask = ALL_VISIT;
858  (*v)(this, mask);
859  VISIT_SC(mask, gimple_node, visit(v));
860  VISIT_MEMBER(mask, op0, visit(v));
861  VISIT_MEMBER(mask, op1, visit(v));
862  VISIT_MEMBER(mask, predicate, visit(v));
863 }
864 
866 {
867  unsigned int mask = ALL_VISIT;
868  (*v)(this, mask);
869  VISIT_SC(mask, gimple_node, visit(v));
870 }
871 
873 {
874  unsigned int mask = ALL_VISIT;
875  (*v)(this, mask);
876  VISIT_SC(mask, gimple_node, visit(v));
877  VISIT_MEMBER(mask, op, visit(v));
878 }
879 
880 void handler::visit(tree_node_visitor* const v) const
881 {
882  unsigned int mask = ALL_VISIT;
883  (*v)(this, mask);
884  VISIT_SC(mask, tree_node, visit(v));
885  VISIT_MEMBER(mask, body, visit(v));
886 }
887 
888 #if HAVE_TREE_MANIPULATION_BUILT
889 identifier_node::identifier_node(unsigned int node_id, std::string _strg, tree_manager* TM)
890  : tree_node(node_id), operator_flag(false), strg(std::move(_strg))
891 {
892  TM->add_identifier_node(node_id, strg);
893 }
894 
895 identifier_node::identifier_node(unsigned int node_id, bool _operator_flag, tree_manager* TM)
896  : tree_node(node_id), operator_flag(_operator_flag)
897 {
898  TM->add_identifier_node(node_id, operator_flag);
899 }
900 #else
901 identifier_node::identifier_node(unsigned int node_id, const std::string& _strg, tree_manager*)
902  : tree_node(node_id), operator_flag(false), strg(_strg)
903 {
904 }
905 
906 identifier_node::identifier_node(unsigned int node_id, bool _operator_flag, tree_manager*)
907  : tree_node(node_id), operator_flag(_operator_flag)
908 {
909 }
910 #endif
911 
913 {
914  unsigned int mask = ALL_VISIT;
915  (*v)(this, mask);
916  VISIT_SC(mask, tree_node, visit(v));
917 }
918 
920 {
921  unsigned int mask = ALL_VISIT;
922  (*v)(this, mask);
923  VISIT_SC(mask, cst_node, visit(v));
924 }
925 
927 {
928  unsigned int mask = ALL_VISIT;
929  (*v)(this, mask);
930  VISIT_SC(mask, type_node, visit(v));
931  VISIT_MEMBER(mask, min, visit(v));
932  VISIT_MEMBER(mask, max, visit(v));
933 }
934 
936 {
937  unsigned int mask = ALL_VISIT;
938  (*v)(this, mask);
939  VISIT_SC(mask, gimple_node, visit(v));
940  VISIT_MEMBER(mask, op, visit(v));
941 }
942 
944 {
945  unsigned int mask = ALL_VISIT;
946  (*v)(this, mask);
947  VISIT_SC(mask, function_type, visit(v));
948  VISIT_MEMBER(mask, clas, visit(v));
949 }
950 
952 {
953  unsigned int mask = ALL_VISIT;
954  (*v)(this, mask);
955  VISIT_SC(mask, decl_node, visit(v));
956  VISIT_MEMBER(mask, dcls, visit(v));
957 }
958 
959 void overload::visit(tree_node_visitor* const v) const
960 {
961  unsigned int mask = ALL_VISIT;
962  (*v)(this, mask);
963  VISIT_SC(mask, tree_node, visit(v));
964  VISIT_MEMBER(mask, crnt, visit(v));
965  VISIT_MEMBER(mask, chan, visit(v));
966 }
967 
968 parm_decl::parm_decl(unsigned int i) : decl_node(i), algn(0), used(0), register_flag(false), readonly_flag(false)
969 {
970 }
971 
973 {
974  unsigned int mask = ALL_VISIT;
975  (*v)(this, mask);
976  VISIT_SC(mask, decl_node, visit(v));
977  VISIT_MEMBER(mask, argt, visit(v));
978  VISIT_MEMBER(mask, size, visit(v));
979  VISIT_MEMBER(mask, smt_ann, visit(v));
980 }
981 
982 gimple_phi::gimple_phi(unsigned int i) : gimple_node(i), updated_ssa_uses(false), virtual_flag(false)
983 {
984 }
985 
987 {
988  unsigned int mask = ALL_VISIT;
989  (*v)(this, mask);
990  VISIT_SC(mask, gimple_node, visit(v));
991  VISIT_MEMBER(mask, res, visit(v));
992  for(const auto& def_edge : list_of_def_edge)
993  {
994  VISIT_MEMBER_NAMED(list_of_def_edge, mask, def_edge.first, visit(v));
995  }
996 }
997 
998 void gimple_phi::AddDefEdge(const tree_managerRef& TM, const DefEdge& def_edge)
999 {
1000  list_of_def_edge.push_back(def_edge);
1001  if(updated_ssa_uses && bb_index != 0)
1002  {
1003  const auto sn = GetPointer<ssa_name>(GET_NODE(def_edge.first));
1004  if(sn)
1005  {
1006  sn->AddUseStmt(TM->GetTreeReindex(index));
1007  }
1008  }
1009 }
1010 
1012 {
1013  return list_of_def_edge;
1014 }
1015 
1016 void gimple_phi::ReplaceDefEdge(const tree_managerRef& TM, const DefEdge& old_def_edge, const DefEdge& new_def_edge)
1017 {
1018  for(auto& def_edge : list_of_def_edge)
1019  {
1020  if(def_edge == old_def_edge)
1021  {
1022  if(updated_ssa_uses && bb_index != 0)
1023  {
1024  auto sn = GetPointer<ssa_name>(GET_NODE(def_edge.first));
1025  if(sn)
1026  {
1027  sn->RemoveUse(TM->GetTreeReindex(index));
1028  }
1029  }
1030  def_edge = new_def_edge;
1031  if(updated_ssa_uses && bb_index != 0)
1032  {
1033  auto sn = GetPointer<ssa_name>(GET_NODE(def_edge.first));
1034  if(sn)
1035  {
1036  sn->AddUseStmt(TM->GetTreeReindex(index));
1037  }
1038  }
1039  break;
1040  }
1041  }
1042 }
1043 
1044 void gimple_phi::SetDefEdgeList(const tree_managerRef& TM, DefEdgeList new_list_of_def_edge)
1045 {
1046  while(!list_of_def_edge.empty())
1047  {
1048  RemoveDefEdge(TM, list_of_def_edge.front());
1049  }
1050  for(const auto& def_edge : new_list_of_def_edge)
1051  {
1052  AddDefEdge(TM, def_edge);
1053  }
1054 }
1055 
1056 void gimple_phi::RemoveDefEdge(const tree_managerRef& TM, const DefEdge& to_be_removed)
1057 {
1058 #if HAVE_ASSERTS
1059  auto initial_size = list_of_def_edge.size();
1060 #endif
1061  for(auto def_edge = list_of_def_edge.begin(); def_edge != list_of_def_edge.end(); def_edge++)
1062  {
1063  if(*def_edge == to_be_removed)
1064  {
1065  if(updated_ssa_uses && bb_index != 0)
1066  {
1067  const auto sn = GetPointer<ssa_name>(GET_NODE(to_be_removed.first));
1068  if(sn)
1069  {
1070  sn->RemoveUse(TM->GetTreeReindex(index));
1071  }
1072  }
1073  list_of_def_edge.erase(def_edge);
1074  break;
1075  }
1076  }
1077  THROW_ASSERT(list_of_def_edge.size() != initial_size,
1078  to_be_removed.first->ToString() + "(" + STR(to_be_removed.second) + ") not found in " + ToString());
1079 }
1080 
1082 {
1083  THROW_ASSERT(!updated_ssa_uses, "SSA uses already set as updated");
1084  updated_ssa_uses = true;
1085 }
1086 
1087 gimple_predict::gimple_predict(unsigned int _index) : gimple_node(_index)
1088 {
1089 }
1090 
1092 {
1093  unsigned int mask = ALL_VISIT;
1094  (*v)(this, mask);
1095  VISIT_SC(mask, gimple_node, visit(v));
1096 }
1097 
1099 {
1100  unsigned int mask = ALL_VISIT;
1101  (*v)(this, mask);
1102  VISIT_SC(mask, type_node, visit(v));
1103  VISIT_MEMBER(mask, ptd, visit(v));
1104 }
1105 
1107 {
1108  unsigned int mask = ALL_VISIT;
1109  (*v)(this, mask);
1110  VISIT_SC(mask, cst_node, visit(v));
1111 }
1112 
1114 {
1115  unsigned int mask = ALL_VISIT;
1116  (*v)(this, mask);
1117  VISIT_SC(mask, type_node, visit(v));
1118 }
1119 
1121 {
1122  unsigned int mask = ALL_VISIT;
1123  (*v)(this, mask);
1124  VISIT_SC(mask, type_node, visit(v));
1125  VISIT_MEMBER(mask, vfld, visit(v));
1126  SEQ_VISIT_MEMBER(mask, list_of_flds, tree_node, visit, tree_node_visitor, v);
1127  SEQ_VISIT_MEMBER(mask, list_of_fncs, tree_node, visit, tree_node_visitor, v);
1128  VISIT_MEMBER(mask, ptd, visit(v));
1129  VISIT_MEMBER(mask, cls, visit(v));
1130  VISIT_MEMBER(mask, bfld, visit(v));
1131  VISIT_MEMBER(mask, binf, visit(v));
1132  VISIT_MEMBER(mask, tmpl_parms, visit(v));
1133  VISIT_MEMBER(mask, tmpl_args, visit(v));
1134 }
1135 
1136 std::string record_type::get_maybe_name() const
1137 {
1138  type_decl* td = nullptr;
1139  if(name)
1140  {
1141  td = GetPointer<type_decl>(GET_NODE(name));
1142  }
1143  if(td)
1144  {
1145  identifier_node* in = nullptr;
1146  if(td->name)
1147  {
1148  in = GetPointer<identifier_node>(GET_NODE(td->name));
1149  }
1150  if(in)
1151  {
1152  return in->strg;
1153  }
1154  }
1155  return "#UNKNOWN#";
1156 }
1157 
1159 {
1160  unsigned int i;
1161  integer_cst_t fld_offset;
1162  field_decl* fd;
1163  for(i = 0; i < list_of_flds.size(); i++)
1164  {
1165  fd = GetPointer<field_decl>(GET_NODE(list_of_flds[i]));
1166  if(fd)
1167  {
1168  fld_offset = fd->offset();
1169  }
1170  else
1171  {
1172  return tree_nodeRef();
1173  }
1174  if(fld_offset == offset)
1175  {
1176  return list_of_flds[i];
1177  }
1178  }
1179  return tree_nodeRef();
1180 }
1181 
1183 {
1184  unsigned int mask = ALL_VISIT;
1185  (*v)(this, mask);
1186  VISIT_SC(mask, type_node, visit(v));
1187  VISIT_MEMBER(mask, refd, visit(v));
1188 }
1189 
1191 {
1192  unsigned int mask = ALL_VISIT;
1193  (*v)(this, mask);
1194  VISIT_SC(mask, decl_node, visit(v));
1195  VISIT_MEMBER(mask, init, visit(v));
1196  VISIT_MEMBER(mask, size, visit(v));
1197  VISIT_MEMBER(mask, smt_ann, visit(v));
1198 }
1199 
1201 {
1202  unsigned int mask = ALL_VISIT;
1203  (*v)(this, mask);
1204  VISIT_SC(mask, gimple_node, visit(v));
1205 }
1206 
1208 {
1209  unsigned int mask = ALL_VISIT;
1210  (*v)(this, mask);
1211  VISIT_SC(mask, gimple_node, visit(v));
1212  VISIT_MEMBER(mask, op, visit(v));
1213 }
1214 
1216 {
1217  unsigned int mask = ALL_VISIT;
1218  (*v)(this, mask);
1219  VISIT_SC(mask, tree_node, visit(v));
1220  VISIT_MEMBER(mask, expr, visit(v));
1221 }
1222 
1224 {
1225  unsigned int mask = ALL_VISIT;
1226  (*v)(this, mask);
1227  VISIT_SC(mask, expr_node, visit(v));
1228  VISIT_MEMBER(mask, op0, visit(v));
1229  VISIT_MEMBER(mask, op1, visit(v));
1230 }
1231 
1232 ssa_name::ssa_name(unsigned int i)
1233  : tree_node(i),
1234  vers(0),
1235  orig_vers(0),
1236  volatile_flag(false),
1237  virtual_flag(false),
1238  default_flag(false),
1239  use_set(new PointToSolution())
1240 {
1241 }
1242 
1244 {
1245  unsigned int mask = ALL_VISIT;
1246  (*v)(this, mask);
1247  VISIT_SC(mask, tree_node, visit(v));
1248  VISIT_MEMBER(mask, type, visit(v));
1249  VISIT_MEMBER(mask, var, visit(v));
1251  VISIT_MEMBER(mask, min, visit(v));
1252  VISIT_MEMBER(mask, max, visit(v));
1253  VISIT_MEMBER(mask, use_set, visit(v));
1254 }
1255 
1257 {
1258 #if HAVE_ASSERTS
1259  if(def_stmts.size() != 1)
1260  {
1261  std::string error_message;
1262  error_message += "There are " + STR(def_stmts.size()) + " definitions for " + ToString() + ":";
1263  for(const auto& def_stmt : def_stmts)
1264  {
1265  error_message += "\n" + STR(def_stmt);
1266  }
1267  THROW_UNREACHABLE(error_message);
1268  }
1269 #endif
1270  THROW_ASSERT(def_stmts.size() == 1, "There are " + STR(def_stmts.size()) + " definitions for " + ToString());
1271  return *(def_stmts.begin());
1272 }
1273 
1275 {
1276  return def_stmts;
1277 }
1278 
1279 void ssa_name::AddUseStmt(const tree_nodeRef& use_stmt)
1280 {
1281 #ifndef NDEBUG
1282  size_t vuse_count = 0;
1283  if(virtual_flag)
1284  {
1285  const auto gn = GetPointerS<const gimple_node>(GET_CONST_NODE(use_stmt));
1286  vuse_count += static_cast<size_t>(std::count_if(gn->vuses.begin(), gn->vuses.end(),
1287  [&](const tree_nodeRef& tn) { return tn->index == index; }));
1288  vuse_count += static_cast<size_t>(std::count_if(gn->vovers.begin(), gn->vovers.end(),
1289  [&](const tree_nodeRef& tn) { return tn->index == index; }));
1290  vuse_count += static_cast<size_t>(gn->memuse && gn->memuse->index == index);
1291  if(GET_CONST_NODE(use_stmt)->get_kind() == gimple_phi_K)
1292  {
1293  const auto gp = GetPointerS<const gimple_phi>(GET_CONST_NODE(use_stmt));
1294  vuse_count += static_cast<size_t>(
1295  std::count_if(gp->CGetDefEdgesList().begin(), gp->CGetDefEdgesList().end(),
1296  [&](const gimple_phi::DefEdge& de) { return de.first->index == index; }));
1297  }
1298  }
1299 #endif
1300  use_stmts[use_stmt]++;
1301 #ifndef NDEBUG
1302  if(virtual_flag && use_stmts.count(use_stmt) > vuse_count)
1303  {
1304  std::cout << "vssa: " << ToString() << std::endl;
1305  const auto gn = GetPointerS<const gimple_node>(GET_CONST_NODE(use_stmt));
1306  if(gn->vdef)
1307  {
1308  std::cout << "vdef: " << GET_CONST_NODE(gn->vdef)->ToString() << std::endl;
1309  }
1310  for(const auto& vuse : gn->vuses)
1311  {
1312  std::cout << "vuse: " << GET_CONST_NODE(vuse)->ToString() << std::endl;
1313  }
1314  for(const auto& vover : gn->vovers)
1315  {
1316  std::cout << "vover: " << GET_CONST_NODE(vover)->ToString() << std::endl;
1317  }
1318  if(gn->memdef)
1319  {
1320  std::cout << "memdef: " << GET_CONST_NODE(gn->memdef)->ToString() << std::endl;
1321  }
1322  if(gn->memuse)
1323  {
1324  std::cout << "memuse: " << GET_CONST_NODE(gn->memuse)->ToString() << std::endl;
1325  }
1326  THROW_UNREACHABLE("Virtual ssa used more than " + STR(vuse_count) + " time - " +
1327  GET_CONST_NODE(use_stmt)->ToString());
1328  }
1329 #endif
1330 }
1331 
1333 {
1334  def_stmts.insert(def);
1335 }
1336 
1338 {
1339  def_stmts.clear();
1340  def_stmts.insert(def);
1341 }
1342 
1344 {
1345  return use_stmts;
1346 }
1347 
1349 {
1350  size_t ret_value = 0;
1351  for(const auto& use_stmt : use_stmts)
1352  {
1353  ret_value += use_stmt.second;
1354  }
1355  return ret_value;
1356 }
1357 
1358 void ssa_name::RemoveUse(const tree_nodeRef& use_stmt)
1359 {
1360 #ifndef NDEBUG
1361  if(use_stmts.find(use_stmt) == use_stmts.end() || use_stmts.find(use_stmt)->second == 0)
1362  {
1363  INDENT_DBG_MEX(0, 0, use_stmt->ToString() + " is not in the use_stmts of " + ToString());
1364  for(const auto& current_use_stmt : use_stmts)
1365  {
1366  INDENT_DBG_MEX(0, 0,
1367  STR(current_use_stmt.second) + " uses in (" + STR(current_use_stmt.first->index) + ") " +
1368  STR(current_use_stmt.first));
1369  }
1370  THROW_UNREACHABLE(STR(use_stmt) + " is not in the use statements of " + ToString());
1371  }
1372 #endif
1373  use_stmts[use_stmt]--;
1374  if(use_stmts[use_stmt] == 0)
1375  {
1376  use_stmts.erase(use_stmt);
1377  }
1378 }
1379 
1380 void statement_list::add_bloc(const blocRef& a)
1381 {
1382  list_of_bloc[a->number] = a;
1383 }
1384 
1386 {
1387  unsigned int mask = ALL_VISIT;
1388  (*v)(this, mask);
1389  VISIT_SC(mask, tree_node, visit(v));
1390  SEQ_VISIT_MEMBER(mask, list_of_stmt, tree_node, visit, tree_node_visitor, v);
1391  auto mend = list_of_bloc.end();
1392  for(auto i = list_of_bloc.begin(); i != mend; ++i)
1393  {
1394  VISIT_MEMBER_NAMED(list_of_bloc, mask, i->second, visit(v));
1395  }
1396 }
1397 
1399 {
1400  unsigned int mask = ALL_VISIT;
1401  (*v)(this, mask);
1402  VISIT_SC(mask, cst_node, visit(v));
1403 }
1404 
1406 {
1407  unsigned int mask = ALL_VISIT;
1408  (*v)(this, mask);
1409  VISIT_SC(mask, gimple_node, visit(v));
1410  VISIT_MEMBER(mask, op0, visit(v));
1411  VISIT_MEMBER(mask, op1, visit(v));
1412 }
1413 
1415 {
1416  unsigned int mask = ALL_VISIT;
1417  (*v)(this, mask);
1418  VISIT_SC(mask, expr_node, visit(v));
1419  VISIT_MEMBER(mask, decl, visit(v));
1420  VISIT_MEMBER(mask, init, visit(v));
1421  VISIT_MEMBER(mask, clnp, visit(v));
1422 }
1423 
1425 {
1426  unsigned int mask = ALL_VISIT;
1427  (*v)(this, mask);
1428  VISIT_SC(mask, expr_node, visit(v));
1429  VISIT_MEMBER(mask, op0, visit(v));
1430  VISIT_MEMBER(mask, op1, visit(v));
1431  VISIT_MEMBER(mask, op2, visit(v));
1432  VISIT_MEMBER(mask, op3, visit(v));
1433  VISIT_MEMBER(mask, op4, visit(v));
1434  VISIT_MEMBER(mask, op5, visit(v));
1435  VISIT_MEMBER(mask, op6, visit(v));
1436  VISIT_MEMBER(mask, op7, visit(v));
1437  VISIT_MEMBER(mask, op8, visit(v));
1438 }
1439 
1441 {
1442  unsigned int mask = ALL_VISIT;
1443  (*v)(this, mask);
1444  VISIT_SC(mask, decl_node, visit(v));
1445  VISIT_MEMBER(mask, rslt, visit(v));
1446  VISIT_MEMBER(mask, inst, visit(v));
1447  VISIT_MEMBER(mask, spcs, visit(v));
1448  VISIT_MEMBER(mask, prms, visit(v));
1449 }
1450 
1452 {
1453  unsigned int mask = ALL_VISIT;
1454  (*v)(this, mask);
1455  VISIT_SC(mask, tree_node, visit(v));
1456  VISIT_MEMBER(mask, type, visit(v));
1457  VISIT_MEMBER(mask, decl, visit(v));
1458 }
1459 
1461 {
1462  unsigned int mask = ALL_VISIT;
1463  (*v)(this, mask);
1464  VISIT_MEMBER(mask, purp, visit(v));
1465  VISIT_MEMBER(mask, valu, visit(v));
1466  VISIT_MEMBER(mask, chan, visit(v));
1467 }
1468 
1470 {
1471  unsigned int mask = ALL_VISIT;
1472  (*v)(this, mask);
1473  VISIT_SC(mask, tree_node, visit(v));
1474  SEQ_VISIT_MEMBER(mask, list_of_op, tree_node, visit, tree_node_visitor, v);
1475 }
1476 
1478 {
1479  unsigned int mask = ALL_VISIT;
1480  (*v)(this, mask);
1481  VISIT_SC(mask, tree_node, visit(v));
1482  VISIT_MEMBER(mask, body, visit(v));
1483  VISIT_MEMBER(mask, hdlr, visit(v));
1484  VISIT_MEMBER(mask, next, visit(v));
1485 }
1486 
1488 {
1489  unsigned int mask = ALL_VISIT;
1490  (*v)(this, mask);
1491  VISIT_SC(mask, decl_node, visit(v));
1492  VISIT_MEMBER(mask, tmpl_parms, visit(v));
1493  VISIT_MEMBER(mask, tmpl_args, visit(v));
1494 }
1495 
1497 {
1498  unsigned int mask = ALL_VISIT;
1499  (*v)(this, mask);
1500  VISIT_SC(mask, type_node, visit(v));
1501  SEQ_VISIT_MEMBER(mask, list_of_flds, tree_node, visit, tree_node_visitor, v);
1502  SEQ_VISIT_MEMBER(mask, list_of_fncs, tree_node, visit, tree_node_visitor, v);
1503  VISIT_MEMBER(mask, binf, visit(v));
1504 }
1505 
1506 var_decl::var_decl(unsigned int i)
1507  : decl_node(i),
1508  use_tmpl(-1),
1509  static_static_flag(false),
1510  static_flag(false),
1511  extern_flag(false),
1512  addr_taken(false),
1513  addr_not_taken(false),
1514  algn(0),
1515  used(0),
1516  register_flag(false),
1517  readonly_flag(false)
1518 {
1519 }
1520 
1522 {
1523  unsigned int mask = ALL_VISIT;
1524  (*v)(this, mask);
1525  VISIT_SC(mask, decl_node, visit(v));
1526  VISIT_SC(mask, attr, visit(v));
1527  VISIT_MEMBER(mask, init, visit(v));
1528  VISIT_MEMBER(mask, size, visit(v));
1529  VISIT_MEMBER(mask, smt_ann, visit(v));
1530 }
1531 
1533 {
1534  unsigned int mask = ALL_VISIT;
1535  (*v)(this, mask);
1536  VISIT_SC(mask, cst_node, visit(v));
1537  SEQ_VISIT_MEMBER(mask, list_of_valu, tree_node, visit, tree_node_visitor, v);
1538 }
1539 
1541 {
1542  unsigned int mask = ALL_VISIT;
1543  (*v)(this, mask);
1544  VISIT_SC(mask, type_node, visit(v));
1545  VISIT_MEMBER(mask, elts, visit(v));
1546 }
1547 
1549 {
1550  unsigned int mask = ALL_VISIT;
1551  (*v)(this, mask);
1552  VISIT_SC(mask, WeightedNode, visit(v));
1553  VISIT_MEMBER(mask, type, visit(v));
1554  VISIT_MEMBER(mask, symbol, visit(v));
1555  VISIT_MEMBER(mask, base, visit(v));
1556  VISIT_MEMBER(mask, idx, visit(v));
1557  VISIT_MEMBER(mask, step, visit(v));
1558  VISIT_MEMBER(mask, offset, visit(v));
1559  VISIT_MEMBER(mask, orig, visit(v));
1560  VISIT_MEMBER(mask, tag, visit(v));
1561 }
1562 
1564 {
1565  unsigned int mask = ALL_VISIT;
1566  (*v)(this, mask);
1567  VISIT_SC(mask, WeightedNode, visit(v));
1568  VISIT_MEMBER(mask, type, visit(v));
1569  VISIT_MEMBER(mask, base, visit(v));
1570  VISIT_MEMBER(mask, idx, visit(v));
1571  VISIT_MEMBER(mask, idx2, visit(v));
1572  VISIT_MEMBER(mask, step, visit(v));
1573  VISIT_MEMBER(mask, offset, visit(v));
1574 }
1575 
1577 {
1578  unsigned int mask = ALL_VISIT;
1579  (*v)(this, mask);
1580  VISIT_SC(mask, type_node, visit(v));
1581  VISIT_MEMBER(mask, arg, visit(v));
1582 }
1583 
1585 {
1586  unsigned int mask = ALL_VISIT;
1587  (*v)(this, mask);
1588  VISIT_SC(mask, expr_node, visit(v));
1589  VISIT_MEMBER(mask, arg, visit(v));
1590 }
1591 
1593 {
1594  unsigned int mask = ALL_VISIT;
1595  (*v)(this, mask);
1596  VISIT_SC(mask, type_node, visit(v));
1597  VISIT_MEMBER(mask, op, visit(v));
1598  VISIT_MEMBER(mask, param_packs, visit(v));
1599  VISIT_MEMBER(mask, arg, visit(v));
1600 }
1601 
1603 {
1604  unsigned int mask = ALL_VISIT;
1605  (*v)(this, mask);
1606  VISIT_SC(mask, expr_node, visit(v));
1607  VISIT_MEMBER(mask, op, visit(v));
1608  VISIT_MEMBER(mask, param_packs, visit(v));
1609  VISIT_MEMBER(mask, arg, visit(v));
1610 }
1611 
1612 #if HAVE_UNORDERED
1613 TreeNodeConstEqualTo::TreeNodeConstEqualTo()
1614 {
1615 }
1616 
1617 bool TreeNodeConstEqualTo::operator()(const tree_nodeConstRef x, const tree_nodeConstRef y) const
1618 {
1619  return x->index == y->index;
1620 }
1621 
1622 #endif
1623 
1625 
1627 {
1628  return x->index < y->index;
1629 }
1630 
1631 #if !HAVE_UNORDERED
1632 TreeNodeSorter::TreeNodeSorter() = default;
1634 {
1635  return x->index < y->index;
1636 }
1637 
1639 {
1640 }
1641 
1643 {
1644 }
1645 #endif
#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
void set_initiation_time(int time)
Definition: tree_node.cpp:836
#define CPP_STMT_NODES
void AddDefEdge(const tree_managerRef &TM, const DefEdge &def_edge)
Add a defedge.
Definition: tree_node.cpp:998
This struct specifies a point-to solution.
Definition: tree_node.hpp:1001
const TreeNodeSet CGetDefStmts() const
Return the set of definition statements.
Definition: tree_node.cpp:1274
tree_nodeRef attributes
Definition: tree_node.hpp:912
const TreeNodeMap< size_t > & CGetUseStmts() const
Return the use stmts.
Definition: tree_node.cpp:1343
const DefEdgeList & CGetDefEdgesList() const
Return the list of def edges.
Definition: tree_node.cpp:1011
tree_nodeRef size
size field holds the size of datum, in bits.
Definition: tree_node.hpp:3678
() 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
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
bool operator()(const tree_nodeRef &x, const tree_nodeRef &y) const
Compare position of two const tree nodes.
Definition: tree_node.cpp:1633
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:651
const tree_nodeRef CGetDefStmt() const
Return the def stmt (checking that is unique)
Definition: tree_node.cpp:1256
() label_decl()() modop_expr() new_expr() placeholder_expr() template_id_expr(vec_new_expr)) BOOST_PP_SEQ_FOR_EACH(VISIT_TREE_NODE_MACRO
bool is_destructor() const
Return true if there is TOK_DESTRUCTOR in the list of attributes.
Definition: tree_node.cpp:222
tree_nodeRef unql
unql field, in any member of such a chain, points to the start of the chain.
Definition: tree_node.hpp:1343
virtual ~srcp()
Destructor.
File containing functions and utilities to support the printing of debug messagges.
decl_node(unsigned int i)
Constructor.
Definition: tree_node.cpp:270
#define VISIT_SC(mask, superclass, method)
macro used to visit the super class
Definition: visitor.hpp:55
tree_nodeRef tmpl_parms
tmpl_parms holds template parameters It is a TREE_LIST, his VALU field is a TREE_VEC whose LIST_OF_OP...
Definition: tree_node.hpp:2828
bool is_constructor()
return true if is a declaration of constructor
Definition: tree_node.cpp:782
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
std::string ToString() const
Print this node as string in gimple format.
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1190
bool anything
True if it is not possible to determine where the pointer points to.
Definition: tree_node.hpp:1004
friend std::ostream & operator<<(std::ostream &os, const tree_node *tn)
Friend definition of the << operator.
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:438
tree_nodeRef op1
The second operand of the binary expression.
Definition: tree_node.hpp:3024
char base
This version is stamped on May 10, 2016.
Definition: nussinov.c:24
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:696
tree_nodeRef name
name field contains an identifier_node used to represent a name.
Definition: tree_node.hpp:883
#define MISCELLANEOUS_OBJ_TREE_NODES
struct definition of the source position.
Definition: tree_node.hpp:832
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1451
bool is_fully_resolved() const
this function check if the point-to set resolved w.r.t.
Definition: tree_node.cpp:543
tree_nodeRef orig
For any sort of a ..._DECL node, this points to the original (abstract) decl node which this decl is ...
Definition: tree_node.hpp:899
DefEdgeList list_of_def_edge
store the list pairs: <def, edge>.
Definition: tree_node.hpp:3759
tree_nodeRef size
size field contains a tree that is an expression for the size in bits.
Definition: tree_node.hpp:1349
This class manages the tree structures extracted from the raw file.
TreeNodeSet def_stmts
in case ssa_name is not volatile the statement which defines it; statements could be more than one be...
Definition: tree_node.hpp:4533
tree_nodeRef var
var is the variable being referenced (macro SSA_NAME_VAR).
Definition: tree_node.hpp:4543
bool is_a_singleton() const
this function check if the point-to set is a singleton or not
Definition: tree_node.cpp:538
gimple_phi(unsigned int i)
Constructor.
Definition: tree_node.cpp:982
static std::string GetString(const enum kind k)
Given a kind, return the corresponding string.
Definition: tree_node.cpp:120
identifier_node(unsigned int node_id, std::string _strg, tree_manager *TM)
constructors
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1532
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:865
void visit(tree_node_visitor *const v) const override
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:340
std::list< DefEdge > DefEdgeList
The type of the def edge list.
Definition: tree_node.hpp:3753
virtual void visit(tree_node_visitor *const v) const
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:264
tree_nodeRef get_field(integer_cst_t offset)
returns tree_nodeRef of the field specified by offset
Definition: tree_node.cpp:1158
#define DECL_NODE_TREE_NODES
tree_nodeRef mngl
mngl field contains the name of the object as the assembler will see it.
Definition: tree_node.hpp:890
tree_nodeRef size
size field holds the size of datum, in bits.
Definition: tree_node.hpp:5704
#define PANDA_EXTENSION_TREE_NODES
bool is_private() const
returns true if there is a TOK_PRIVATE in the list of attributes
Definition: tree_node.cpp:252
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:912
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.
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1521
tree_nodeRef fn
fn field is the initial declaration for this function declaration
Definition: tree_node.hpp:2815
struct definition of the unary node structures.
Definition: tree_node.hpp:1177
TreeNodeSorter()
Constructor.
tree_nodeRef op0
The first operand of the binary expression.
Definition: tree_node.hpp:3021
tree_nodeRef scpe
The function to which this gimple_node belongs.
Definition: tree_node.hpp:1131
virtual void visit(tree_node_visitor *const v) const
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:211
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:585
struct definition of the ternary node structures.
Definition: tree_node.hpp:1239
#define min(x, y)
bool is_private()
returns true if is a declaration of a private function
Definition: tree_node.cpp:801
tree_nodeRef tmpl_args
tmpl_args holds template instantiations It is a TREE_VEC whose LIST_OF_OP holds template instantiatio...
Definition: tree_node.hpp:2835
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1548
struct definition of the function_type tree node.
Definition: tree_node.hpp:2960
std::vector< tree_nodeRef > args
The arguments of the gimple_call.
Definition: tree_node.hpp:1968
Node not yet supported.
Definition: exceptions.hpp:323
tree_nodeRef argt
argt field is the type in which the argument is actually passed, which may be different from its type...
Definition: tree_node.hpp:3672
void AddDefStmt(const tree_nodeRef &def)
Add a def stmt.
Definition: tree_node.cpp:1332
Data structure describing a basic block at tree level.
tree_nodeRef chan
chan field: the decls in one binding context are chained through this field.
Definition: tree_node.hpp:936
bool is_public()
returns true if is a declaration of a public function
Definition: tree_node.cpp:796
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:763
TreeNodeSet()
Constructor.
Definition: tree_node.cpp:1638
bool is_call() const
returns true if there is a TOK_CALL in the list of attributes
Definition: tree_node.cpp:232
void AddUseStmt(const tree_nodeRef &use_stmt)
Add use of this SSA.
Definition: tree_node.cpp:1279
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:855
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:492
Abstract pure class for the tree structure.
Definition: tree_node.hpp:139
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.
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1182
call_expr(unsigned int i)
constructor
Definition: tree_node.cpp:594
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
std::vector< tree_nodeRef > args
The arguments of the call_expr.
Definition: tree_node.hpp:1882
#define KIND_NAME(r, data, elem)
#define max
Definition: backprop.h:17
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1496
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1243
void AddArg(const tree_nodeRef &arg)
Add an argument to the list of arguments.
Definition: tree_node.cpp:628
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:872
ssa_name(unsigned int i)
constructor
Definition: tree_node.cpp:1232
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:603
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:667
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:926
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1576
tree_nodeRef scpe
context/scope of the type object.
Definition: tree_node.hpp:1355
tree_nodeRef memuse
whole memory operand use
Definition: tree_node.hpp:1087
gimple_assign(unsigned int i)
constructor
Definition: tree_node.cpp:850
bool is_protected() const
returns true if there is a TOK_PROTECTED in the list of attributes
Definition: tree_node.cpp:247
TreeNodeSet vovers
vovers of this statement
Definition: tree_node.hpp:1112
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Definition: exceptions.hpp:292
virtual ~PointToSolution()
Destructor.
() label_decl() using_decl(translation_unit_decl)) BOOST_PP_SEQ_FOR_EACH(VISIT_TREE_NODE_MACRO
WeightedNode(unsigned int i)
Constructor.
Definition: tree_node.cpp:198
bool ipa_escaped
True if the points to includes the IPA escaped solution.
Definition: tree_node.hpp:1010
struct definition of the Quaternary node structures.
Definition: tree_node.hpp:1276
TreeNodeConstSorter()
Constructor.
std::set< Key, Compare, Alloc > OrderedSetStd
Definition: custom_set.hpp:59
unsigned int bb_index
The basic block to which this gimple_node belongs.
Definition: tree_node.hpp:1134
TreeNodeMap< size_t > use_stmts
The uses of this SSA: it is a map since the same SSA can be used multiple times in the same statement...
Definition: tree_node.hpp:4529
size_t CGetNumberUses() const
Return the number of uses.
Definition: tree_node.cpp:1348
#define SEQ_VISIT_MEMBER(mask, seq, seqbasetype, method, visitor_type, visitor_obj)
macro used to traverse non empty sequences
Definition: visitor.hpp:64
void visit(tree_node_visitor *const v) const override
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:282
#define GIMPLE_NODES
Definition: tree_common.hpp:96
static const uint32_t k[]
Definition: sha-256.c:22
This struct specifies super class for constant nodes.
Definition: tree_node.hpp:1431
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1487
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:972
var_decl(unsigned int i)
constructor
Definition: tree_node.cpp:1506
void AddArg(const tree_nodeRef &arg)
Add an argument to the list of arguments.
Definition: tree_node.cpp:598
void SetDefEdgeList(const tree_managerRef &TM, DefEdgeList new_list_of_def_edge)
Set the def edge list removing the ond one.
Definition: tree_node.cpp:1044
void SetVdef(const tree_nodeRef &vdef)
Add a vdef.
Definition: tree_node.cpp:316
bool escaped
True if the points to includes the local escaped solution.
Definition: tree_node.hpp:1007
parm_decl(unsigned int i)
constructor
Definition: tree_node.cpp:968
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:986
#define QUATERNARY_EXPRESSION_TREE_NODES
Definition: tree_common.hpp:87
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:431
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
bool AddVuse(const tree_nodeRef &vuse)
Add a vuse.
Definition: tree_node.cpp:324
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:683
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1120
bool is_member() const
Return true if there is TOK_MEMBER in the list of attributes.
Definition: tree_node.cpp:227
tree_nodeRef body
body field is the saved representation of the body of the entire function.
Definition: tree_node.hpp:2870
void visit(tree_node_visitor *const v) const override
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:202
kind
bool simple_pipeline
True if the pipeline does not contain any unbounded operation.
Definition: tree_node.hpp:2789
std::pair< tree_nodeRef, unsigned int > DefEdge
The type of the def edge.
Definition: tree_node.hpp:3750
aggr_init_expr(unsigned int i)
constructor
Definition: tree_node.cpp:611
tree_nodeRef GetTreeReindex(const unsigned int i)
Return a tree_reindex wrapping the i-th tree_node.
#define MISCELLANEOUS_EXPR_TREE_NODES
Definition: tree_common.hpp:89
void visit(tree_node_visitor *const v) const override
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:364
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1385
struct definition of the function_decl tree node.
Definition: tree_node.hpp:3179
unsigned offset[NUM_VERTICES+1]
Definition: graph.h:3
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1563
struct definition of the field_decl tree node.
Definition: tree_node.hpp:2640
#define GET_CONST_NODE(t)
Definition: tree_node.hpp:347
tree_nodeRef predicate
The predicate.
Definition: tree_node.hpp:3027
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:951
void visit(tree_node_visitor *const v) const override
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:404
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:959
integer_cst_t offset()
Definition: tree_node.cpp:715
Classes specification of the tree_node data structures.
#define VISIT_MEMBER(mask, ref_obj, method)
Definition: visitor.hpp:62
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1398
void SetSSAUsesComputed()
Set that uses of ssa have been computed.
Definition: tree_node.cpp:1081
bool is_simple_pipeline()
Definition: tree_node.cpp:821
#define TYPE_NODE_TREE_NODES
#define ALL_VISIT
constant used to allow member visit
Definition: visitor.hpp:71
struct definition of the field attr on function_decl, field_decl, var_decl tree node.
Definition: tree_node.hpp:774
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1215
tree_nodeRef memdef
whole memory operand def
Definition: tree_node.hpp:1090
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1405
A set of tree node.
Definition: tree_node.hpp:294
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1223
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1113
PointToSolutionRef use_set
point to solution
Definition: tree_node.hpp:4604
This file collects some utility functions.
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1540
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
TreeVocabularyTokenTypes_TokenEnum
std::string ToString() const
Print this point-to solution.
Definition: tree_node.cpp:548
bool is_protected()
returns true if is a declaration of a protected function
Definition: tree_node.cpp:806
#define VISIT_TREE_NODE_MACRO(r, data, elem)
Autoheader include.
Definition: tree_node.cpp:76
Definition: APInt.hpp:53
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:943
void AddArg(const tree_nodeRef &a)
Add a parameter to the list of the paramters.
Definition: tree_node.cpp:777
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1440
bool operator_flag
it is true when the function_decl is an operator
Definition: tree_node.hpp:2765
virtual void visit(tree_node_visitor *const v) const
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:578
#define VISIT_MEMBER_NAMED(ref_obj_name, mask, ref_obj, method)
macro used to visit a non null member
Definition: visitor.hpp:59
void init(int bucket[BUCKETSIZE])
Definition: sort.c:42
int initiation_time
Used for pipelined with unbounded operations.
Definition: tree_node.hpp:2792
struct definition of the common part of an expression
Definition: tree_node.hpp:973
void add_bloc(const blocRef &a)
Add a value to list of basic block.
Definition: tree_node.cpp:1380
bool virtual_flag
flag for virtual SSA
Definition: tree_node.hpp:4556
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:619
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1460
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:706
bool is_public() const
returns true if there is a TOK_PUBLIC in the list of attributes
Definition: tree_node.cpp:242
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1091
bool nonlocal
True if the points to includes any global memory.
Definition: tree_node.hpp:1013
bool is_destructor()
Return true if is a declaration of Destructor.
Definition: tree_node.cpp:786
tree_nodeRef init
init field holds the value to initialize a variable to.
Definition: tree_node.hpp:5698
PointToSolutionRef clobbered_set
The clobbered set of this gimple node.
Definition: tree_node.hpp:1128
void RemoveDefEdge(const tree_managerRef &TM, const DefEdge &to_be_removed)
Remove a defedge.
Definition: tree_node.cpp:1056
struct definition of the type node structures.
Definition: tree_node.hpp:1318
BOOST_PP_SEQ_FOR_EACH(VISIT_TREE_NODE_MACRO, tree_node,(ctor_initializer)(trait_expr)) BOOST_PP_SEQ_FOR_EACH(VISIT_TREE_NODE_MACRO
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:643
Class specification of the tree_reindex support class.
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1602
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:919
gimple_call(unsigned int i)
constructor
Definition: tree_node.cpp:615
function_decl(unsigned int i)
constructor
Definition: tree_node.cpp:736
This struct specifies the call_expr node.
Definition: tree_node.hpp:1873
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1414
type_node(unsigned int i)
constructor
Definition: tree_node.cpp:394
void add_access_binf(const tree_nodeRef &binf, TreeVocabularyTokenTypes_TokenEnum access)
Add a pair <access, binf> to the list of access binf.
Definition: tree_node.cpp:487
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1207
tree_nodeRef min
minimum values this SSA may reach
Definition: tree_node.hpp:4592
tree_node(unsigned int i)
Constructor.
Definition: tree_node.hpp:151
bool updated_ssa_uses
True if SSA uses are updated.
Definition: tree_node.hpp:3762
void visit(tree_node_visitor *const v) const override
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:383
int get_initiation_time()
Definition: tree_node.cpp:831
gimple_node(unsigned int i)
Constructor.
Definition: tree_node.cpp:306
struct definition of the common part of a gimple with virtual operands
Definition: tree_node.hpp:1078
#define UNARY_EXPRESSION_TREE_NODES
Definition: tree_common.hpp:60
bool operator()(const tree_nodeConstRef &x, const tree_nodeConstRef &y) const
Compare position of two const tree nodes.
Definition: tree_node.cpp:1626
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1424
void set_pipelining(bool v)
Definition: tree_node.cpp:816
T * get() const
Definition: refcount.hpp:169
#define THROW_ERROR_CODE(code, str_expr)
helper function used to throw an error with a code error
Definition: exceptions.hpp:266
PointToSolutionRef use_set
The point-to set used by this gimple node.
Definition: tree_node.hpp:1125
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1106
tree node writer.
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1477
void visit(tree_node_visitor *const v) const override
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:356
bool AddVover(const tree_nodeRef &vover)
Add a vover.
Definition: tree_node.cpp:332
PointToSolution()
Constructor.
Definition: tree_node.cpp:499
tree_nodeRef type
type field holds the data type of the object, when relevant.
Definition: tree_node.hpp:907
std::string get_maybe_name() const
returns the name of the struct represented by this node if there is one else returns the string #UNKN...
Definition: tree_node.cpp:1136
bool is_bitfield() const
returns true if there is a TOK_BITFIELD in the list of attributes
Definition: tree_node.cpp:257
bool pipeline_enabled
True if pipelining is enabled for the function.
Definition: tree_node.hpp:2786
bool null
True if the points to includes nothing.
Definition: tree_node.hpp:1016
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:675
refcount< tree_node > tree_nodeRef
RefCount type definition of the tree_node class structure.
Definition: tree_node.hpp:212
string input_name
Definition: lenet_tvm.py:9
std::string strg
Store the identifier string associated with the identifier_node.
Definition: tree_node.hpp:3189
gimple_predict(unsigned int index)
Constructor.
Definition: tree_node.cpp:1087
TreeNodeConstSet()
Constructor.
Definition: tree_node.cpp:1642
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:660
TreeNodeSet vuses
vuses of this statement
Definition: tree_node.hpp:1102
tree_nodeRef vdef
vdef of this statement
Definition: tree_node.hpp:1093
#define NAME_KIND(r, data, elem)
void visit(tree_node_visitor *const v) const override
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:415
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:841
#define TERNARY_EXPRESSION_TREE_NODES
Definition: tree_common.hpp:82
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1098
x
Return the smallest n such that 2^n >= _x.
static integer_cst_t GetConstValue(const tree_nodeConstRef &tn, bool is_signed=true)
Get value from integer constant.
void ReplaceDefEdge(const tree_managerRef &TM, const DefEdge &old_def_edge, const DefEdge &new_def_edge)
Replace a defedge.
Definition: tree_node.cpp:1016
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:724
std::vector< tree_nodeRef > variables
Set of variables that this pointer may point to.
Definition: tree_node.hpp:1019
void visit(tree_node_visitor *const v) const override
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:423
tree_nodeRef type
starting from GCC 4.7.2 ssa_name has a type
Definition: tree_node.hpp:4540
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:935
#define BINARY_EXPRESSION_TREE_NODES
Definition: tree_common.hpp:68
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:465
struct definition of the binary node structures.
Definition: tree_node.hpp:1206
tree_nodeRef smt_ann
symbol_memory_tag annotation
Definition: tree_node.hpp:3707
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:880
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1200
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1592
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:474
virtual ~attr()
Destructor.
void RemoveUse(const tree_nodeRef &use_stmt)
Remove a use of this SSA.
Definition: tree_node.cpp:1358
bool is_operator() const
returns true if is a declaration of an operator
Definition: tree_node.cpp:791
tree_nodeRef smt_ann
symbol_memory_tag annotation
Definition: tree_node.hpp:5737
void add_identifier_node(unsigned int nodeID, const std::string &str)
Add an identifier_node to the corresponding unique table.
bool is_pipelined()
returns true if is a declaration of a pipelined function
Definition: tree_node.cpp:811
void Add(const std::string &variable)
Add a symbolic variable to this point to set.
Definition: tree_node.cpp:505
void visit(tree_node_visitor *const v) const override
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:297
tree_nodeRef scpe
scope declaration
Definition: tree_node.hpp:910
tree_nodeRef inline_body
java inline body
Definition: tree_node.hpp:2875
bool is_constructor() const
Return true if there is TOK_CONSTRUCTOR in the list of attributes.
Definition: tree_node.cpp:217
tree_nodeRef max
maximum values this SSA may reach
Definition: tree_node.hpp:4595
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:633
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.
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1584
void visit(tree_node_visitor *const v) const override
virtual function used to traverse the tree_node data structure.
Definition: tree_node.cpp:373
tree_nodeRef fn
fn is the operand 0 of the call expression: this is the function
Definition: tree_node.hpp:1965
#define CONST_OBJ_TREE_NODES
void SetDefStmt(const tree_nodeRef &def)
Set the def stmt erasing the old definitions.
Definition: tree_node.cpp:1337
bool is_new() const
returns true if there is a TOK_NEW in the list of attributes
Definition: tree_node.cpp:237
void set_simple_pipeline(bool v)
Definition: tree_node.cpp:826
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:447
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
Definition: tree_node.cpp:1469
#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