60 #include <boost/range/adaptors.hpp> 66 if(node->get_kind() == ssa_name_K &&
current.find(nid) !=
current.end())
76 const auto ssa = GetPointerS<const ssa_name>(
GET_CONST_NODE(ssa_node));
77 const auto ssa_nid = ssa->index;
79 for(
const auto& stmt_use : ssa->CGetUseStmts())
82 const auto user_kind = user_stmt->get_kind();
84 std::deque<bit_lattice> user_res;
85 if(user_kind == gimple_assign_K)
87 const auto ga = GetPointerS<const gimple_assign>(user_stmt);
95 else if(ga->predicate && ga->predicate->index == ssa_nid)
104 else if(user_kind == gimple_phi_K)
106 const auto gp = GetPointerS<const gimple_phi>(user_stmt);
107 if(!gp->virtual_flag)
112 else if(user_kind == gimple_return_K)
114 const auto gr = GetPointerS<const gimple_return>(user_stmt);
115 THROW_ASSERT(gr->op,
"ssa id " +
STR(ssa_nid) +
"used in empty return statement: " +
STR(gr));
119 user_res = res_it->second;
122 else if(user_kind == gimple_call_K)
124 const auto gc = GetPointerS<const gimple_call>(user_stmt);
128 const auto called_id = call_it->second;
129 const auto called_tn =
TM->CGetTreeNode(called_id);
130 const auto called_fd = GetPointerS<const function_decl>(called_tn);
132 const auto& actual_parms = gc->args;
133 const auto& formal_parms = called_fd->list_of_args;
134 THROW_ASSERT(actual_parms.size() == formal_parms.size(),
"");
135 auto a_it = actual_parms.cbegin();
136 const auto a_end = actual_parms.cend();
137 auto f_it = formal_parms.cbegin();
138 const auto f_end = formal_parms.cend();
140 for(; a_it != a_end && f_it != f_end; a_it++, f_it++)
145 const auto parmssa =
TM->CGetTreeNode(p_decl_id);
146 const auto pd = GetPointerS<const ssa_name>(parmssa);
147 std::deque<bit_lattice> tmp;
148 if(pd->bit_values.empty())
157 user_res = found ?
inf(user_res, tmp, ssa_node) : tmp;
161 THROW_ASSERT(found,
STR(ssa) +
" is not an actual parameter of function " +
STR(called_id));
164 else if(user_kind == gimple_cond_K || user_kind == gimple_multi_way_if_K || user_kind == gimple_switch_K ||
165 user_kind == gimple_asm_K)
171 THROW_UNREACHABLE(
"Unhandled statement: " +
STR(user_stmt) +
"(" + user_stmt->get_kind_text() +
")");
176 res =
inf(res, user_res, ssa_node);
183 res =
best.at(ssa_nid);
195 std::deque<tree_nodeConstRef> working_list;
198 const auto stmt_kind = stmt->get_kind();
199 if(!working_list_idx.count(stmt->index) && (stmt_kind == gimple_assign_K || stmt_kind == gimple_phi_K))
201 working_list.push_back(stmt);
202 working_list_idx.insert(stmt->index);
206 const auto stmt = working_list.front();
207 working_list.pop_front();
208 working_list_idx.erase(stmt->index);
213 for(
const auto& stmt : boost::adaptors::reverse(bb->CGetStmtList()))
217 THROW_ASSERT(GetPointer<const gimple_node>(s)->bb_index == bb->number,
218 "BB" +
STR(bb->number) +
" contains statement from BB" +
219 STR(GetPointer<const gimple_node>(s)->bb_index) +
" - " + s->get_kind_text() +
" - " +
222 for(
const auto& stmt : boost::adaptors::reverse(bb->CGetPhiList()))
225 const auto gp = GetPointerS<const gimple_phi>(s);
226 if(!gp->virtual_flag)
231 THROW_ASSERT(GetPointer<const gimple_node>(s)->bb_index == bb->number,
232 "BB" +
STR(bb->number) +
" contains statement from BB" +
233 STR(GetPointer<const gimple_node>(s)->bb_index) +
" - " + s->get_kind_text() +
" - " +
239 while(!working_list.empty())
241 const auto stmt = pop_front();
243 const auto stmt_kind = stmt->get_kind();
245 if(stmt_kind == gimple_assign_K)
247 lhs = GetPointerS<const gimple_assign>(stmt)->op0;
249 else if(stmt_kind == gimple_phi_K)
251 lhs = GetPointerS<const gimple_phi>(stmt)->res;
257 const auto lhs_ssa = GetPointer<const ssa_name>(
GET_CONST_NODE(lhs));
273 std::vector<std::tuple<unsigned int, unsigned int>> vars_read;
275 for(
const auto& var_pair : vars_read)
277 const auto in_ssa_nid = std::get<0>(var_pair);
282 const auto in_ssa =
TM->CGetTreeNode(in_ssa_nid);
287 if(in_ssa->get_kind() == ssa_name_K)
289 const auto ssa_var = GetPointerS<const ssa_name>(in_ssa);
290 const auto nextNode = ssa_var->CGetDefStmt();
300 const auto fd = GetPointerS<const function_decl>(tn);
301 for(
const auto& parm_decl_node : fd->list_of_args)
305 const auto parmssa =
TM->CGetTreeReindex(parmssa_id);
310 " not considered id: " +
STR(parmssa_id));
317 "<--argument has been proven to be constant: " +
STR(parmssa));
331 std::deque<bit_lattice> res;
332 if(GetPointer<const cst_node>(
TM->CGetTreeNode(res_nid)))
342 return best.at(res_nid);
344 const auto& lhs = ga->
op0;
385 case ceil_div_expr_K:
386 case ceil_mod_expr_K:
388 case compound_expr_K:
389 case eh_filter_expr_K:
391 case exact_div_expr_K:
393 case floor_div_expr_K:
394 case floor_mod_expr_K:
397 case goto_subroutine_K:
409 case mult_highpart_expr_K:
413 case pointer_plus_expr_K:
414 case postdecrement_expr_K:
415 case postincrement_expr_K:
416 case predecrement_expr_K:
417 case preincrement_expr_K:
421 case round_div_expr_K:
422 case round_mod_expr_K:
426 case trunc_div_expr_K:
427 case trunc_mod_expr_K:
428 case truth_and_expr_K:
429 case truth_andif_expr_K:
430 case truth_or_expr_K:
431 case truth_orif_expr_K:
432 case truth_xor_expr_K:
433 case try_catch_expr_K:
441 case unordered_expr_K:
442 case widen_sum_expr_K:
443 case widen_mult_expr_K:
444 case with_size_expr_K:
445 case vec_lshift_expr_K:
446 case vec_rshift_expr_K:
447 case widen_mult_hi_expr_K:
448 case widen_mult_lo_expr_K:
449 case vec_pack_trunc_expr_K:
450 case vec_pack_sat_expr_K:
451 case vec_pack_fix_trunc_expr_K:
452 case vec_extracteven_expr_K:
453 case vec_extractodd_expr_K:
454 case vec_interleavehigh_expr_K:
455 case vec_interleavelow_expr_K:
456 case extract_bit_expr_K:
457 case sat_plus_expr_K:
458 case sat_minus_expr_K:
460 case array_range_ref_K:
468 case aggr_init_expr_K:
472 case case_label_expr_K:
475 case identifier_node_K:
477 case statement_list_K:
479 case target_mem_ref_K:
480 case target_mem_ref461_K:
483 case extractvalue_expr_K:
484 case extractelement_expr_K:
495 const auto& rhs = ga->
op1;
506 case truth_not_expr_K:
507 case view_convert_expr_K:
518 auto op_bitstring =
best.at(op_nid);
522 if(rhs_kind == addr_expr_K)
527 if(op_kind == mem_ref_K)
535 else if(op_kind == target_mem_ref461_K)
549 else if(op_kind == array_ref_K)
563 else if(rhs_kind == bit_not_expr_K)
565 const auto lhs_bitsize = lhs_bitstring.size();
567 auto se_lhs_bitstring = lhs_bitstring;
568 const auto initial_size = op_bitstring.size();
569 if(initial_size < lhs_bitsize)
573 if(initial_size > lhs_bitsize)
578 auto it_lhs_bitstring = se_lhs_bitstring.rbegin();
579 auto it_op_bitstring = op_bitstring.rbegin();
580 for(; it_lhs_bitstring != se_lhs_bitstring.rend() && it_op_bitstring != op_bitstring.rend();
581 ++it_lhs_bitstring, ++it_op_bitstring)
589 res.push_front(*it_op_bitstring);
593 else if(rhs_kind == convert_expr_K || rhs_kind == nop_expr_K || rhs_kind == view_convert_expr_K)
598 if(op_signed && !lhs_signed)
619 if(res.size() < lhs_size)
623 if(lhs_size > op_size)
625 if(op_size < 32 && op_size > 1)
627 const auto sign_bit = res.front();
629 while(res.size() > op_size)
633 res.front() =
bit_inf(sign_bit, res.front());
637 while(res.size() > op_size)
644 else if(rhs_kind == negate_expr_K)
647 const auto initial_size = op_bitstring.size();
651 res_size =
std::min(res_size, static_cast<unsigned long long>(lhs_bitstring.size()));
655 res_size =
std::min(res_size, static_cast<unsigned long long>(lhs_bitstring.size() - 1));
657 while(res.size() > res_size)
661 if(res.size() != initial_size)
666 else if(rhs_kind == truth_not_expr_K)
669 while(res.size() > 1)
685 case extract_bit_expr_K:
692 case pointer_plus_expr_K:
695 case truth_and_expr_K:
696 case truth_andif_expr_K:
697 case truth_or_expr_K:
698 case truth_orif_expr_K:
699 case truth_xor_expr_K:
700 case widen_mult_expr_K:
706 auto op0_bitstring =
best.at(op0_nid);
710 auto op1_bitstring =
best.at(op1_nid);
713 "Invalid operand: " +
STR(res_nid) +
" (" + ga->
ToString() +
")");
719 if(rhs_kind == bit_and_expr_K || rhs_kind == bit_ior_expr_K || rhs_kind == bit_xor_expr_K)
721 const auto lhs_bitsize = lhs_bitstring.size();
723 if(op0_nid != res_nid)
725 std::swap(op0_nid, op1_nid);
726 std::swap(op0_bitstring, op1_bitstring);
729 auto se_lhs_bitstring = lhs_bitstring;
730 const auto initial_size = op0_bitstring.size();
731 if(initial_size < lhs_bitsize)
735 if(initial_size > lhs_bitsize)
739 if(op0_bitstring.size() > op1_bitstring.size())
744 if(op1_bitstring.size() > op0_bitstring.size())
750 auto it_lhs_bitstring = se_lhs_bitstring.rbegin();
751 auto it_op0_bitstring = op0_bitstring.rbegin();
752 auto it_op1_bitstring = op1_bitstring.rbegin();
753 for(; it_lhs_bitstring != se_lhs_bitstring.rend() && it_op0_bitstring != op0_bitstring.rend();
754 ++it_lhs_bitstring, ++it_op0_bitstring, ++it_op1_bitstring)
765 else if(rhs_kind == bit_ior_expr_K && *it_op0_bitstring !=
bit_lattice::ONE &&
772 res.push_front(*it_op0_bitstring);
776 else if(rhs_kind == lrotate_expr_K || rhs_kind == rrotate_expr_K)
778 if(op1_nid == res_nid)
782 for(log2 = 1; lhs_size > (1u << log2); ++log2)
789 if(op_signed_p && (res.size() ==
index + log2 + 1))
800 else if(rhs_kind == lshift_expr_K)
804 if(op1_nid == res_nid)
808 for(log2 = 1; lhs_size > (1u << log2); ++log2)
815 if(op_signed_p && (res.size() ==
index + log2 + 1))
836 while(res.size() > (lhs_bitstring.size() -
static_cast<size_t>(cst_val)))
840 if(res.size() < lhs_bitstring.size())
845 else if(rhs_kind == mem_ref_K)
847 if(op0_nid == res_nid)
852 else if(rhs_kind == minus_expr_K || rhs_kind == mult_expr_K || rhs_kind == plus_expr_K ||
853 rhs_kind == pointer_plus_expr_K || rhs_kind == widen_mult_expr_K)
855 if(op0_nid != res_nid)
857 std::swap(op0_nid, op1_nid);
858 std::swap(op0_bitstring, op1_bitstring);
862 const auto initial_size = op0_bitstring.size();
866 res_size =
std::min(res_size, static_cast<unsigned long long>(lhs_bitstring.size()));
870 res_size =
std::min(res_size, static_cast<unsigned long long>(lhs_bitstring.size() - 1));
872 while(res.size() > res_size)
876 if(res.size() != initial_size)
881 else if(rhs_kind == rshift_expr_K)
885 if(op1_nid == res_nid)
889 for(log2 = 1; lhs_size > (1u << log2); ++log2)
896 if(op_signed_p && (res.size() ==
index + log2 + 1))
918 const auto shift_value =
static_cast<unsigned long long>(cst_val);
919 for(
auto shift_value_it = 0u; shift_value_it < shift_value; shift_value_it++)
925 while(res.size() > shifted_type_size)
931 const auto lhs_sign_extend_end =
932 lhs_bitstring.begin() +
933 static_cast<decltype(lhs_bitstring)::difference_type
>(lhs_bitstring.size() + shift_value - lhs_size);
934 if(std::find(lhs_bitstring.begin(), lhs_sign_extend_end,
bit_lattice::U) != lhs_sign_extend_end)
940 else if(rhs_kind == truth_and_expr_K || rhs_kind == truth_andif_expr_K || rhs_kind == truth_or_expr_K ||
941 rhs_kind == truth_orif_expr_K || rhs_kind == truth_xor_expr_K)
943 if(op0_nid != res_nid)
945 std::swap(op0_nid, op0_nid);
946 std::swap(op0_bitstring, op1_bitstring);
949 while(res.size() > 1)
954 else if(rhs_kind == extract_bit_expr_K)
956 if(op1_nid == res_nid)
967 const auto shift_value =
static_cast<unsigned long long>(cst_val);
968 for(
auto shift_value_it = 0u; shift_value_it < shift_value; shift_value_it++)
973 while(res.size() < shifted_type_size)
977 while(res.size() > shifted_type_size)
990 case bit_ior_concat_expr_K:
994 case ternary_plus_expr_K:
995 case ternary_pm_expr_K:
996 case ternary_mp_expr_K:
997 case ternary_mm_expr_K:
1003 auto op0_bitstring =
best.at(op0_nid);
1007 auto op1_bitstring =
best.at(op1_nid);
1011 auto op2_bitstring =
best.at(op2_nid);
1013 THROW_ASSERT(res_nid == op0_nid || res_nid == op1_nid || res_nid == op2_nid,
1014 "Invalid operand: " +
STR(res_nid) +
" (" + ga->
ToString() +
")");
1022 if(rhs_kind == bit_ior_concat_expr_K)
1024 if(op2_nid == res_nid)
1028 const auto lhs_bitsize = lhs_bitstring.size();
1030 if(op0_nid == res_nid)
1034 if(op1_nid == res_nid)
1037 op0_bitstring = op1_bitstring;
1041 const auto initial_size = op0_bitstring.size();
1042 auto se_lhs_bitstring = lhs_bitstring;
1043 if(initial_size < lhs_bitsize)
1047 if(initial_size > lhs_bitsize)
1052 auto it_lhs_bitstring = se_lhs_bitstring.rbegin();
1053 auto it_op0_bitstring = op0_bitstring.rbegin();
1057 for(; it_lhs_bitstring != se_lhs_bitstring.rend() && it_op0_bitstring != op0_bitstring.rend() &&
1059 ++it_lhs_bitstring, ++it_op0_bitstring, ++
index)
1061 res.push_front(*it_lhs_bitstring);
1070 for(; it_lhs_bitstring != se_lhs_bitstring.rend() && it_op0_bitstring != op0_bitstring.rend();
1071 ++it_lhs_bitstring, ++it_op0_bitstring, ++
index)
1079 res.push_front(*it_lhs_bitstring);
1084 else if(rhs_kind == cond_expr_K)
1086 if(op0_nid == res_nid)
1091 if(op1_nid != res_nid)
1093 std::swap(op1_nid, op2_nid);
1094 std::swap(op1_bitstring, op2_bitstring);
1097 auto it_lhs_bitstring = lhs_bitstring.rbegin();
1098 auto it_op1_bitstring = op1_bitstring.rbegin();
1099 for(; it_lhs_bitstring != lhs_bitstring.rend() && it_op1_bitstring != op1_bitstring.rend();
1100 ++it_lhs_bitstring, ++it_op1_bitstring)
1108 res.push_front(*it_op1_bitstring);
1111 if(res.front() ==
bit_lattice::X && op1_bitstring.size() < lhs_bitstring.size())
1113 const auto arg1_sign = op1_bitstring.front();
1115 res.push_front(arg1_sign);
1118 else if(rhs_kind == fshl_expr_K || rhs_kind == fshr_expr_K)
1122 if(op2_nid == res_nid)
1128 if(op0_nid == op1_nid)
1136 if(op0_nid == res_nid)
1147 else if(rhs_kind == ternary_plus_expr_K || rhs_kind == ternary_pm_expr_K || rhs_kind == ternary_mp_expr_K ||
1148 rhs_kind == ternary_mm_expr_K)
1150 if(op0_nid == res_nid)
1152 res = op0_bitstring;
1154 if(op1_nid == res_nid)
1156 res = op1_bitstring;
1158 if(op2_nid == res_nid)
1160 res = op2_bitstring;
1162 const auto initial_size = res.size();
1166 res_size =
std::min(res_size, static_cast<unsigned long long>(lhs_bitstring.size()));
1170 res_size =
std::min(res_size, static_cast<unsigned long long>(lhs_bitstring.size() - 1));
1172 while(res.size() > res_size)
1176 if(res.size() != initial_size)
1201 case aggr_init_expr_K:
1204 const auto call = GetPointerS<const call_expr>(
GET_CONST_NODE(rhs));
1208 const auto called_id = call_it->second;
1209 const auto tn =
TM->CGetTreeNode(called_id);
1210 const auto fd = GetPointerS<const function_decl>(tn);
1212 const auto actual_parms = call->args;
1213 const auto formal_parms = fd->list_of_args;
1214 THROW_ASSERT(actual_parms.size() == formal_parms.size(),
"");
1215 auto a_it = actual_parms.cbegin();
1216 auto a_end = actual_parms.cend();
1217 auto f_it = formal_parms.cbegin();
1218 auto f_end = formal_parms.cend();
1219 bool found = actual_parms.empty();
1220 for(; a_it != a_end && f_it != f_end; a_it++, f_it++)
1225 const auto parmssa =
TM->CGetTreeNode(p_decl_id);
1226 const auto pd = GetPointerS<const ssa_name>(parmssa);
1227 std::deque<bit_lattice> tmp;
1228 if(pd->bit_values.empty())
1237 res = found ?
inf(res, tmp, res_nid) : tmp;
1241 THROW_ASSERT(found,
STR(res_nid) +
" is not an actual parameter of function " +
STR(called_id));
1253 case alignof_expr_K:
1256 case exact_div_expr_K:
1265 case ordered_expr_K:
1266 case sat_minus_expr_K:
1267 case sat_plus_expr_K:
1268 case trunc_div_expr_K:
1269 case trunc_mod_expr_K:
1275 case unordered_expr_K:
1276 case extractvalue_expr_K:
1277 case extractelement_expr_K:
1280 case insertvalue_expr_K:
1281 case insertelement_expr_K:
1290 case cleanup_point_expr_K:
1293 case fix_ceil_expr_K:
1294 case fix_floor_expr_K:
1295 case fix_round_expr_K:
1296 case fix_trunc_expr_K:
1298 case imagpart_expr_K:
1299 case indirect_ref_K:
1300 case misaligned_indirect_ref_K:
1302 case non_lvalue_expr_K:
1304 case realpart_expr_K:
1305 case reference_expr_K:
1306 case reinterpret_cast_expr_K:
1308 case static_cast_expr_K:
1312 case reduc_max_expr_K:
1313 case reduc_min_expr_K:
1314 case reduc_plus_expr_K:
1315 case vec_unpack_hi_expr_K:
1316 case vec_unpack_lo_expr_K:
1317 case vec_unpack_float_hi_expr_K:
1318 case vec_unpack_float_lo_expr_K:
1322 case ceil_div_expr_K:
1323 case ceil_mod_expr_K:
1324 case complex_expr_K:
1325 case compound_expr_K:
1326 case eh_filter_expr_K:
1328 case floor_div_expr_K:
1329 case floor_mod_expr_K:
1330 case goto_subroutine_K:
1334 case mult_highpart_expr_K:
1335 case postdecrement_expr_K:
1336 case postincrement_expr_K:
1337 case predecrement_expr_K:
1338 case preincrement_expr_K:
1342 case round_div_expr_K:
1343 case round_mod_expr_K:
1345 case try_catch_expr_K:
1347 case widen_sum_expr_K:
1348 case with_size_expr_K:
1349 case vec_lshift_expr_K:
1350 case vec_rshift_expr_K:
1351 case widen_mult_hi_expr_K:
1352 case widen_mult_lo_expr_K:
1353 case vec_pack_trunc_expr_K:
1354 case vec_pack_sat_expr_K:
1355 case vec_pack_fix_trunc_expr_K:
1356 case vec_extracteven_expr_K:
1357 case vec_extractodd_expr_K:
1358 case vec_interleavehigh_expr_K:
1359 case vec_interleavelow_expr_K:
1361 case component_ref_K:
1362 case bit_field_ref_K:
1364 case with_cleanup_expr_K:
1365 case obj_type_ref_K:
1367 case vec_cond_expr_K:
1368 case vec_perm_expr_K:
1369 case dot_prod_expr_K:
1371 case array_range_ref_K:
1381 case case_label_expr_K:
1384 case identifier_node_K:
1385 case statement_list_K:
1387 case target_mem_ref_K:
1388 case target_mem_ref461_K:
1399 while(res.size() > res_size)
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
File containing functions and utilities to support the printing of debug messagges.
static bool is_int(const tree_managerConstRef &TM, const unsigned int index)
Return true if the treenode is of integer type.
std::string ToString() const
Print this node as string in gimple format.
#define DEBUG_LEVEL_PEDANTIC
very verbose debugging print is performed.
std::deque< bit_lattice > create_x_bitstring(size_t lenght)
Create a bitstring containing bits initialized at <X>
tree_nodeRef op1
The second operand of the binary expression.
std::deque< bit_lattice > backward_chain(const tree_nodeConstRef &ssa) const
Definition of the class representing a generic C application.
#define CASE_DECL_NODES
NOTE that cast_expr is a unary expression but it could not be included in the CASE_UNARY_EXPRESSION b...
mathematical utility function not provided by standard libraries
static std::string GetString(const enum kind k)
Given a kind, return the corresponding string.
bool bitstring_constant(const std::deque< bit_lattice > &a)
Checks if a bitstring is constant.
Full implementation of Bit Value analysis as described in BitValue Inference: Detecting and Exploitin...
tree_nodeRef op0
The first operand of the binary expression.
bool IsHandledByBitvalue(const tree_nodeConstRef &tn) const
Returns true if the type identified by type_id is handled by bitvalue analysis.
void backward()
Applies the backward algorithm, as described in the paper, analyzing each assignment statement starti...
#define GET_INDEX_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
Data structure describing a basic block at tree level.
static void get_required_values(std::vector< std::tuple< unsigned int, unsigned int >> &required, const tree_nodeRef &tn)
static bit_lattice bit_inf(const bit_lattice a, const bit_lattice b)
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
std::deque< bit_lattice > backward_transfer(const gimple_assign *ga, unsigned int output_id) const
Compute the inputs back propagation values, given a gimple assignment and the uid of the output varia...
static bool IsSignedIntegerType(const tree_nodeConstRef &type)
Return true if the treenode is of integer type.
std::string bitstring_to_string(const std::deque< bit_lattice > &bitstring)
Translates a bitstring ( expressed as an std::deque of bit_lattice ) into a string of characters...
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
T ceil_log2(T x)
Return the smallest n such that 2**n >= X.
std::deque< bit_lattice > inf(const std::deque< bit_lattice > &a, const std::deque< bit_lattice > &b, const unsigned int output_uid) const
Computes the inf between two bitstrings.
unsigned long long pointer_resizing(unsigned int output_id) const
This class specifies the characteristic of a particular operation working on a given functional unit...
This struct specifies the gimple_assign node (GCC 4.3 tree node).
#define CASE_UNARY_EXPRESSION
This macro collects all case labels for unary_expr objects.
std::deque< bit_lattice > create_u_bitstring(size_t lenght)
Creates a bitstring containing bits initialized at <U>
CustomMap< unsigned int, std::deque< bit_lattice > > current
Map of the current bit-values of each variable.
bool update_current(std::deque< bit_lattice > &res, const tree_nodeConstRef &tn)
Given a bitstring res, and the id of a tree node ouput_uid, this functions checks if it is necessary ...
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...
static unsigned long long size(const tree_managerConstRef tm, unsigned int index)
unsigned offset[NUM_VERTICES+1]
#define GET_CONST_NODE(t)
static unsigned long long Size(const tree_nodeConstRef &t)
Classes specification of the tree_node data structures.
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
const tree_managerConstRef TM
#define CASE_TYPE_NODES
This macro collects all case labels for type objects.
This file collects some utility functions.
std::deque< bit_lattice > string_to_bitstring(const std::string &s)
inverse of bitstring_to_string
CustomUnorderedMapUnstable< unsigned int, unsigned int > direct_call_id_to_called_id
Maps the id of a gimple statement to the id of the function called in that statement.
const unsigned int function_id
The index of the function to be analyzed.
#define CASE_CST_NODES
This macro collects all case labels for cast nodes.
const application_managerRef AppM
The application manager.
Class specification of the tree_reindex support class.
#define CASE_FAKE_NODES
This macro collects all case labels for fake or empty nodes.
std::vector< blocRef > bb_topological
Topologically ordered basic blocks.
CustomMap< unsigned int, std::deque< bit_lattice > > best
Map of the best bit-values of each variable.
static tree_nodeConstRef CGetType(const tree_nodeConstRef &node)
Return the treenode of the type of node.
static std::deque< bit_lattice > sign_extend_bitstring(const std::deque< bit_lattice > &bitstring, bool bitstring_is_signed, size_t final_size)
Extends a bitstring.
#define CASE_CPP_NODES
This macro collects all case labels for cpp nodes.
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.
int debug_level
The debug level.
#define GET_INDEX_CONST_NODE(t)
bool IsSignedIntegerType(const tree_nodeConstRef &tn) const
std::deque< bit_lattice > get_current_or_best(const tree_nodeConstRef &tn) const
Given an operand, returns its current bitvalue, or its best if current is not available.
#define CASE_TERNARY_EXPRESSION
This macro collects all case labels for ternary_expr objects.
Class specification of the manager of the tree structures extracted from the raw file.
A brief description of the C++ Header File.
#define CASE_PRAGMA_NODES
This macro collects all case labels for pragma objects.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...