65 #define DECLARATION (2) // All nodes including declarations are duplicated (not function_decl) 67 #define CREATE_TREE_NODE_CASE_BODY(tree_node_name, node_id) \ 69 (node_id) = TM->new_tree_node_id(); \ 70 remap.insert({tn->index, (node_id)}); \ 71 auto tnn = new tree_node_name(node_id); \ 72 tree_nodeRef cur = tree_nodeRef(tnn); \ 73 if(dynamic_cast<function_decl*>(tnn)) \ 75 TM->add_function(node_id, cur); \ 77 TM->AddTreeNode(node_id, cur); \ 78 curr_tree_node_ptr = tnn; \ 81 curr_tree_node_ptr = nullptr; \ 82 source_tn = tree_nodeRef(); \ 86 #define RET_NODE_ID_CASE_BODY(tree_node_name, node_id) \ 88 if(remap.find(tn->index) != remap.end()) \ 89 (node_id) = remap.find(tn->index)->second; \ 91 (node_id) = tn->index; \ 100 remap_bbi(_remap_bbi),
102 remap_loop_id(_remap_loop_id),
105 TM(_AppM->get_tree_manager()),
106 curr_tree_node_ptr(nullptr),
118 unsigned int node_id = 0
U;
126 case array_range_ref_K:
148 case bit_field_ref_K:
152 case bit_ior_concat_expr_K:
166 case aggr_init_expr_K:
172 case case_label_expr_K:
178 case ceil_div_expr_K:
180 case ceil_mod_expr_K:
186 case type_pack_expansion_K:
188 case cleanup_point_expr_K:
196 case component_ref_K:
198 case compound_expr_K:
213 case ctor_initializer_K:
215 case eh_filter_expr_K:
217 case enumeral_type_K:
223 case exact_div_expr_K:
236 case fix_ceil_expr_K:
238 case fix_floor_expr_K:
240 case fix_round_expr_K:
242 case fix_trunc_expr_K:
246 case floor_div_expr_K:
248 case floor_mod_expr_K:
250 case function_decl_K:
255 case function_type_K:
262 case gimple_assign_K:
273 case goto_subroutine_K:
279 case imagpart_expr_K:
283 case misaligned_indirect_ref_K:
331 case mult_highpart_expr_K:
333 case namespace_decl_K:
341 case non_lvalue_expr_K:
365 case pointer_plus_expr_K:
369 case postdecrement_expr_K:
371 case postincrement_expr_K:
373 case predecrement_expr_K:
375 case preincrement_expr_K:
377 case qual_union_type_K:
387 case realpart_expr_K:
393 case reduc_max_expr_K:
395 case reduc_min_expr_K:
397 case reduc_plus_expr_K:
399 case reference_expr_K:
401 case reference_type_K:
403 case reinterpret_cast_expr_K:
412 case gimple_return_K:
416 case round_div_expr_K:
418 case round_mod_expr_K:
442 case statement_list_K:
447 case static_cast_expr_K:
451 case gimple_switch_K:
455 case target_mem_ref_K:
457 case target_mem_ref461_K:
461 case template_decl_K:
466 case template_id_expr_K:
468 case template_parm_index_K:
470 case template_type_parm_K:
472 case ternary_plus_expr_K:
474 case ternary_pm_expr_K:
476 case ternary_mp_expr_K:
478 case ternary_mm_expr_K:
482 case translation_unit_decl_K:
488 case trunc_div_expr_K:
490 case trunc_mod_expr_K:
492 case truth_and_expr_K:
494 case truth_andif_expr_K:
496 case truth_not_expr_K:
498 case truth_or_expr_K:
500 case truth_orif_expr_K:
502 case truth_xor_expr_K:
506 case try_catch_expr_K:
512 case typename_type_K:
526 case unordered_expr_K:
536 const auto vd = GetPointerS<const var_decl>(tn);
550 const auto new_tn = GetPointerS<var_decl>(
TM->GetTreeNode(node_id));
551 new_tn->scpe = GetPointerS<const decl_node>(
GET_CONST_NODE(new_tn->scpe))->scpe;
562 case vec_cond_expr_K:
564 case vec_perm_expr_K:
566 case dot_prod_expr_K:
568 case vec_lshift_expr_K:
570 case vec_rshift_expr_K:
572 case widen_mult_hi_expr_K:
574 case widen_mult_lo_expr_K:
576 case vec_unpack_hi_expr_K:
578 case vec_unpack_lo_expr_K:
580 case vec_unpack_float_hi_expr_K:
582 case vec_unpack_float_lo_expr_K:
584 case vec_pack_trunc_expr_K:
586 case vec_pack_sat_expr_K:
588 case vec_pack_fix_trunc_expr_K:
590 case vec_extracteven_expr_K:
592 case vec_extractodd_expr_K:
594 case vec_interleavehigh_expr_K:
596 case vec_interleavelow_expr_K:
602 case type_argument_pack_K:
604 case nontype_argument_pack_K:
606 case expr_pack_expansion_K:
610 case view_convert_expr_K:
612 case gimple_predict_K:
618 case with_cleanup_expr_K:
620 case with_size_expr_K:
626 case gimple_pragma_K:
630 case omp_atomic_pragma_K:
632 case omp_for_pragma_K:
634 case omp_simd_pragma_K:
636 case omp_declare_simd_pragma_K:
638 case omp_parallel_pragma_K:
640 case omp_sections_pragma_K:
642 case omp_parallel_sections_pragma_K:
644 case omp_section_pragma_K:
648 case call_hw_pragma_K:
650 case call_point_hw_pragma_K:
654 case profiling_pragma_K:
656 case blackbox_pragma_K:
658 case statistical_profiling_K:
664 case identifier_node_K:
666 case widen_sum_expr_K:
668 case widen_mult_expr_K:
672 case omp_target_pragma_K:
674 case omp_task_pragma_K:
676 case omp_critical_pragma_K:
678 case gimple_multi_way_if_K:
680 case extract_bit_expr_K:
682 case sat_plus_expr_K:
684 case sat_minus_expr_K:
690 case extractvalue_expr_K:
692 case insertvalue_expr_K:
694 case extractelement_expr_K:
696 case insertelement_expr_K:
720 return t.second ?
remap_bbi++ : t.first->second;
735 void tree_node_dup::operator()(
const tree_node* obj,
unsigned int&)
740 void tree_node_dup::operator()(
const tree_reindex* obj,
unsigned int&)
745 void tree_node_dup::operator()(
const attr* obj,
unsigned int& mask)
748 tree_node_mask::operator()(obj, mask);
753 (TOK_NEW)(TOK_DELETE)(TOK_ASSIGN)(TOK_MEMBER)(TOK_PUBLIC)(TOK_PROTECTED)(TOK_PRIVATE)(TOK_NORETURN)(TOK_VOLATILE)( \ 754 TOK_NOINLINE)(TOK_ALWAYS_INLINE)(TOK_USED)(TOK_UNUSED)(TOK_CONST)(TOK_TRANSPARENT_UNION)(TOK_CONSTRUCTOR)( \ 755 TOK_DESTRUCTOR)(TOK_MODE)(TOK_SECTION)(TOK_ALIGNED)(TOK_WEAK)(TOK_ALIAS)(TOK_NO_INSTRUMENT_FUNCTION)( \ 756 TOK_MALLOC)(TOK_NO_STACK_LIMIT)(TOK_PURE)(TOK_DEPRECATED)(TOK_VECTOR_SIZE)(TOK_VISIBILITY)(TOK_TLS_MODEL)( \ 757 TOK_NONNULL)(TOK_NOTHROW)(TOK_MAY_ALIAS)(TOK_WARN_UNUSED_RESULT)(TOK_FORMAT)(TOK_FORMAT_ARG)(TOK_NULL)( \ 758 TOK_GLOBAL_INIT)(TOK_GLOBAL_FINI)(TOK_CONVERSION)(TOK_VIRTUAL)(TOK_LSHIFT)(TOK_MUTABLE)(TOK_PSEUDO_TMPL)( \ 759 TOK_VECNEW)(TOK_VECDELETE)(TOK_POS)(TOK_NEG)(TOK_ADDR)(TOK_DEREF)(TOK_LNOT)(TOK_NOT)(TOK_PREINC)(TOK_PREDEC)( \ 760 TOK_PLUSASSIGN)(TOK_PLUS)(TOK_MINUSASSIGN)(TOK_MINUS)(TOK_MULTASSIGN)(TOK_MULT)(TOK_DIVASSIGN)(TOK_DIV)( \ 761 TOK_MODASSIGN)(TOK_MOD)(TOK_ANDASSIGN)(TOK_AND)(TOK_ORASSIGN)(TOK_OR)(TOK_XORASSIGN)(TOK_XOR)( \ 762 TOK_LSHIFTASSIGN)(TOK_RSHIFTASSIGN)(TOK_RSHIFT)(TOK_EQ)(TOK_NE)(TOK_LT)(TOK_GT)(TOK_LE)(TOK_GE)(TOK_LAND)( \ 763 TOK_LOR)(TOK_COMPOUND)(TOK_MEMREF)(TOK_REF)(TOK_SUBS)(TOK_POSTINC)(TOK_POSTDEC)(TOK_CALL)(TOK_THUNK)( \ 764 TOK_THIS_ADJUSTING)(TOK_RESULT_ADJUSTING)(TOK_BITFIELD) 765 #define ATTR_MACRO(r, data, elem) \ 766 attr_p = GetPointer<attr>(source_tn)->list_attr.find(TOK(elem)) != GetPointer<attr>(source_tn)->list_attr.end(); \ 768 dynamic_cast<attr*>(curr_tree_node_ptr)->list_attr.insert(TOK(elem)); 775 #define SET_NODE_ID(field, type) \ 776 if(GetPointer<type>(source_tn)->field) \ 778 unsigned int node_id = GET_INDEX_NODE(GetPointer<type>(source_tn)->field); \ 779 if(remap.find(node_id) != remap.end()) \ 781 node_id = remap.find(node_id)->second; \ 785 tree_node* saved_curr_tree_node_ptr = curr_tree_node_ptr; \ 786 tree_nodeRef saved_source_tn = source_tn; \ 787 node_id = create_tree_node(GET_NODE(GetPointer<type>(source_tn)->field), mode); \ 788 curr_tree_node_ptr = saved_curr_tree_node_ptr; \ 789 source_tn = saved_source_tn; \ 791 dynamic_cast<type*>(curr_tree_node_ptr)->field = TM->GetTreeReindex(node_id); \ 794 #define SEQ_SET_NODE_ID(list_field, type) \ 795 if(!GetPointer<type>(source_tn)->list_field.empty()) \ 797 for(auto const& field : GetPointer<type>(source_tn)->list_field) \ 799 unsigned int node_id = field->index; \ 800 if(remap.find(node_id) != remap.end()) \ 801 node_id = remap.find(node_id)->second; \ 804 tree_node* saved_curr_tree_node_ptr = curr_tree_node_ptr; \ 805 tree_nodeRef saved_source_tn = source_tn; \ 806 node_id = create_tree_node(GET_NODE(field), mode); \ 807 curr_tree_node_ptr = saved_curr_tree_node_ptr; \ 808 source_tn = saved_source_tn; \ 810 dynamic_cast<type*>(curr_tree_node_ptr)->list_field.push_back(TM->GetTreeReindex(node_id)); \ 814 #define SET_SET_NODE_ID(list_field, type) \ 815 if(!GetPointer<type>(source_tn)->list_field.empty()) \ 817 for(const auto& i : GetPointer<type>(source_tn)->list_field) \ 819 unsigned int node_id = GET_INDEX_NODE(i); \ 820 if(remap.find(node_id) != remap.end()) \ 821 node_id = remap.find(node_id)->second; \ 824 tree_node* saved_curr_tree_node_ptr = curr_tree_node_ptr; \ 825 tree_nodeRef saved_source_tn = source_tn; \ 826 node_id = create_tree_node(GET_NODE(i), mode); \ 827 curr_tree_node_ptr = saved_curr_tree_node_ptr; \ 828 source_tn = saved_source_tn; \ 830 dynamic_cast<type*>(curr_tree_node_ptr)->list_field.insert(TM->GetTreeReindex(node_id)); \ 834 #define LSEQ_SET_NODE_ID(list_field, type) \ 835 if(!GetPointer<type>(source_tn)->list_field.empty()) \ 837 std::list<tree_nodeRef>::const_iterator vend = GetPointer<type>(source_tn)->list_field.end(); \ 838 for(std::list<tree_nodeRef>::const_iterator i = GetPointer<type>(source_tn)->list_field.begin(); i != vend; ++i) \ 840 unsigned int node_id = GET_INDEX_NODE(*i); \ 841 if(remap.find(node_id) != remap.end()) \ 842 node_id = remap.find(node_id)->second; \ 845 tree_node* saved_curr_tree_node_ptr = curr_tree_node_ptr; \ 846 tree_nodeRef saved_source_tn = source_tn; \ 847 node_id = create_tree_node(GET_NODE(*i), mode); \ 848 curr_tree_node_ptr = saved_curr_tree_node_ptr; \ 849 source_tn = saved_source_tn; \ 851 dynamic_cast<type*>(curr_tree_node_ptr)->list_field.push_back(TM->GetTreeReindex(node_id)); \ 855 #define SET_VALUE(field, type) (dynamic_cast<type*>(curr_tree_node_ptr)->field = GetPointer<type>(source_tn)->field) 857 void tree_node_dup::operator()(
const srcp* obj,
unsigned int& mask)
860 tree_node_mask::operator()(obj, mask);
866 void tree_node_dup::operator()(
const WeightedNode* obj,
unsigned int& mask)
869 tree_node_mask::operator()(obj, mask);
872 void tree_node_dup::operator()(
const decl_node* obj,
unsigned int& mask)
875 tree_node_mask::operator()(obj, mask);
892 void tree_node_dup::operator()(
const expr_node* obj,
unsigned int& mask)
895 tree_node_mask::operator()(obj, mask);
899 void tree_node_dup::operator()(
const gimple_node* obj,
unsigned int& mask)
901 tree_node_mask::operator()(obj, mask);
924 void tree_node_dup::operator()(
const unary_expr* obj,
unsigned int& mask)
927 tree_node_mask::operator()(obj, mask);
931 void tree_node_dup::operator()(
const binary_expr* obj,
unsigned int& mask)
934 tree_node_mask::operator()(obj, mask);
939 void tree_node_dup::operator()(
const ternary_expr* obj,
unsigned int& mask)
942 tree_node_mask::operator()(obj, mask);
948 void tree_node_dup::operator()(
const quaternary_expr* obj,
unsigned int& mask)
951 tree_node_mask::operator()(obj, mask);
958 void tree_node_dup::operator()(
const type_node* obj,
unsigned int& mask)
961 tree_node_mask::operator()(obj, mask);
972 void tree_node_dup::operator()(
const memory_tag* obj,
unsigned int& mask)
975 tree_node_mask::operator()(obj, mask);
979 void tree_node_dup::operator()(
const cst_node* obj,
unsigned int& mask)
982 tree_node_mask::operator()(obj, mask);
986 void tree_node_dup::operator()(
const error_mark* obj,
unsigned int& mask)
989 tree_node_mask::operator()(obj, mask);
992 void tree_node_dup::operator()(
const array_type* obj,
unsigned int& mask)
995 tree_node_mask::operator()(obj, mask);
1000 void tree_node_dup::operator()(
const gimple_asm* obj,
unsigned int& mask)
1003 tree_node_mask::operator()(obj, mask);
1011 void tree_node_dup::operator()(
const baselink* obj,
unsigned int& mask)
1014 tree_node_mask::operator()(obj, mask);
1018 void tree_node_dup::operator()(
const gimple_bind* obj,
unsigned int& mask)
1021 tree_node_mask::operator()(obj, mask);
1026 void tree_node_dup::operator()(
const binfo* obj,
unsigned int& mask)
1029 tree_node_mask::operator()(obj, mask);
1033 if(!GetPointer<binfo>(
source_tn)->list_of_access_binf.empty())
1035 auto vend = GetPointer<binfo>(
source_tn)->list_of_access_binf.end();
1036 for(
auto i = GetPointer<binfo>(
source_tn)->list_of_access_binf.begin(); i != vend; ++i)
1040 node_id =
remap.find(node_id)->second;
1046 void tree_node_dup::operator()(
const block* obj,
unsigned int& mask)
1049 tree_node_mask::operator()(obj, mask);
1054 void tree_node_dup::operator()(
const call_expr* obj,
unsigned int& mask)
1057 tree_node_mask::operator()(obj, mask);
1062 void tree_node_dup::operator()(
const aggr_init_expr* obj,
unsigned int& mask)
1065 tree_node_mask::operator()(obj, mask);
1069 void tree_node_dup::operator()(
const gimple_call* obj,
unsigned int& mask)
1072 tree_node_mask::operator()(obj, mask);
1089 void tree_node_dup::operator()(
const case_label_expr* obj,
unsigned int& mask)
1092 tree_node_mask::operator()(obj, mask);
1099 void tree_node_dup::operator()(
const cast_expr* obj,
unsigned int& mask)
1102 tree_node_mask::operator()(obj, mask);
1106 void tree_node_dup::operator()(
const complex_cst* obj,
unsigned int& mask)
1109 tree_node_mask::operator()(obj, mask);
1114 void tree_node_dup::operator()(
const complex_type* obj,
unsigned int& mask)
1117 tree_node_mask::operator()(obj, mask);
1122 void tree_node_dup::operator()(
const gimple_cond* obj,
unsigned int& mask)
1125 tree_node_mask::operator()(obj, mask);
1129 void tree_node_dup::operator()(
const const_decl* obj,
unsigned int& mask)
1132 tree_node_mask::operator()(obj, mask);
1136 void tree_node_dup::operator()(
const constructor* obj,
unsigned int& mask)
1139 tree_node_mask::operator()(obj, mask);
1141 if(!GetPointer<constructor>(
source_tn)->list_of_idx_valu.empty())
1143 auto vend = GetPointer<constructor>(
source_tn)->list_of_idx_valu.end();
1144 for(
auto i = GetPointer<constructor>(
source_tn)->list_of_idx_valu.begin(); i != vend; ++i)
1159 node_id1 = node_id1 ?
remap.find(node_id1)->second : 0;
1172 node_id2 =
remap.find(node_id2)->second;
1177 ->add_idx_valu(
TM->GetTreeReindex(node_id1),
TM->GetTreeReindex(node_id2));
1187 void tree_node_dup::operator()(
const enumeral_type* obj,
unsigned int& mask)
1190 tree_node_mask::operator()(obj, mask);
1198 void tree_node_dup::operator()(
const expr_stmt* obj,
unsigned int& mask)
1201 tree_node_mask::operator()(obj, mask);
1208 void tree_node_dup::operator()(
const field_decl* obj,
unsigned int& mask)
1211 tree_node_mask::operator()(obj, mask);
1219 void tree_node_dup::operator()(
const function_decl* obj,
unsigned int& mask)
1222 tree_node_mask::operator()(obj, mask);
1224 if(!GetPointer<function_decl>(
source_tn)->list_of_op_names.empty())
1226 auto vend = GetPointer<function_decl>(
source_tn)->list_of_op_names.end();
1227 for(
auto i = GetPointer<function_decl>(
source_tn)->list_of_op_names.begin(); i != vend; ++i)
1252 #if HAVE_FROM_PRAGMA_BUILT 1258 const auto prev_mode =
mode;
1269 void tree_node_dup::operator()(
const function_type* obj,
unsigned int& mask)
1272 tree_node_mask::operator()(obj, mask);
1278 void tree_node_dup::operator()(
const gimple_assign* obj,
unsigned int& mask)
1281 tree_node_mask::operator()(obj, mask);
1302 void tree_node_dup::operator()(
const gimple_goto* obj,
unsigned int& mask)
1305 tree_node_mask::operator()(obj, mask);
1309 void tree_node_dup::operator()(
const handler* obj,
unsigned int& mask)
1312 tree_node_mask::operator()(obj, mask);
1318 void tree_node_dup::operator()(
const identifier_node* obj,
unsigned int& mask)
1321 tree_node_mask::operator()(obj, mask);
1322 THROW_ERROR(
"Use find_identifier_nodeID to find identifier_node objects");
1325 void tree_node_dup::operator()(
const integer_cst* obj,
unsigned int& mask)
1328 tree_node_mask::operator()(obj, mask);
1332 void tree_node_dup::operator()(
const integer_type* obj,
unsigned int& mask)
1335 tree_node_mask::operator()(obj, mask);
1343 void tree_node_dup::operator()(
const gimple_label* obj,
unsigned int& mask)
1346 tree_node_mask::operator()(obj, mask);
1350 void tree_node_dup::operator()(
const method_type* obj,
unsigned int& mask)
1353 tree_node_mask::operator()(obj, mask);
1357 void tree_node_dup::operator()(
const namespace_decl* obj,
unsigned int& mask)
1360 tree_node_mask::operator()(obj, mask);
1364 void tree_node_dup::operator()(
const overload* obj,
unsigned int& mask)
1367 tree_node_mask::operator()(obj, mask);
1373 void tree_node_dup::operator()(
const parm_decl* obj,
unsigned int& mask)
1376 tree_node_mask::operator()(obj, mask);
1387 void tree_node_dup::operator()(
const gimple_phi* obj,
unsigned int& mask)
1390 tree_node_mask::operator()(obj, mask);
1393 for(
const auto& def_edge : GetPointer<gimple_phi>(
source_tn)->CGetDefEdgesList())
1398 const auto rnode =
remap.find(node_id);
1399 if(rnode !=
remap.end())
1401 node_id = rnode->second;
1414 const auto rnode =
remap.find(node_id);
1415 if(rnode !=
remap.end())
1417 node_id = rnode->second;
1431 void tree_node_dup::operator()(
const pointer_type* obj,
unsigned int& mask)
1434 tree_node_mask::operator()(obj, mask);
1438 void tree_node_dup::operator()(
const real_cst* obj,
unsigned int& mask)
1441 tree_node_mask::operator()(obj, mask);
1447 void tree_node_dup::operator()(
const real_type* obj,
unsigned int& mask)
1450 tree_node_mask::operator()(obj, mask);
1454 void tree_node_dup::operator()(
const record_type* obj,
unsigned int& mask)
1457 tree_node_mask::operator()(obj, mask);
1473 void tree_node_dup::operator()(
const reference_type* obj,
unsigned int& mask)
1476 tree_node_mask::operator()(obj, mask);
1480 void tree_node_dup::operator()(
const result_decl* obj,
unsigned int& mask)
1483 tree_node_mask::operator()(obj, mask);
1490 void tree_node_dup::operator()(
const gimple_return* obj,
unsigned int& mask)
1493 tree_node_mask::operator()(obj, mask);
1497 void tree_node_dup::operator()(
const return_stmt* obj,
unsigned int& mask)
1500 tree_node_mask::operator()(obj, mask);
1506 void tree_node_dup::operator()(
const scope_ref* obj,
unsigned int& mask)
1509 tree_node_mask::operator()(obj, mask);
1514 void tree_node_dup::operator()(
const ssa_name* obj,
unsigned int& mask)
1517 tree_node_mask::operator()(obj, mask);
1540 for(
const auto& def_stmt : GetPointer<ssa_name>(
source_tn)->CGetDefStmts())
1545 const auto rnode =
remap.find(node_id);
1546 if(rnode !=
remap.end())
1548 node_id = rnode->second;
1574 void tree_node_dup::operator()(
const statement_list* obj,
unsigned int& mask)
1577 tree_node_mask::operator()(obj, mask);
1579 const auto mend = GetPointerS<const statement_list>(
source_tn)->list_of_bloc.end();
1580 for(
auto i = GetPointerS<const statement_list>(
source_tn)->list_of_bloc.begin(); i != mend; ++i)
1586 "Block already present " +
STR(
get_bbi(i->first)));
1592 GetPointerS<const statement_list>(
source_tn)->list_of_bloc.size(),
1596 void tree_node_dup::operator()(
const string_cst* obj,
unsigned int& mask)
1599 tree_node_mask::operator()(obj, mask);
1603 void tree_node_dup::operator()(
const gimple_switch* obj,
unsigned int& mask)
1606 tree_node_mask::operator()(obj, mask);
1611 void tree_node_dup::operator()(
const target_expr* obj,
unsigned int& mask)
1614 tree_node_mask::operator()(obj, mask);
1620 void tree_node_dup::operator()(
const lut_expr* obj,
unsigned int& mask)
1623 tree_node_mask::operator()(obj, mask);
1634 void tree_node_dup::operator()(
const template_decl* obj,
unsigned int& mask)
1637 tree_node_mask::operator()(obj, mask);
1647 tree_node_mask::operator()(obj, mask);
1657 void tree_node_dup::operator()(
const tree_list* obj,
unsigned int& mask)
1660 tree_node_mask::operator()(obj, mask);
1667 void tree_node_dup::operator()(
const tree_vec* obj,
unsigned int& mask)
1670 tree_node_mask::operator()(obj, mask);
1676 void tree_node_dup::operator()(
const try_block* obj,
unsigned int& mask)
1679 tree_node_mask::operator()(obj, mask);
1687 void tree_node_dup::operator()(
const type_decl* obj,
unsigned int& mask)
1690 tree_node_mask::operator()(obj, mask);
1695 void tree_node_dup::operator()(
const union_type* obj,
unsigned int& mask)
1698 tree_node_mask::operator()(obj, mask);
1704 void tree_node_dup::operator()(
const var_decl* obj,
unsigned int& mask)
1707 tree_node_mask::operator()(obj, mask);
1731 void tree_node_dup::operator()(
const vector_cst* obj,
unsigned int& mask)
1734 tree_node_mask::operator()(obj, mask);
1741 tree_node_mask::operator()(obj, mask);
1748 tree_node_mask::operator()(obj, mask);
1755 tree_node_mask::operator()(obj, mask);
1764 tree_node_mask::operator()(obj, mask);
1770 void tree_node_dup::operator()(
const vector_type* obj,
unsigned int& mask)
1773 tree_node_mask::operator()(obj, mask);
1777 void tree_node_dup::operator()(
const target_mem_ref* obj,
unsigned int& mask)
1780 tree_node_mask::operator()(obj, mask);
1792 void tree_node_dup::operator()(
const target_mem_ref461* obj,
unsigned int& mask)
1795 tree_node_mask::operator()(obj, mask);
1805 void tree_node_dup::operator()(
const bloc* obj,
unsigned int& mask)
1807 tree_node_mask::operator()(obj, mask);
1827 const auto rnode =
remap.find(node_id);
1828 if(rnode !=
remap.end())
1830 node_id = rnode->second;
1846 node_id =
remap.find(node_id)->second;
1850 for(
const auto& stmt :
source_bloc->CGetStmtList())
1855 const auto rnode =
remap.find(node_id);
1856 if(rnode !=
remap.end())
1858 node_id = rnode->second;
1874 node_id =
remap.find(node_id)->second;
1880 void tree_node_dup::operator()(
const gimple_while* obj,
unsigned int& mask)
1883 tree_node_mask::operator()(obj, mask);
1887 void tree_node_dup::operator()(
const gimple_for* obj,
unsigned int& mask)
1890 tree_node_mask::operator()(obj, mask);
1898 tree_node_mask::operator()(obj, mask);
1900 if(!GetPointer<gimple_multi_way_if>(
source_tn)->list_of_cond.empty())
1902 for(
const auto& cond : GetPointer<gimple_multi_way_if>(
source_tn)->list_of_cond)
1911 node_id =
remap.find(node_id)->second;
1926 node_id =
remap.find(node_id)->second;
1930 ->add_cond(
TM->GetTreeReindex(node_id),
get_bbi(cond.second));
1940 void tree_node_dup::operator()(
const null_node* obj,
unsigned int& mask)
1943 tree_node_mask::operator()(obj, mask);
1946 void tree_node_dup::operator()(
const gimple_pragma* obj,
unsigned int& mask)
1949 tree_node_mask::operator()(obj, mask);
1957 void tree_node_dup::operator()(
const omp_pragma* obj,
unsigned int& mask)
1960 tree_node_mask::operator()(obj, mask);
1966 tree_node_mask::operator()(obj, mask);
1968 if(!GetPointer<omp_parallel_pragma>(
source_tn)->clauses.empty())
1970 auto vend = GetPointer<omp_parallel_pragma>(
source_tn)->clauses.end();
1971 for(
auto i = GetPointer<omp_parallel_pragma>(
source_tn)->clauses.begin(); i != vend; ++i)
1978 void tree_node_dup::operator()(
const omp_for_pragma* obj,
unsigned int& mask)
1981 tree_node_mask::operator()(obj, mask);
1982 if(!GetPointer<omp_for_pragma>(
source_tn)->clauses.empty())
1984 auto vend = GetPointer<omp_for_pragma>(
source_tn)->clauses.end();
1985 for(
auto i = GetPointer<omp_for_pragma>(
source_tn)->clauses.begin(); i != vend; ++i)
1992 void tree_node_dup::operator()(
const omp_simd_pragma* obj,
unsigned int& mask)
1995 tree_node_mask::operator()(obj, mask);
1996 if(!GetPointer<omp_simd_pragma>(
source_tn)->clauses.empty())
1998 auto vend = GetPointer<omp_simd_pragma>(
source_tn)->clauses.end();
1999 for(
auto i = GetPointer<omp_simd_pragma>(
source_tn)->clauses.begin(); i != vend; ++i)
2009 tree_node_mask::operator()(obj, mask);
2010 if(!GetPointer<omp_declare_simd_pragma>(
source_tn)->clauses.empty())
2012 auto vend = GetPointer<omp_declare_simd_pragma>(
source_tn)->clauses.end();
2013 for(
auto i = GetPointer<omp_declare_simd_pragma>(
source_tn)->clauses.begin(); i != vend; ++i)
2020 void tree_node_dup::operator()(
const omp_target_pragma* obj,
unsigned int& mask)
2023 tree_node_mask::operator()(obj, mask);
2024 if(!GetPointer<omp_target_pragma>(
source_tn)->clauses.empty())
2026 auto vend = GetPointer<omp_target_pragma>(
source_tn)->clauses.end();
2027 for(
auto i = GetPointer<omp_target_pragma>(
source_tn)->clauses.begin(); i != vend; ++i)
2037 tree_node_mask::operator()(obj, mask);
2038 if(!GetPointer<omp_critical_pragma>(
source_tn)->clauses.empty())
2040 auto vend = GetPointer<omp_critical_pragma>(
source_tn)->clauses.end();
2041 for(
auto i = GetPointer<omp_critical_pragma>(
source_tn)->clauses.begin(); i != vend; ++i)
2048 void tree_node_dup::operator()(
const omp_task_pragma* obj,
unsigned int& mask)
2051 tree_node_mask::operator()(obj, mask);
2052 if(!GetPointer<omp_task_pragma>(
source_tn)->clauses.empty())
2054 auto vend = GetPointer<omp_task_pragma>(
source_tn)->clauses.end();
2055 for(
auto i = GetPointer<omp_task_pragma>(
source_tn)->clauses.begin(); i != vend; ++i)
2065 tree_node_mask::operator()(obj, mask);
2072 tree_node_mask::operator()(obj, mask);
2080 tree_node_mask::operator()(obj, mask);
2083 void tree_node_dup::operator()(
const map_pragma* obj,
unsigned int& mask)
2086 tree_node_mask::operator()(obj, mask);
2089 void tree_node_dup::operator()(
const call_hw_pragma* obj,
unsigned int& mask)
2092 tree_node_mask::operator()(obj, mask);
2099 tree_node_mask::operator()(obj, mask);
2105 void tree_node_dup::operator()(
const issue_pragma* obj,
unsigned int& mask)
2108 tree_node_mask::operator()(obj, mask);
2111 void tree_node_dup::operator()(
const profiling_pragma* obj,
unsigned int& mask)
2114 tree_node_mask::operator()(obj, mask);
2117 void tree_node_dup::operator()(
const blackbox_pragma* obj,
unsigned int& mask)
2120 tree_node_mask::operator()(obj, mask);
2126 tree_node_mask::operator()(obj, mask);
#define GET_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
struct definition of the type_decl tree node.
This struct specifies the integer_cst node.
void PushBack(const tree_nodeRef statement, const application_managerRef AppM)
Add a statement as last non controlling statement.
struct definition of the const_decl tree node.
This struct implements the target_expr node.
tree_node_dup(CustomUnorderedMapStable< unsigned int, unsigned int > &_remap, const application_managerRef _AppM, unsigned int _remap_bbi=0, unsigned int _remap_loop_id=0, bool _use_counting=false)
Construct a new tree node dup object.
() 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
virtual void visit(tree_node_visitor *const v) const
virtual function used to traverse the tree_node data structure.
This struct specifies the field bloc (basic block).
() label_decl()() modop_expr() new_expr() placeholder_expr() template_id_expr(vec_new_expr)) BOOST_PP_SEQ_FOR_EACH(VISIT_TREE_NODE_MACRO
struct definition of the vector_type tree node.
struct definition of the array_type tree node.
struct definition of the real_type tree node.
unsigned int remap_bbi
basic block indexes remap base
Any erroneous construct is parsed into a node of this type.
char base
This version is stamped on May 10, 2016.
This struct specifies the statement_list node.
Definition of the class representing a generic C application.
A HANDLER wraps a catch handler for the HANDLER_TYPE.
struct definition of the source position.
std::vector< unsigned int > list_of_succ
list_of_succ is the list of successors.
Represents an argument pack of types (or templates).
struct definition of the function_decl tree node.
struct definition of the method_type tree node.
This struct specifies the gimple_label node.
This struct specifies the string_cst node.
exceptions managed by PandA
struct definition of the union_type tree node.
A simple interface to token object of the raw files.
struct definition of the unary node structures.
struct definition of the record_type tree node.
GIMPLE_BIND <VARS, BLOCK, BODY> represents a lexical scope.
static const unsigned int EXIT_BLOCK_ID
constant identifying the exit basic block
#define GET_INDEX_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
struct definition of the ternary node structures.
This struct specifies the gimple_cond node.
tree_nodeRef source_tn
current tree_node source
struct definition of the function_type tree node.
struct definition of the parm_decl tree node.
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.
Constructor: return an aggregate value made from specified components.
This struct specifies the binfo node.
struct definition of the template_decl tree node.
const application_managerRef AppM
application manager
This struct represents a try-block statement.
int mode
enables full nodes duplication
Abstract pure class for the tree structure.
virtual enum kind get_kind() const =0
Virtual function returning the type of the actual class.
struct definition of the label_decl tree node.
#define STR(s)
Macro which performs a lexical_cast to a string.
void line(int x1, int y1, int x2, int y2, unsigned int color)
Auxiliary methods for manipulating string.
struct definition of the label_decl tree node.
Directive represinting mapping of a software function on a component.
struct definition of the result_decl tree node.
This struct specifies the vector_cst node.
#define SET_VALUE(field, type)
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
virtual std::string get_kind_text() const =0
Virtual function returning the name of the actual class.
This struct specifies the gimple_phi node.
() label_decl() using_decl(translation_unit_decl)) BOOST_PP_SEQ_FOR_EACH(VISIT_TREE_NODE_MACRO
CustomUnorderedMapStable< unsigned int, unsigned int > remap_bb
remap old basic block indexes in new indexes
unsigned int loop_id
loop identifier coming from GCC
This struct represents a list-like node for chaining overloading candidates.
struct definition of the Quaternary node structures.
unsigned int remap_loop_id
basic block loop ids remap base
This struct specifies the gimple_assign node (GCC 4.3 tree node).
This C++ header file contains common macros for the tree structure.
This struct specifies super class for constant nodes.
Directive represinting mapping of a function call on a component.
unsigned int create_tree_node(const tree_nodeRef &tn, int mode=tree_node_dup_mode::DEFAULT)
tree_node visitors
#define ATTR_MACRO(r, data, elem)
unsigned int hpl
store the relation between the phi defs inserted in the live_out set and phi uses ...
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...
Low-level memory addressing.
#define LSEQ_SET_NODE_ID(list_field, type)
This struct specifies the gimple_return node.
std::pair< tree_nodeRef, unsigned int > DefEdge
The type of the def edge.
Represents an expression that will be expanded into a list of expressions when instantiated with one ...
This struct represents a reference to a member function or member functions from a base class...
struct definition of the function_decl tree node.
#define RET_NODE_ID_CASE_BODY(tree_node_name, node_id)
CustomUnorderedMapStable< unsigned int, unsigned int > remap_lid
remap old basic block loop ids in new ids
unsigned offset[NUM_VERTICES+1]
struct definition of the field_decl tree node.
struct definition of the complex_type tree node.
#define GET_CONST_NODE(t)
Classes specification of the tree_node data structures.
GIMPLE_SWITCH <INDEX, DEFAULT_LAB, LAB1, ..., LABN> represents the multiway branch: ...
struct definition of the field attr on function_decl, field_decl, var_decl tree node.
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
#define SET_SET_NODE_ID(list_field, type)
struct definition of the pointer_type tree node.
BOOST_PP_SEQ_FOR_EACH(OPERATOR_MACRO, BOOST_PP_EMPTY, VISITED_OBJ_SEQ1)
virtual template object functor
This struct specifies the block node.
This file collects some utility functions.
struct definition of common part of WeightedNode (gimple_assign, expr_node)
struct definition of the reference_type tree node.
This struct specifies the cast_expr node.
CustomUnorderedMapStable< unsigned int, unsigned int > & remap
remap old indexes in new indexes
void init(int bucket[BUCKETSIZE])
struct definition of the common part of an expression
#define CREATE_TREE_NODE_CASE_BODY(tree_node_name, node_id)
void add(int accelnum, int startidx, int endidx)
This struct specifies the lut_expr node.
This struct specifies the complex_cst node.
void AddPhi(const tree_nodeRef phi)
Add a value to list of phi node.
struct definition of the type node structures.
This struct specifies the tree_list node.
Class specification of the tree_reindex support class.
static const unsigned int ENTRY_BLOCK_ID
constant identifying the entry basic block
#define CASE_FAKE_NODES
This macro collects all case labels for fake or empty nodes.
This struct represent a statement expression.
This struct specifies the call_expr node.
bloc * curr_bloc
current basic block pointer
This struct specifies reference to particular overloaded struct method The tree walker structure of t...
#define DECLARATION
Autoheader include.
struct definition of the common part of a gimple with virtual operands
This struct represent a 'return' statement.
This struct specifies a multi-way-if construct.
unsigned int get_bbi(unsigned int old_bb)
This struct specifies the real_cst node.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
This struct specifies the case_label_expr node.
Classes specification of the tree_node data structures not present in the gcc.
unsigned int true_edge
in case the last statement is a gimple_cond associated with an if statement this member contains the ...
unsigned int get_loop_id(unsigned int old_loop_id)
std::vector< unsigned int > list_of_pred
list_of_pred is the list of predecessors.
Low-level memory addressing.
blocRef source_bloc
current basic block source
refcount< tree_node > tree_nodeRef
RefCount type definition of the tree_node class structure.
tree node duplication class.
This struct specifies the ssa_name node.
#define SET_NODE_ID(field, type)
This struct specifies the gimple_goto node.
This struct specifies the for expression Used to represent a for construct.
tree_node * curr_tree_node_ptr
current tree node filled according to the source tree_node
struct definition of the integer_type tree node.
struct definition of the integer_type tree node.
const tree_managerRef TM
tree manager
absl::node_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMapStable
This struct specifies a hint for branch prediction.
#define GET_INDEX_CONST_NODE(t)
struct definition of the binary node structures.
This struct specifies the tree_vec node.
#define SEQ_SET_NODE_ID(list_field, type)
This struct specifies the gimple_asm node.
This struct specifies the gimple_call node.
struct definition of the declaration node structures.
Class specification of the manager of the tree structures extracted from the raw file.
void SetSSAUsesComputed()
Set that uses of ssa have been computed.
unsigned int false_edge
in case the last statement is a gimple_cond associated with an if statement this member contains the ...
This struct specifies the while expression Used to represent a while construct.
Memory tags used in tree-ssa to represent memory locations in virtual SSA.
Represents a type expression that will be expanded into a list of types when instantiated with one or...
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...