stage3/fill_candidate_datatypes.cc
changeset 440 a745f7d38a5d
parent 439 cf7d6862033d
child 441 e8de43eefcc5
equal deleted inserted replaced
439:cf7d6862033d 440:a745f7d38a5d
   932 	if (NULL == prev_il_instruction) return NULL;
   932 	if (NULL == prev_il_instruction) return NULL;
   933 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
   933 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
   934 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
   934 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
   935 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
   935 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
   936 			operand_type = il_operand->candidate_datatypes[j];
   936 			operand_type = il_operand->candidate_datatypes[j];
   937 			if (is_type_equal(prev_instruction_type,operand_type))
   937 			if (is_type_equal(prev_instruction_type, operand_type))
   938 				symbol->candidate_datatypes.push_back(prev_instruction_type);
   938 				symbol->candidate_datatypes.push_back(prev_instruction_type);
   939 		}
   939 		}
   940 	}
   940 	}
   941 	if (debug) std::cout << "ST [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
   941 	if (debug) std::cout << "ST [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
   942 	prev_il_instruction = symbol;
   942 	prev_il_instruction = symbol;
   949 	if (NULL == prev_il_instruction) return NULL;
   949 	if (NULL == prev_il_instruction) return NULL;
   950 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
   950 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
   951 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
   951 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
   952 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
   952 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
   953 			operand_type = il_operand->candidate_datatypes[j];
   953 			operand_type = il_operand->candidate_datatypes[j];
   954 			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BIT_compatible(il_operand->candidate_datatypes[i]))
   954 			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BIT_compatible(operand_type))
   955 				symbol->candidate_datatypes.push_back(prev_instruction_type);
   955 				symbol->candidate_datatypes.push_back(prev_instruction_type);
   956 		}
   956 		}
   957 	}
   957 	}
   958 	if (debug) std::cout << "STN [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
   958 	if (debug) std::cout << "STN [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
   959 	prev_il_instruction = symbol;
   959 	prev_il_instruction = symbol;
   971 	if (NULL == prev_il_instruction) return NULL;
   971 	if (NULL == prev_il_instruction) return NULL;
   972 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
   972 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
   973 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
   973 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
   974 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
   974 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
   975 			operand_type = il_operand->candidate_datatypes[j];
   975 			operand_type = il_operand->candidate_datatypes[j];
   976 			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(il_operand->candidate_datatypes[i]))
   976 			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type))
   977 				symbol->candidate_datatypes.push_back(prev_instruction_type);
   977 				symbol->candidate_datatypes.push_back(prev_instruction_type);
   978 		}
   978 		}
   979 	}
   979 	}
   980 	if (debug) std::cout << "S [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
   980 	if (debug) std::cout << "S [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
   981 	prev_il_instruction = symbol;
   981 	prev_il_instruction = symbol;
   988 	if (NULL == prev_il_instruction) return NULL;
   988 	if (NULL == prev_il_instruction) return NULL;
   989 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
   989 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
   990 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
   990 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
   991 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
   991 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
   992 			operand_type = il_operand->candidate_datatypes[j];
   992 			operand_type = il_operand->candidate_datatypes[j];
   993 			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(il_operand->candidate_datatypes[i]))
   993 			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type))
   994 				symbol->candidate_datatypes.push_back(prev_instruction_type);
   994 				symbol->candidate_datatypes.push_back(prev_instruction_type);
   995 		}
   995 		}
   996 	}
   996 	}
   997 	if (debug) std::cout << "R [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
   997 	if (debug) std::cout << "R [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
   998 	prev_il_instruction = symbol;
   998 	prev_il_instruction = symbol;
  1005 	if (NULL == prev_il_instruction) return NULL;
  1005 	if (NULL == prev_il_instruction) return NULL;
  1006 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
  1006 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
  1007 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
  1007 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
  1008 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
  1008 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
  1009 			operand_type = il_operand->candidate_datatypes[j];
  1009 			operand_type = il_operand->candidate_datatypes[j];
  1010 			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(il_operand->candidate_datatypes[i]))
  1010 			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type))
  1011 				symbol->candidate_datatypes.push_back(prev_instruction_type);
  1011 				symbol->candidate_datatypes.push_back(prev_instruction_type);
  1012 		}
  1012 		}
  1013 	}
  1013 	}
  1014 	if (debug) std::cout << "S1 [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
  1014 	if (debug) std::cout << "S1 [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
  1015 	prev_il_instruction = symbol;
  1015 	prev_il_instruction = symbol;
  1022 	if (NULL == prev_il_instruction) return NULL;
  1022 	if (NULL == prev_il_instruction) return NULL;
  1023 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
  1023 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
  1024 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
  1024 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
  1025 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
  1025 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
  1026 			operand_type = il_operand->candidate_datatypes[j];
  1026 			operand_type = il_operand->candidate_datatypes[j];
  1027 			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(il_operand->candidate_datatypes[i]))
  1027 			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type))
  1028 				symbol->candidate_datatypes.push_back(prev_instruction_type);
  1028 				symbol->candidate_datatypes.push_back(prev_instruction_type);
  1029 		}
  1029 		}
  1030 	}
  1030 	}
  1031 	if (debug) std::cout << "R1 [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
  1031 	if (debug) std::cout << "R1 [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
  1032 	prev_il_instruction = symbol;
  1032 	prev_il_instruction = symbol;