stage3/fill_candidate_datatypes.cc
changeset 487 1619b2fe03e1
parent 484 f78750994a82
child 488 c833f83aac8c
equal deleted inserted replaced
486:e22150ad75fd 487:1619b2fe03e1
  1126 void *fill_candidate_datatypes_c::visit( LE_operator_c *symbol) {return handle_binary_operator(widen_CMP_table, symbol, prev_il_instruction, il_operand);}
  1126 void *fill_candidate_datatypes_c::visit( LE_operator_c *symbol) {return handle_binary_operator(widen_CMP_table, symbol, prev_il_instruction, il_operand);}
  1127 void *fill_candidate_datatypes_c::visit( NE_operator_c *symbol) {return handle_binary_operator(widen_CMP_table, symbol, prev_il_instruction, il_operand);}
  1127 void *fill_candidate_datatypes_c::visit( NE_operator_c *symbol) {return handle_binary_operator(widen_CMP_table, symbol, prev_il_instruction, il_operand);}
  1128 
  1128 
  1129 
  1129 
  1130 
  1130 
  1131 void *fill_candidate_datatypes_c::visit(CAL_operator_c *symbol) {
  1131 void *fill_candidate_datatypes_c::handle_conditional_il_flow_control_operator(symbol_c *symbol) {
  1132 	if (NULL == prev_il_instruction) return NULL;
       
  1133 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
       
  1134 	        /* does not need to be bool type !! */
       
  1135 		add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
       
  1136 	}
       
  1137 	if (debug) std::cout <<  "CAL [" << prev_il_instruction->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
       
  1138 	return NULL;
       
  1139 }
       
  1140 
       
  1141 void *fill_candidate_datatypes_c::visit(CALC_operator_c *symbol) {
       
  1142 	if (NULL == prev_il_instruction) return NULL;
  1132 	if (NULL == prev_il_instruction) return NULL;
  1143 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
  1133 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
  1144 		if (is_ANY_BOOL_compatible(prev_il_instruction->candidate_datatypes[i]))
  1134 		if (is_ANY_BOOL_compatible(prev_il_instruction->candidate_datatypes[i]))
  1145 			add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
  1135 			add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
  1146 	}
  1136 	}
  1147 	if (debug) std::cout <<  "CALC [" << prev_il_instruction->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
  1137 	return NULL;
  1148 	return NULL;
  1138 }
  1149 }
  1139 
  1150 
  1140 void *fill_candidate_datatypes_c::visit(  CAL_operator_c *symbol) {if (NULL == prev_il_instruction) return NULL; symbol->candidate_datatypes = prev_il_instruction->candidate_datatypes; return NULL;}
  1151 void *fill_candidate_datatypes_c::visit(CALCN_operator_c *symbol) {
  1141 void *fill_candidate_datatypes_c::visit(  RET_operator_c *symbol) {if (NULL == prev_il_instruction) return NULL; symbol->candidate_datatypes = prev_il_instruction->candidate_datatypes; return NULL;}
  1152 	if (NULL == prev_il_instruction) return NULL;
  1142 void *fill_candidate_datatypes_c::visit(  JMP_operator_c *symbol) {if (NULL == prev_il_instruction) return NULL; symbol->candidate_datatypes = prev_il_instruction->candidate_datatypes; return NULL;}
  1153 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
  1143 void *fill_candidate_datatypes_c::visit( CALC_operator_c *symbol) {return handle_conditional_il_flow_control_operator(symbol);}
  1154 		if (is_ANY_BOOL_compatible(prev_il_instruction->candidate_datatypes[i]))
  1144 void *fill_candidate_datatypes_c::visit(CALCN_operator_c *symbol) {return handle_conditional_il_flow_control_operator(symbol);}
  1155 			add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
  1145 void *fill_candidate_datatypes_c::visit( RETC_operator_c *symbol) {return handle_conditional_il_flow_control_operator(symbol);}
  1156 	}
  1146 void *fill_candidate_datatypes_c::visit(RETCN_operator_c *symbol) {return handle_conditional_il_flow_control_operator(symbol);}
  1157 	if (debug) std::cout <<  "CALCN [" << prev_il_instruction->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
  1147 void *fill_candidate_datatypes_c::visit( JMPC_operator_c *symbol) {return handle_conditional_il_flow_control_operator(symbol);}
  1158 	return NULL;
  1148 void *fill_candidate_datatypes_c::visit(JMPCN_operator_c *symbol) {return handle_conditional_il_flow_control_operator(symbol);}
  1159 }
  1149 
  1160 
  1150 
  1161 void *fill_candidate_datatypes_c::visit(RET_operator_c *symbol) {
  1151 
  1162 	if (NULL == prev_il_instruction) return NULL;
  1152 
  1163 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
       
  1164 	        /* does not need to be bool type !! */
       
  1165 		add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
       
  1166 	}
       
  1167 	if (debug) std::cout <<  "RET [" << prev_il_instruction->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
       
  1168 	return NULL;
       
  1169 }
       
  1170 
       
  1171 void *fill_candidate_datatypes_c::visit(RETC_operator_c *symbol) {
       
  1172 	if (NULL == prev_il_instruction) return NULL;
       
  1173 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
       
  1174 		if (is_ANY_BOOL_compatible(prev_il_instruction->candidate_datatypes[i]))
       
  1175 			add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
       
  1176 	}
       
  1177 	if (debug) std::cout <<  "RETC [" << prev_il_instruction->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
       
  1178 	return NULL;
       
  1179 }
       
  1180 
       
  1181 void *fill_candidate_datatypes_c::visit(RETCN_operator_c *symbol) {
       
  1182 	if (NULL == prev_il_instruction) return NULL;
       
  1183 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
       
  1184 		if (is_ANY_BOOL_compatible(prev_il_instruction->candidate_datatypes[i]))
       
  1185 			add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
       
  1186 	}
       
  1187 	if (debug) std::cout <<  "RETCN [" << prev_il_instruction->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
       
  1188 	return NULL;
       
  1189 }
       
  1190 
       
  1191 void *fill_candidate_datatypes_c::visit(JMP_operator_c *symbol) {
       
  1192 	if (NULL == prev_il_instruction) return NULL;
       
  1193 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
       
  1194 	        /* does not need to be bool type !! */
       
  1195 		add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
       
  1196 	}
       
  1197 	if (debug) std::cout <<  "JMP [" << prev_il_instruction->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
       
  1198 	return NULL;
       
  1199 }
       
  1200 
       
  1201 void *fill_candidate_datatypes_c::visit(JMPC_operator_c *symbol) {
       
  1202 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
       
  1203 		if (is_ANY_BOOL_compatible(prev_il_instruction->candidate_datatypes[i]))
       
  1204 			add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
       
  1205 	}
       
  1206 	if (debug) std::cout <<  "JMPC [" << prev_il_instruction->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
       
  1207 	return NULL;
       
  1208 }
       
  1209 
       
  1210 void *fill_candidate_datatypes_c::visit(JMPCN_operator_c *symbol) {
       
  1211 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
       
  1212 		if (is_ANY_BOOL_compatible(prev_il_instruction->candidate_datatypes[i]))
       
  1213 			add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
       
  1214 	}
       
  1215 	if (debug) std::cout <<  "JMPCN [" << prev_il_instruction->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
       
  1216 	return NULL;
       
  1217 }
       
  1218 /* Symbol class handled together with function call checks */
  1153 /* Symbol class handled together with function call checks */
  1219 // void *visit(il_assign_operator_c *symbol, variable_name);
  1154 // void *visit(il_assign_operator_c *symbol, variable_name);
  1220 /* Symbol class handled together with function call checks */
  1155 /* Symbol class handled together with function call checks */
  1221 // void *visit(il_assign_operator_c *symbol, option, variable_name);
  1156 // void *visit(il_assign_operator_c *symbol, option, variable_name);
  1222 
  1157