49 #include <boost/algorithm/string/replace.hpp> 74 void GimpleWriter::operator()(
const tree_node*,
unsigned int&)
78 void GimpleWriter::operator()(
const WeightedNode* obj,
unsigned int& mask)
81 obj->tree_node::visit(
this);
84 void GimpleWriter::operator()(
const tree_reindex* obj,
unsigned int&)
90 void GimpleWriter::operator()(
const attr*,
unsigned int& mask)
95 void GimpleWriter::operator()(
const srcp*,
unsigned int& mask)
100 void GimpleWriter::operator()(
const decl_node* obj,
unsigned int& mask)
103 obj->tree_node::visit(
this);
104 obj->srcp::visit(
this);
107 void GimpleWriter::operator()(
const expr_node* obj,
unsigned int& mask)
110 obj->WeightedNode::visit(
this);
111 obj->srcp::visit(
this);
114 void GimpleWriter::operator()(
const gimple_node* obj,
unsigned int& mask)
117 obj->WeightedNode::visit(
this);
118 obj->srcp::visit(
this);
121 void GimpleWriter::operator()(
const unary_expr* obj,
unsigned int& mask)
138 case fix_trunc_expr_K:
148 case view_convert_expr_K:
150 os <<
"VIEW_CONVERT_EXPR<";
155 obj->expr_node::visit(
this);
158 case imagpart_expr_K:
165 case realpart_expr_K:
177 case cleanup_point_expr_K:
180 case fix_ceil_expr_K:
181 case fix_floor_expr_K:
182 case fix_round_expr_K:
184 case misaligned_indirect_ref_K:
187 case non_lvalue_expr_K:
189 case reference_expr_K:
190 case reinterpret_cast_expr_K:
192 case static_cast_expr_K:
194 case truth_not_expr_K:
197 case reduc_max_expr_K:
198 case reduc_min_expr_K:
199 case reduc_plus_expr_K:
200 case vec_unpack_hi_expr_K:
201 case vec_unpack_lo_expr_K:
202 case vec_unpack_float_hi_expr_K:
203 case vec_unpack_float_lo_expr_K:
206 std::transform(str.begin(), str.end(), str.begin(), ::toupper);
215 case aggr_init_expr_K:
216 case case_label_expr_K:
218 case identifier_node_K:
220 case statement_list_K:
222 case target_mem_ref_K:
223 case target_mem_ref461_K:
241 if(
GET_NODE(obj->
op)->get_kind() == function_decl_K)
243 GetPointer<function_decl>(
GET_NODE(obj->
op))->name->visit(
this);
249 obj->expr_node::visit(
this);
252 void GimpleWriter::operator()(
const binary_expr* obj,
unsigned int& mask)
277 os <<
"COMPLEX_EXPR <";
286 if(
GET_NODE(obj->
op1)->get_kind() == integer_cst_K)
316 case vec_pack_trunc_expr_K:
319 std::transform(str.begin(), str.end(), str.begin(), ::toupper);
332 case ceil_div_expr_K:
333 case ceil_mod_expr_K:
334 case compound_expr_K:
335 case eh_filter_expr_K:
337 case exact_div_expr_K:
339 case floor_div_expr_K:
340 case floor_mod_expr_K:
343 case goto_subroutine_K:
352 case mult_highpart_expr_K:
355 case pointer_plus_expr_K:
356 case postdecrement_expr_K:
357 case postincrement_expr_K:
358 case predecrement_expr_K:
359 case preincrement_expr_K:
362 case round_div_expr_K:
363 case round_mod_expr_K:
366 case trunc_div_expr_K:
367 case trunc_mod_expr_K:
368 case truth_and_expr_K:
369 case truth_andif_expr_K:
370 case truth_or_expr_K:
371 case truth_orif_expr_K:
372 case truth_xor_expr_K:
373 case try_catch_expr_K:
379 case widen_sum_expr_K:
380 case widen_mult_expr_K:
381 case with_size_expr_K:
382 case vec_lshift_expr_K:
383 case vec_rshift_expr_K:
384 case widen_mult_hi_expr_K:
385 case widen_mult_lo_expr_K:
386 case vec_pack_sat_expr_K:
387 case vec_pack_fix_trunc_expr_K:
388 case vec_extracteven_expr_K:
389 case vec_extractodd_expr_K:
390 case vec_interleavehigh_expr_K:
391 case vec_interleavelow_expr_K:
395 os <<
" " << op <<
" ";
399 case sat_plus_expr_K:
406 case sat_minus_expr_K:
420 case extract_bit_expr_K:
423 const std::string op =
"EXTRACT_BIT_EXPR";
424 os <<
" " << op <<
" ";
428 case extractvalue_expr_K:
431 const std::string op =
"EXTRACTVALUE_EXPR";
432 os <<
" " << op <<
" ";
436 case extractelement_expr_K:
439 const std::string op =
"EXTRACTELEMENT_EXPR";
440 os <<
" " << op <<
" ";
451 case unordered_expr_K:
453 os <<
"UNORDERED_EXPR<";
462 os <<
"ORDERED_EXPR<";
472 case aggr_init_expr_K:
473 case case_label_expr_K:
475 case identifier_node_K:
479 const auto* obj2 =
dynamic_cast<const lut_expr*
>(obj);
482 obj2->op1->visit(
this);
487 case statement_list_K:
489 case target_mem_ref_K:
490 case target_mem_ref461_K:
507 obj->expr_node::visit(
this);
510 void GimpleWriter::operator()(
const ternary_expr* obj,
unsigned int& mask)
515 case bit_field_ref_K:
517 os <<
"BIT_FIELD_REF <";
526 case component_ref_K:
528 const indirect_ref* ir = GetPointer<indirect_ref>(
GET_NODE(obj->
op0));
544 case vec_cond_expr_K:
553 case ternary_plus_expr_K:
562 case ternary_pm_expr_K:
571 case ternary_mp_expr_K:
580 case ternary_mm_expr_K:
608 os <<
" % BW))) | (";
615 case bit_ior_concat_expr_K:
625 case insertvalue_expr_K:
628 os <<
" INSERTVALUE_EXPR ";
635 case insertelement_expr_K:
638 os <<
" INSERTELEMENT_EXPR ";
648 case aggr_init_expr_K:
649 case case_label_expr_K:
651 case dot_prod_expr_K:
652 case identifier_node_K:
656 case statement_list_K:
658 case target_mem_ref_K:
659 case target_mem_ref461_K:
662 case vec_perm_expr_K:
664 case with_cleanup_expr_K:
682 obj->expr_node::visit(
this);
685 void GimpleWriter::operator()(
const quaternary_expr* obj,
unsigned int& mask)
695 obj->expr_node::visit(
this);
698 void GimpleWriter::operator()(
const type_node* obj,
unsigned int& mask)
704 boost::replace_all(replace,
"__restrict__ ",
" restrict");
705 os << replace <<
" ";
715 if(obj_type == integer_type_K)
718 if(it->unsigned_flag)
722 if(it->prec != obj->
algn)
726 os <<
"int __attribute__((vector_size(16)))";
728 else if(it->prec > 32)
730 os <<
"long long int";
732 else if(it->prec > 16)
736 else if(it->prec > 8)
745 else if(obj->
algn == 1)
749 else if(obj->
algn == 8)
753 else if(obj->
algn == 16)
757 else if(obj->
algn == 32)
761 else if(obj->
algn == 64)
765 else if(obj->
algn == 128)
767 os <<
"int __attribute__((vector_size(16)))";
771 os <<
"_BitInt(" << obj->
algn <<
")";
774 else if(obj_type == boolean_type_K)
778 else if(obj_type == real_type_K)
780 auto* rt =
static_cast<const real_type*
>(obj);
785 else if(rt->prec == 64)
789 else if(rt->prec == 80)
793 else if(rt->prec == 128)
799 THROW_ERROR(std::string(
"Real type not yet supported "));
803 obj->tree_node::visit(
this);
806 void GimpleWriter::operator()(
const memory_tag* obj,
unsigned int& mask)
809 obj->decl_node::visit(
this);
812 void GimpleWriter::operator()(
const cst_node* obj,
unsigned int& mask)
816 obj->tree_node::visit(
this);
819 void GimpleWriter::operator()(
const error_mark* obj,
unsigned int& mask)
823 obj->tree_node::visit(
this);
826 void GimpleWriter::operator()(
const array_type* obj,
unsigned int& mask)
833 if(array_length->
get_kind() == integer_cst_K)
835 const auto tn = GetPointer<type_node>(array_element);
841 obj->type_node::visit(
this);
844 void GimpleWriter::operator()(
const gimple_asm* obj,
unsigned int& mask)
847 obj->gimple_node::visit(
this);
850 void GimpleWriter::operator()(
const baselink* obj,
unsigned int& mask)
853 obj->tree_node::visit(
this);
856 void GimpleWriter::operator()(
const gimple_bind* obj,
unsigned int& mask)
859 obj->expr_node::visit(
this);
862 void GimpleWriter::operator()(
const binfo* obj,
unsigned int& mask)
865 obj->tree_node::visit(
this);
868 void GimpleWriter::operator()(
const block* obj,
unsigned int& mask)
871 obj->tree_node::visit(
this);
874 void GimpleWriter::operator()(
const call_expr* obj,
unsigned int& mask)
877 const addr_expr* ae = GetPointer<addr_expr>(
GET_NODE(obj->
fn));
885 const std::vector<tree_nodeRef>&
args = obj->
args;
886 std::vector<tree_nodeRef>::const_iterator
arg, arg_end = args.end();
887 for(arg = args.begin(); arg != arg_end; ++
arg)
889 if(arg != args.begin())
905 const std::vector<tree_nodeRef>&
args = obj->
args;
906 std::vector<tree_nodeRef>::const_iterator
arg, arg_end = args.end();
907 for(arg = args.begin(); arg != arg_end; ++
arg)
909 if(arg != args.begin())
920 void GimpleWriter::operator()(
const aggr_init_expr* obj,
unsigned int& mask)
923 const addr_expr* ae = GetPointer<addr_expr>(
GET_NODE(obj->
fn));
931 const std::vector<tree_nodeRef>&
args = obj->
args;
932 std::vector<tree_nodeRef>::const_iterator
arg, arg_end = args.end();
933 for(arg = args.begin(); arg != arg_end; ++
arg)
935 if(arg != args.begin())
951 const std::vector<tree_nodeRef>&
args = obj->
args;
952 std::vector<tree_nodeRef>::const_iterator
arg, arg_end = args.end();
953 for(arg = args.begin(); arg != arg_end; ++
arg)
955 if(arg != args.begin())
964 os <<
"ctor: " << obj->
ctor;
971 void GimpleWriter::operator()(
const gimple_call* obj,
unsigned int& mask)
973 obj->gimple_node::visit(
this);
975 const addr_expr* ae = GetPointer<addr_expr>(
GET_NODE(obj->
fn));
983 const std::vector<tree_nodeRef>&
args = obj->
args;
984 std::vector<tree_nodeRef>::const_iterator
arg, arg_end = args.end();
985 for(arg = args.begin(); arg != arg_end; ++
arg)
987 if(arg != args.begin())
998 void GimpleWriter::operator()(
const case_label_expr* obj,
unsigned int& mask)
1009 if(obj->
op0 and obj->
op1)
1024 obj->expr_node::visit(
this);
1027 void GimpleWriter::operator()(
const cast_expr* obj,
unsigned int& mask)
1035 obj->expr_node::visit(
this);
1038 void GimpleWriter::operator()(
const complex_cst* obj,
unsigned int& mask)
1041 obj->cst_node::visit(
this);
1044 void GimpleWriter::operator()(
const complex_type* obj,
unsigned int& mask)
1047 obj->type_node::visit(
this);
1050 void GimpleWriter::operator()(
const gimple_cond* obj,
unsigned int& mask)
1056 obj->gimple_node::visit(
this);
1059 void GimpleWriter::operator()(
const const_decl* obj,
unsigned int& mask)
1062 obj->decl_node::visit(
this);
1065 void GimpleWriter::operator()(
const constructor* obj,
unsigned int& mask)
1070 obj->tree_node::visit(
this);
1073 void GimpleWriter::operator()(
const enumeral_type* obj,
unsigned int& mask)
1076 obj->type_node::visit(
this);
1079 void GimpleWriter::operator()(
const expr_stmt* obj,
unsigned int& mask)
1082 obj->tree_node::visit(
this);
1085 void GimpleWriter::operator()(
const field_decl* obj,
unsigned int& mask)
1092 obj->decl_node::visit(
this);
1093 obj->attr::visit(
this);
1096 void GimpleWriter::operator()(
const function_decl* obj,
unsigned int& mask)
1100 os <<
";; Function ";
1105 os <<
")" << std::endl << std::endl;
1108 const std::vector<tree_nodeRef>& list_of_args = obj->
list_of_args;
1109 std::vector<tree_nodeRef>::const_iterator
arg, arg_end = list_of_args.end();
1110 for(arg = list_of_args.begin(); arg != arg_end; ++
arg)
1112 if(arg != list_of_args.begin())
1122 os <<
")" << std::endl;
1125 os <<
"{" << std::endl;
1127 os <<
"}" << std::endl << std::endl << std::endl;
1129 obj->decl_node::visit(
this);
1130 obj->attr::visit(
this);
1133 void GimpleWriter::operator()(
const function_type* obj,
unsigned int& mask)
1136 obj->type_node::visit(
this);
1139 void GimpleWriter::operator()(
const gimple_assign* obj,
unsigned int& mask)
1159 obj->gimple_node::visit(
this);
1162 void GimpleWriter::operator()(
const gimple_goto* obj,
unsigned int& mask)
1165 obj->gimple_node::visit(
this);
1168 void GimpleWriter::operator()(
const handler* obj,
unsigned int& mask)
1171 obj->tree_node::visit(
this);
1174 void GimpleWriter::operator()(
const identifier_node* obj,
unsigned int& mask)
1178 obj->tree_node::visit(
this);
1181 void GimpleWriter::operator()(
const integer_cst* obj,
unsigned int& mask)
1185 obj->cst_node::visit(
this);
1188 void GimpleWriter::operator()(
const integer_type* obj,
unsigned int& mask)
1191 obj->type_node::visit(
this);
1194 void GimpleWriter::operator()(
const gimple_label* obj,
unsigned int& mask)
1199 obj->gimple_node::visit(
this);
1202 void GimpleWriter::operator()(
const method_type* obj,
unsigned int& mask)
1205 obj->function_type::visit(
this);
1208 void GimpleWriter::operator()(
const namespace_decl* obj,
unsigned int& mask)
1211 obj->decl_node::visit(
this);
1214 void GimpleWriter::operator()(
const overload* obj,
unsigned int& mask)
1217 obj->tree_node::visit(
this);
1220 void GimpleWriter::operator()(
const parm_decl* obj,
unsigned int& mask)
1224 obj->decl_node::visit(
this);
1227 void GimpleWriter::operator()(
const gimple_phi* obj,
unsigned int& mask)
1239 def_edge.first->visit(
this);
1240 os <<
"(" << def_edge.second <<
")";
1243 obj->tree_node::visit(
this);
1246 void GimpleWriter::operator()(
const pointer_type* obj,
unsigned int& mask)
1254 obj->type_node::visit(
this);
1257 void GimpleWriter::operator()(
const real_cst* obj,
unsigned int& mask)
1261 obj->cst_node::visit(
this);
1264 void GimpleWriter::operator()(
const real_type* obj,
unsigned int& mask)
1267 obj->type_node::visit(
this);
1270 void GimpleWriter::operator()(
const record_type* obj,
unsigned int& mask)
1277 obj->type_node::visit(
this);
1280 void GimpleWriter::operator()(
const reference_type* obj,
unsigned int& mask)
1283 obj->type_node::visit(
this);
1286 void GimpleWriter::operator()(
const result_decl* obj,
unsigned int& mask)
1290 obj->decl_node::visit(
this);
1293 void GimpleWriter::operator()(
const gimple_return* obj,
unsigned int& mask)
1302 obj->gimple_node::visit(
this);
1305 void GimpleWriter::operator()(
const return_stmt* obj,
unsigned int& mask)
1308 obj->tree_node::visit(
this);
1311 void GimpleWriter::operator()(
const scope_ref* obj,
unsigned int& mask)
1314 obj->expr_node::visit(
this);
1317 void GimpleWriter::operator()(
const ssa_name* obj,
unsigned int& mask)
1342 obj->tree_node::visit(
this);
1345 void GimpleWriter::operator()(
const statement_list* obj,
unsigned int& mask)
1354 if(
block.second->CGetStmtList().empty() ||
1357 os <<
"<bb " <<
block.first <<
">:" << std::endl;
1359 for(
const auto&
phi :
block.second->CGetPhiList())
1364 for(
const auto& stmt :
block.second->CGetStmtList())
1368 if(GetPointer<const gimple_node>(statement) && GetPointer<const gimple_node>(statement)->memuse)
1371 GetPointer<const gimple_node>(statement)->memuse->visit(
this);
1373 if(GetPointer<const gimple_node>(statement) && GetPointer<const gimple_node>(statement)->memdef)
1376 GetPointer<const gimple_node>(statement)->memdef->visit(
this);
1379 if(statement->get_kind() != gimple_cond_K && statement->get_kind() != gimple_label_K &&
1380 statement->get_kind() != gimple_switch_K && statement->get_kind() != gimple_pragma_K)
1386 if(
block.second->true_edge &&
block.second->false_edge)
1388 os <<
" goto <bb " <<
block.second->true_edge <<
">";
1390 "Could not find BB" +
STR(
block.second->true_edge));
1392 if(next_true->CGetStmtList().size() &&
1393 GET_CONST_NODE(next_true->CGetStmtList().front())->get_kind() == gimple_label_K)
1395 const auto le = GetPointer<const gimple_label>(
GET_CONST_NODE(next_true->CGetStmtList().front()));
1397 le->op->visit(
this);
1400 os <<
";" << std::endl;
1401 os <<
" else" << std::endl;
1402 os <<
" goto <bb " <<
block.second->false_edge <<
">";
1404 "Could not find BB" +
STR(
block.second->false_edge));
1406 if(next_false->CGetStmtList().size() &&
1407 GET_CONST_NODE(next_false->CGetStmtList().back())->get_kind() == gimple_label_K)
1409 const auto le = GetPointer<const gimple_label>(
GET_CONST_NODE(next_false->CGetStmtList().front()));
1411 le->op->visit(
this);
1414 os <<
";" << std::endl;
1416 else if(
block.second->list_of_succ.size() == 1)
1418 const unsigned int succ_index =
block.second->list_of_succ.front();
1419 if(succ_index != (
block.second->number + 1) && succ_index !=
BB_EXIT)
1421 os <<
" goto <bb " << succ_index <<
">";
1424 if(next->CGetStmtList().size() &&
GET_CONST_NODE(next->CGetStmtList().back())->get_kind() == gimple_label_K)
1426 const auto le = GetPointer<const gimple_label>(
GET_CONST_NODE(next->CGetStmtList().front()));
1428 le->op->visit(
this);
1431 os <<
";" << std::endl;
1436 obj->tree_node::visit(
this);
1439 void GimpleWriter::operator()(
const string_cst* obj,
unsigned int& mask)
1442 os <<
"\"" << obj->
strg <<
"\"";
1443 obj->cst_node::visit(
this);
1446 void GimpleWriter::operator()(
const gimple_switch* obj,
unsigned int& mask)
1454 obj->gimple_node::visit(
this);
1457 void GimpleWriter::operator()(
const target_expr* obj,
unsigned int& mask)
1460 os <<
"target_expr (";
1464 obj->expr_node::visit(
this);
1467 void GimpleWriter::operator()(
const lut_expr* obj,
unsigned int& mask)
1501 obj->expr_node::visit(
this);
1505 void GimpleWriter::operator()(
const template_decl* obj,
unsigned int& mask)
1508 obj->decl_node::visit(
this);
1509 os <<
"template_decl (";
1546 os <<
"_" << obj->
idx;
1551 void GimpleWriter::operator()(
const tree_list* obj,
unsigned int& mask)
1560 obj->tree_node::visit(
this);
1563 void GimpleWriter::operator()(
const tree_vec* obj,
unsigned int& mask)
1566 std::vector<tree_nodeRef>::const_iterator op, op_end = obj->
list_of_op.end();
1567 for(op = obj->
list_of_op.begin(); op != op_end; ++op)
1575 obj->tree_node::visit(
this);
1578 void GimpleWriter::operator()(
const try_block* obj,
unsigned int& mask)
1581 obj->tree_node::visit(
this);
1584 void GimpleWriter::operator()(
const type_decl* obj,
unsigned int& mask)
1588 obj->decl_node::visit(
this);
1591 void GimpleWriter::operator()(
const union_type* obj,
unsigned int& mask)
1594 obj->type_node::visit(
this);
1597 void GimpleWriter::operator()(
const var_decl* obj,
unsigned int& mask)
1608 os <<
"D." << obj->
uid;
1615 obj->decl_node::visit(
this);
1616 obj->attr::visit(
this);
1619 void GimpleWriter::operator()(
const vector_cst* obj,
unsigned int& mask)
1623 for(
size_t i = 0; i < vector_size; i++)
1634 obj->cst_node::visit(
this);
1640 if(not obj->
unql and not obj->
name)
1642 os <<
"type_argument_pack ";
1645 obj->type_node::visit(
this);
1647 obj->type_node::visit(
this);
1653 os <<
"nontype_argument_pack ";
1656 obj->expr_node::visit(
this);
1662 os <<
"type_pack_expansion ";
1676 obj->type_node::visit(
this);
1682 os <<
"expr_pack_expansion ";
1696 obj->expr_node::visit(
this);
1699 void GimpleWriter::operator()(
const vector_type* obj,
unsigned int& mask)
1702 if(not obj->
unql and not obj->
name)
1707 obj->type_node::visit(
this);
1709 obj->type_node::visit(
this);
1712 void GimpleWriter::operator()(
const target_mem_ref* obj,
unsigned int& mask)
1740 obj->WeightedNode::visit(
this);
1777 obj->WeightedNode::visit(
this);
1779 void GimpleWriter::operator()(
const bloc*,
unsigned int& mask)
1784 void GimpleWriter::operator()(
const null_node* obj,
unsigned int& mask)
1787 obj->tree_node::visit(
this);
1790 void GimpleWriter::operator()(
const gimple_pragma* obj,
unsigned int& mask)
1793 obj->gimple_node::visit(
this);
1800 void GimpleWriter::operator()(
const omp_pragma* obj,
unsigned int& mask)
1804 obj->tree_node::visit(
this);
1822 obj->omp_pragma::visit(
this);
1831 void GimpleWriter::operator()(
const omp_for_pragma* obj,
unsigned int& mask)
1834 os <<
" parallel for";
1837 for(clause = clauses.begin(); clause != clause_end; ++clause)
1839 os <<
" " + clause->first + (clause->second !=
"" ?
"(" + clause->second +
")" :
"");
1843 void GimpleWriter::operator()(
const omp_simd_pragma* obj,
unsigned int& mask)
1849 for(clause = clauses.begin(); clause != clause_end; ++clause)
1851 os <<
" " + clause->first + (clause->second !=
"" ?
"(" + clause->second +
")" :
"");
1858 os <<
" declare simd";
1861 for(clause = clauses.begin(); clause != clause_end; ++clause)
1863 os <<
" " + clause->first + (clause->second !=
"" ?
"(" + clause->second +
")" :
"");
1873 for(clause = clauses.begin(); clause != clause_end; ++clause)
1875 os <<
" " + clause->first + (clause->second !=
"" ?
"(" + clause->second +
")" :
"");
1885 for(clause = clauses.begin(); clause != clause_end; ++clause)
1887 os <<
" " + clause->first + (clause->second !=
"" ?
"(" + clause->second +
")" :
"");
1891 void GimpleWriter::operator()(
const omp_task_pragma* obj,
unsigned int& mask)
1897 for(clause = clauses.begin(); clause != clause_end; ++clause)
1899 os <<
" " + clause->first + (clause->second !=
"" ?
"(" + clause->second +
")" :
"");
1903 void GimpleWriter::operator()(
const map_pragma* obj,
unsigned int& mask)
1906 obj->tree_node::visit(
this);
1909 void GimpleWriter::operator()(
const call_hw_pragma* obj,
unsigned int& mask)
1912 obj->tree_node::visit(
this);
1918 obj->tree_node::visit(
this);
1921 void GimpleWriter::operator()(
const issue_pragma* obj,
unsigned int& mask)
1924 obj->tree_node::visit(
this);
1927 void GimpleWriter::operator()(
const blackbox_pragma* obj,
unsigned int& mask)
1930 obj->issue_pragma::visit(
this);
1933 void GimpleWriter::operator()(
const profiling_pragma* obj,
unsigned int& mask)
1936 obj->tree_node::visit(
this);
1942 obj->profiling_pragma::visit(
this);
1945 void GimpleWriter::operator()(
const gimple_while* obj,
unsigned int& mask)
1951 obj->gimple_node::visit(
this);
1954 void GimpleWriter::operator()(
const gimple_for* obj,
unsigned int& mask)
1964 obj->gimple_node::visit(
this);
1970 os <<
"multi_way_if (";
1975 cond.first->visit(
this);
1977 os <<
":" << cond.second <<
" ";
1980 obj->gimple_node::visit(
this);
#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.
tree_nodeRef ptd
ptd field points to the node for the type pointed to.
This struct specifies the integer_cst node.
struct definition of the const_decl tree node.
This struct implements the target_expr node.
bool default_flag
default_flag is true if the label is a 'default' label
tree_nodeRef op2
second operand
const DefEdgeList & CGetDefEdgesList() const
Return the list of def edges.
This struct specifies the field bloc (basic block).
struct definition of the vector_type tree node.
struct definition of the array_type tree node.
tree_nodeRef unql
unql field, in any member of such a chain, points to the start of the chain.
struct definition of the real_type tree node.
tree_nodeRef name
name field contains info on the name used in the program for this type.It is either a TYPE_DECL node...
CustomUnorderedMapUnstable< std::string, std::string > clauses
map between the clauses that can be associated with the OpenMP parallel pragma and their value (e...
#define CASE_BINARY_EXPRESSION
This macro collects all case labels for binary_expr objects.
tree_nodeRef op1
The second operand of the binary expression.
Any erroneous construct is parsed into a node of this type.
This struct specifies the statement_list node.
std::string valr
valr is the real value
#define BB_EXIT
constant identifying the basic block node of type exit
tree_nodeRef name
name field contains an identifier_node used to represent a name.
#define CASE_DECL_NODES
NOTE that cast_expr is a unary expression but it could not be included in the CASE_UNARY_EXPRESSION b...
tree_nodeRef elts
field elts is the type of an vector element (tree-dump.c use the macro TREE_TYPE) ...
tree_nodeRef idx
INDEX register.
A HANDLER wraps a catch handler for the HANDLER_TYPE.
tree_nodeRef param_packs
PACK_EXPANSION_PARAMETER_PACKS.
tree_nodeRef op
op is casted node
struct definition of the source position.
Represents an argument pack of types (or templates).
tree_nodeRef op1
first operand
struct definition of the function_decl tree node.
tree_nodeRef size
size field contains a tree that is an expression for the size in bits.
struct definition of the method_type tree node.
tree_nodeRef decl
it is the target of an initialization
tree_nodeRef var
var is the variable being referenced (macro SSA_NAME_VAR).
tree_nodeRef arg
PACK_EXPANSION_EXTRA_ARGS.
TreeVocabularyTokenTypes_TokenEnum qual
qual is the set of type qualifiers for this type.
static std::string return_C_qualifiers(const TreeVocabularyTokenTypes_TokenEnum quals, bool real_const)
return the qualifiers in C format
This struct specifies the gimple_label node.
This struct specifies the string_cst node.
tree_nodeRef op4
fourth operand
tree_nodeRef op2
The third operand of the ternary expression.
tree_nodeRef op1
The second operand of the Quaternary expression.
struct definition of the union_type tree node.
std::vector< tree_nodeRef > list_of_valu
list_of_valu is a list of value of the TREE_VECTOR_CST_ELTS vector elements.
virtual void visit(tree_node_visitor *const v) const
virtual function used to traverse the tree_node data structure.
A simple interface to token object of the raw files.
struct definition of the unary node structures.
struct definition of the record_type tree node.
tree_nodeRef op6
sixth operand
tree_nodeRef op0
The first operand of the binary expression.
GIMPLE_BIND <VARS, BLOCK, BODY> represents a lexical scope.
std::map< unsigned int, blocRef > list_of_bloc
list_of_bloc field is the list of basic block. If this field is null then the list_of_stmt field is n...
tree_nodeRef base
BASE register.
tree_nodeRef op
PACK_EXPANSION_PATTERN.
tree_nodeRef op1
The second operand of the binary expression.
struct definition of the ternary node structures.
This struct specifies the gimple_cond node.
struct definition of the function_type tree node.
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMapUnstable
tree_nodeRef op7
seventh operand
tree_nodeRef op1
op1 is the operand 1 (macro CASE_HIGH) of the case label expression
std::vector< tree_nodeRef > args
The arguments of the gimple_call.
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.
redefinition of map to manage ordered/unordered structures
This struct represents a try-block statement.
tree_nodeRef spcs
prms field holds the specialization parameters vector.
Abstract pure class for the tree structure.
std::ostream & os
tree_node visitors
tree_nodeRef arg
arguments stored in the argument pack
tree_nodeRef res
res is the new SSA_NAME node created by the PHI node.
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.
Auxiliary methods for manipulating string.
struct definition of the label_decl tree node.
std::vector< tree_nodeRef > args
The arguments of the call_expr.
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
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.
CustomUnorderedMapUnstable< std::string, std::string > clauses
map between the clauses that can be associated with the OpenMP parallel pragma and their value (e...
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
virtual std::string get_kind_text() const =0
Virtual function returning the name of the actual class.
This struct specifies the gimple_phi node.
This struct represents a list-like node for chaining overloading candidates.
struct definition of the Quaternary node structures.
tree_nodeRef init
it is the initializer for the target
This struct specifies the gimple_assign node (GCC 4.3 tree node).
#define CASE_QUATERNARY_EXPRESSION
This macro collects all case labels for quaternary_expr objects.
#define CASE_UNARY_EXPRESSION
This macro collects all case labels for unary_expr objects.
This struct specifies super class for constant nodes.
Directive represinting mapping of a function call on a component.
static integer_cst_t get_integer_cst_value(const integer_cst *ic)
Convert a integer_cst in a long long value.
CustomUnorderedMapUnstable< std::string, std::string > clauses
Clauses associated with the directives.
const unsigned int index
Represent the index read from the raw file and the index-1 of the vector of tree_node associated to t...
Low-level memory addressing.
This struct specifies the gimple_return node.
tree_nodeRef body
body field is the saved representation of the body of the entire function.
tree_nodeRef idx
INDEX register.
tree_nodeRef prms
prms field holds the template parameters vector.
Represents an expression that will be expanded into a list of expressions when instantiated with one ...
tree_nodeRef slot
slot is the slot which was allocated for this expression
This struct represents a reference to a member function or member functions from a base class...
std::list< std::pair< tree_nodeRef, unsigned int > > list_of_cond
The list of pair condition basic block.
#define BB_ENTRY
constant identifying the basic block node of type entry
bool default_flag
Nonzero if this SSA_NAME is the default definition for the underlying symbol.
struct definition of the function_decl tree node.
tree_nodeRef op3
third operand
tree_nodeRef chan
purp is the TREE_CHAIN field: tree_list nodes are made into lists by chaining through the TREE_CHAIN ...
tree_nodeRef param_packs
PACK_EXPANSION_PARAMETER_PACKS.
unsigned offset[NUM_VERTICES+1]
tree_nodeRef fn
fn is the operand 0 of the call expression: this is the function
struct definition of the field_decl tree node.
tree_nodeRef step
STEP integer constant.
tree_nodeRef op0
the branch var
struct definition of the complex_type tree node.
#define GET_CONST_NODE(t)
tree_nodeRef predicate
The predicate.
tree_nodeRef arg
PACK_EXPANSION_EXTRA_ARGS.
Classes specification of the tree_node data structures.
GIMPLE_SWITCH <INDEX, DEFAULT_LAB, LAB1, ..., LABN> represents the multiway branch: ...
bool use_uid
If true gcc uid instead of tree node index.
tree_nodeRef op0
The first operand of the ternary expression.
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
tree_nodeRef offset
OFFSET integer constant.
struct definition of the pointer_type tree node.
tree_nodeRef got
got field is the operand 2 (macro CASE_LABEL) of the case label expression
unsigned int algn
algn field is the alignment necessary for objects of this type.
tree_nodeRef op0
true table constant
This struct specifies the block node.
#define CASE_TYPE_NODES
This macro collects all case labels for type objects.
This file collects some utility functions.
tree_nodeRef op0
The first operand of the binary expression.
std::vector< tree_nodeRef > list_of_args
args field holds a chain of parm_decl nodes for the arguments.
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.
static std::string op_symbol(const tree_nodeConstRef &op)
Function return the symbol related with the operator op passed as parameter.
struct definition of the common part of an expression
unsigned int vers
vers is the SSA version number of this SSA name.
This struct specifies the lut_expr node.
tree_nodeRef directive
this node represents the directive of the pragma
#define CASE_CST_NODES
This macro collects all case labels for cast nodes.
CustomUnorderedMapUnstable< std::string, std::string > clauses
map between the clauses that can be associated with the OpenMP parallel pragma and their value (e...
This struct specifies the complex_cst node.
tree_nodeRef type
type of the expression
struct definition of the type node structures.
This struct specifies the tree_list node.
tree_nodeRef rslt
rslt is null for struct templates and declaration for object to be created for non-struct templates ...
Class specification of the tree_reindex support class.
tree_nodeRef clnp
it is the cleanup for this node
#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.
std::string strg
strg is the TREE_STRING_POINTER.
tree_nodeRef op1
initialization
tree_nodeRef scope
this node defines the scope of the pragma
Class specification of the basic_block structure.
tree_nodeRef op0
op0 is the operand 0 (macro CASE_LOW) of the case label expression
tree_nodeRef step
STEP integer constant.
This struct specifies reference to particular overloaded struct method The tree walker structure of t...
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 current_node_index
The index of the currently visited node.
This struct specifies the real_cst node.
std::vector< tree_nodeRef > list_of_op
list_of_op is the array of tree node stored in tree_vec node.(macro TREE_VEC_ELT) ...
tree_nodeRef op0
The first operand of the Quaternary expression.
tree_nodeRef op0
The first operand of the ternary expression.
static tree_nodeConstRef CGetType(const tree_nodeConstRef &node)
Return the treenode of the type of node.
tree_nodeRef idx2
INDEX register.
This struct specifies the case_label_expr node.
tree_nodeRef type
type field holds the data type of the object, when relevant.
GimpleWriter(std::ostream &_os, const bool _use_uid)
default constructor
Classes specification of the tree_node data structures not present in the gcc.
tree_nodeRef inst
inst field holds the template instantiation vector.
#define CASE_CPP_NODES
This macro collects all case labels for cpp nodes.
Low-level memory addressing.
tree_nodeRef valu
purp is the TREE_VALUE field which stores the elements of the list.
std::string strg
Store the identifier string associated with the identifier_node.
This struct specifies the ssa_name node.
tree_nodeRef elts
field elts is the type of an array element (tree-dump.c use the macro TREE_TYPE)
tree_nodeRef op
op field is the operand of this node
This struct specifies the gimple_goto node.
This struct specifies the for expression Used to represent a for construct.
struct definition of the integer_type tree node.
struct definition of the integer_type tree node.
tree_nodeRef op1
the vec of CASE_LABEL_EXPRs
#define NO_VISIT
constant used to avoid member visit
static integer_cst_t GetConstValue(const tree_nodeConstRef &tn, bool is_signed=true)
Get value from integer constant.
#define CASE_GIMPLE_NODES
This macro collects all cases labels for gimple nodes.
tree_nodeRef op2
postincrement
tree_nodeRef type
starting from GCC 4.7.2 ssa_name has a type
tree_nodeRef op
PACK_EXPANSION_PATTERN.
struct definition of the binary node structures.
tree_nodeRef type
type field is the type of the node
This struct specifies the tree_vec node.
unsigned int orig_vers
original SSA version number from GCC
tree_nodeRef arg
arguments stored in the argument pack
tree_nodeRef op8
eighth operand
tree_nodeRef op
op field is the operand of the unary expression
tree_nodeRef op0
The boolean condition.
tree_nodeRef symbol
static or global variable
This struct specifies the gimple_asm node.
tree_nodeRef op1
The second operand of the ternary expression.
CustomUnorderedMapUnstable< std::string, std::string > clauses
Clauses associated with the directives.
CustomUnorderedMapUnstable< std::string, std::string > clauses
Clauses associated with the directives.
This struct specifies the gimple_call node.
tree_nodeRef op5
fifth operand
tree_nodeRef offset
OFFSET integer constant.
struct definition of the declaration node structures.
#define CASE_TERNARY_EXPRESSION
This macro collects all case labels for ternary_expr objects.
This struct specifies the while expression Used to represent a while construct.
tree_nodeRef fn
fn is the operand 0 of the call expression: this is the function
#define CASE_PRAGMA_NODES
This macro collects all case labels for pragma objects.
Represents a type expression that will be expanded into a list of types when instantiated with one or...
Memory tags used in tree-ssa to represent memory locations in virtual SSA.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...