changeset 443 | ff4d26b7e51d |
parent 442 | bd5998ee8876 |
child 445 | e6c34ee82954 |
442:bd5998ee8876 | 443:ff4d26b7e51d |
---|---|
46 |
46 |
47 /* set to 1 to see debug info during execution */ |
47 /* set to 1 to see debug info during execution */ |
48 static int debug = 0; |
48 static int debug = 0; |
49 |
49 |
50 fill_candidate_datatypes_c::fill_candidate_datatypes_c(symbol_c *ignore) { |
50 fill_candidate_datatypes_c::fill_candidate_datatypes_c(symbol_c *ignore) { |
51 |
|
52 } |
51 } |
53 |
52 |
54 fill_candidate_datatypes_c::~fill_candidate_datatypes_c(void) { |
53 fill_candidate_datatypes_c::~fill_candidate_datatypes_c(void) { |
55 } |
54 } |
56 |
55 |
66 |
65 |
67 |
66 |
68 |
67 |
69 /* returns true if compatible function/FB invocation, otherwise returns false */ |
68 /* returns true if compatible function/FB invocation, otherwise returns false */ |
70 /* Assumes that the candidate_datatype lists of all the parameters being passed haved already been filled in */ |
69 /* Assumes that the candidate_datatype lists of all the parameters being passed haved already been filled in */ |
70 /* |
|
71 * All parameters being passed to the called function MUST be in the parameter list to which f_call points to! |
|
72 * This means that, for non formal function calls in IL, de current (default value) must be artificially added to the |
|
73 * beginning of the parameter list BEFORE calling handle_function_call(). |
|
74 */ |
|
71 bool fill_candidate_datatypes_c::match_nonformal_call(symbol_c *f_call, symbol_c *f_decl) { |
75 bool fill_candidate_datatypes_c::match_nonformal_call(symbol_c *f_call, symbol_c *f_decl) { |
72 symbol_c *call_param_value, *param_type; |
76 symbol_c *call_param_value, *param_type; |
73 identifier_c *param_name; |
77 identifier_c *param_name; |
74 function_param_iterator_c fp_iterator(f_decl); |
78 function_param_iterator_c fp_iterator(f_decl); |
75 function_call_param_iterator_c fcp_iterator(f_call); |
79 function_call_param_iterator_c fcp_iterator(f_call); |
542 } |
546 } |
543 } |
547 } |
544 return NULL; |
548 return NULL; |
545 } |
549 } |
546 |
550 |
547 |
551 /* TYPE type_declaration_list END_TYPE */ |
552 // SYM_REF1(data_type_declaration_c, type_declaration_list) |
|
553 /* NOTE: Not required. already handled by iterator_visitor_c base class */ |
|
554 /* |
|
548 void *fill_candidate_datatypes_c::visit(data_type_declaration_c *symbol) { |
555 void *fill_candidate_datatypes_c::visit(data_type_declaration_c *symbol) { |
549 // TODO !!! |
556 symbol->type_declaration_list->accept(*this); |
550 /* for the moment we must return NULL so semantic analysis of remaining code is not interrupted! */ |
557 return NULL; |
551 return NULL; |
558 } |
552 } |
559 */ |
553 |
560 |
554 void *fill_candidate_datatypes_c::visit(enumerated_value_c *symbol) { |
561 void *fill_candidate_datatypes_c::visit(enumerated_value_c *symbol) { |
555 symbol_c *enumerated_type; |
562 symbol_c *enumerated_type; |
556 |
563 |
557 if (NULL != symbol->type) |
564 if (NULL != symbol->type) |
676 void *fill_candidate_datatypes_c::visit(function_declaration_c *symbol) { |
683 void *fill_candidate_datatypes_c::visit(function_declaration_c *symbol) { |
677 search_varfb_instance_type = new search_varfb_instance_type_c(symbol); |
684 search_varfb_instance_type = new search_varfb_instance_type_c(symbol); |
678 symbol->var_declarations_list->accept(*this); |
685 symbol->var_declarations_list->accept(*this); |
679 if (debug) printf("Filling candidate data types list in body of function %s\n", ((token_c *)(symbol->derived_function_name))->value); |
686 if (debug) printf("Filling candidate data types list in body of function %s\n", ((token_c *)(symbol->derived_function_name))->value); |
680 il_parenthesis_level = 0; |
687 il_parenthesis_level = 0; |
681 prev_il_instruction = NULL; |
|
682 symbol->function_body->accept(*this); |
688 symbol->function_body->accept(*this); |
683 prev_il_instruction = NULL; |
|
684 delete search_varfb_instance_type; |
689 delete search_varfb_instance_type; |
685 search_varfb_instance_type = NULL; |
690 search_varfb_instance_type = NULL; |
686 return NULL; |
691 return NULL; |
687 } |
692 } |
688 |
693 |
692 void *fill_candidate_datatypes_c::visit(function_block_declaration_c *symbol) { |
697 void *fill_candidate_datatypes_c::visit(function_block_declaration_c *symbol) { |
693 search_varfb_instance_type = new search_varfb_instance_type_c(symbol); |
698 search_varfb_instance_type = new search_varfb_instance_type_c(symbol); |
694 symbol->var_declarations->accept(*this); |
699 symbol->var_declarations->accept(*this); |
695 if (debug) printf("Filling candidate data types list in body of FB %s\n", ((token_c *)(symbol->fblock_name))->value); |
700 if (debug) printf("Filling candidate data types list in body of FB %s\n", ((token_c *)(symbol->fblock_name))->value); |
696 il_parenthesis_level = 0; |
701 il_parenthesis_level = 0; |
697 prev_il_instruction = NULL; |
|
698 symbol->fblock_body->accept(*this); |
702 symbol->fblock_body->accept(*this); |
699 prev_il_instruction = NULL; |
|
700 delete search_varfb_instance_type; |
703 delete search_varfb_instance_type; |
701 search_varfb_instance_type = NULL; |
704 search_varfb_instance_type = NULL; |
702 return NULL; |
705 return NULL; |
703 } |
706 } |
704 |
707 |
708 void *fill_candidate_datatypes_c::visit(program_declaration_c *symbol) { |
711 void *fill_candidate_datatypes_c::visit(program_declaration_c *symbol) { |
709 search_varfb_instance_type = new search_varfb_instance_type_c(symbol); |
712 search_varfb_instance_type = new search_varfb_instance_type_c(symbol); |
710 symbol->var_declarations->accept(*this); |
713 symbol->var_declarations->accept(*this); |
711 if (debug) printf("Filling candidate data types list in body of program %s\n", ((token_c *)(symbol->program_type_name))->value); |
714 if (debug) printf("Filling candidate data types list in body of program %s\n", ((token_c *)(symbol->program_type_name))->value); |
712 il_parenthesis_level = 0; |
715 il_parenthesis_level = 0; |
713 prev_il_instruction = NULL; |
|
714 symbol->function_block_body->accept(*this); |
716 symbol->function_block_body->accept(*this); |
715 prev_il_instruction = NULL; |
|
716 delete search_varfb_instance_type; |
717 delete search_varfb_instance_type; |
717 search_varfb_instance_type = NULL; |
718 search_varfb_instance_type = NULL; |
718 return NULL; |
719 return NULL; |
719 } |
720 } |
720 |
721 |
735 /* B.2 - Language IL (Instruction List) */ |
736 /* B.2 - Language IL (Instruction List) */ |
736 /****************************************/ |
737 /****************************************/ |
737 /***********************************/ |
738 /***********************************/ |
738 /* B 2.1 Instructions and Operands */ |
739 /* B 2.1 Instructions and Operands */ |
739 /***********************************/ |
740 /***********************************/ |
741 |
|
742 /*| instruction_list il_instruction */ |
|
743 // SYM_LIST(instruction_list_c) |
|
740 // void *visit(instruction_list_c *symbol); |
744 // void *visit(instruction_list_c *symbol); |
745 |
|
746 |
|
747 /* | label ':' [il_incomplete_instruction] eol_list */ |
|
748 // SYM_REF2(il_instruction_c, label, il_instruction) |
|
749 // void *visit(instruction_list_c *symbol); |
|
750 void *fill_candidate_datatypes_c::visit(il_instruction_c *symbol) { |
|
751 if (NULL == symbol->il_instruction) |
|
752 return NULL; |
|
753 |
|
754 prev_il_instruction = symbol->prev_il_instruction; |
|
755 symbol->il_instruction->accept(*this); |
|
756 /* This object has (inherits) the same candidate datatypes as the il_instruction */ |
|
757 copy_candidate_datatype_list(symbol->il_instruction /*from*/, symbol /*to*/); |
|
758 prev_il_instruction = NULL; |
|
759 |
|
760 return NULL; |
|
761 } |
|
762 |
|
763 |
|
764 |
|
741 void *fill_candidate_datatypes_c::visit(il_simple_operation_c *symbol) { |
765 void *fill_candidate_datatypes_c::visit(il_simple_operation_c *symbol) { |
742 /* determine the data type of the operand */ |
766 /* determine the data type of the operand */ |
743 if (NULL != symbol->il_operand) { |
767 if (NULL != symbol->il_operand) { |
744 symbol->il_operand->accept(*this); |
768 symbol->il_operand->accept(*this); |
745 } |
769 } |
746 /* recursive call to fill the candidate data types list */ |
770 /* recursive call to fill the candidate data types list */ |
747 il_operand = symbol->il_operand; |
771 il_operand = symbol->il_operand; |
748 symbol->il_simple_operator->accept(*this); |
772 symbol->il_simple_operator->accept(*this); |
749 il_operand = NULL; |
773 il_operand = NULL; |
774 /* This object has (inherits) the same candidate datatypes as the il_simple_operator */ |
|
775 copy_candidate_datatype_list(symbol->il_simple_operator /*from*/, symbol /*to*/); |
|
750 return NULL; |
776 return NULL; |
751 } |
777 } |
752 |
778 |
753 |
779 |
754 /* | function_name [il_operand_list] */ |
780 /* | function_name [il_operand_list] */ |
895 void *fill_candidate_datatypes_c::visit(LD_operator_c *symbol) { |
921 void *fill_candidate_datatypes_c::visit(LD_operator_c *symbol) { |
896 for(unsigned int i = 0; i < il_operand->candidate_datatypes.size(); i++) { |
922 for(unsigned int i = 0; i < il_operand->candidate_datatypes.size(); i++) { |
897 symbol->candidate_datatypes.push_back(il_operand->candidate_datatypes[i]); |
923 symbol->candidate_datatypes.push_back(il_operand->candidate_datatypes[i]); |
898 } |
924 } |
899 if (debug) std::cout << "LD [" << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
925 if (debug) std::cout << "LD [" << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
900 prev_il_instruction = symbol; |
|
901 return NULL; |
926 return NULL; |
902 } |
927 } |
903 |
928 |
904 void *fill_candidate_datatypes_c::visit(LDN_operator_c *symbol) { |
929 void *fill_candidate_datatypes_c::visit(LDN_operator_c *symbol) { |
905 for(unsigned int i = 0; i < il_operand->candidate_datatypes.size(); i++) { |
930 for(unsigned int i = 0; i < il_operand->candidate_datatypes.size(); i++) { |
906 if (is_ANY_BIT_compatible(il_operand->candidate_datatypes[i])) |
931 if (is_ANY_BIT_compatible(il_operand->candidate_datatypes[i])) |
907 symbol->candidate_datatypes.push_back(il_operand->candidate_datatypes[i]); |
932 symbol->candidate_datatypes.push_back(il_operand->candidate_datatypes[i]); |
908 } |
933 } |
909 if (debug) std::cout << "LDN [" << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
934 if (debug) std::cout << "LDN [" << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
910 prev_il_instruction = symbol; |
|
911 return NULL; |
935 return NULL; |
912 } |
936 } |
913 |
937 |
914 void *fill_candidate_datatypes_c::visit(ST_operator_c *symbol) { |
938 void *fill_candidate_datatypes_c::visit(ST_operator_c *symbol) { |
915 symbol_c *prev_instruction_type, *operand_type; |
939 symbol_c *prev_instruction_type, *operand_type; |
922 if (is_type_equal(prev_instruction_type, operand_type)) |
946 if (is_type_equal(prev_instruction_type, operand_type)) |
923 symbol->candidate_datatypes.push_back(prev_instruction_type); |
947 symbol->candidate_datatypes.push_back(prev_instruction_type); |
924 } |
948 } |
925 } |
949 } |
926 if (debug) std::cout << "ST [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
950 if (debug) std::cout << "ST [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
927 prev_il_instruction = symbol; |
|
928 return NULL; |
951 return NULL; |
929 } |
952 } |
930 |
953 |
931 void *fill_candidate_datatypes_c::visit(STN_operator_c *symbol) { |
954 void *fill_candidate_datatypes_c::visit(STN_operator_c *symbol) { |
932 symbol_c *prev_instruction_type, *operand_type; |
955 symbol_c *prev_instruction_type, *operand_type; |
939 if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BIT_compatible(operand_type)) |
962 if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BIT_compatible(operand_type)) |
940 symbol->candidate_datatypes.push_back(prev_instruction_type); |
963 symbol->candidate_datatypes.push_back(prev_instruction_type); |
941 } |
964 } |
942 } |
965 } |
943 if (debug) std::cout << "STN [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
966 if (debug) std::cout << "STN [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
944 prev_il_instruction = symbol; |
|
945 return NULL; |
967 return NULL; |
946 } |
968 } |
947 |
969 |
948 void *fill_candidate_datatypes_c::visit(NOT_operator_c *symbol) { |
970 void *fill_candidate_datatypes_c::visit(NOT_operator_c *symbol) { |
949 prev_il_instruction = symbol; |
|
950 return NULL; |
971 return NULL; |
951 } |
972 } |
952 |
973 |
953 void *fill_candidate_datatypes_c::visit(S_operator_c *symbol) { |
974 void *fill_candidate_datatypes_c::visit(S_operator_c *symbol) { |
954 symbol_c *prev_instruction_type, *operand_type; |
975 symbol_c *prev_instruction_type, *operand_type; |
961 if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type)) |
982 if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type)) |
962 symbol->candidate_datatypes.push_back(prev_instruction_type); |
983 symbol->candidate_datatypes.push_back(prev_instruction_type); |
963 } |
984 } |
964 } |
985 } |
965 if (debug) std::cout << "S [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
986 if (debug) std::cout << "S [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
966 prev_il_instruction = symbol; |
|
967 return NULL; |
987 return NULL; |
968 } |
988 } |
969 |
989 |
970 void *fill_candidate_datatypes_c::visit(R_operator_c *symbol) { |
990 void *fill_candidate_datatypes_c::visit(R_operator_c *symbol) { |
971 symbol_c *prev_instruction_type, *operand_type; |
991 symbol_c *prev_instruction_type, *operand_type; |
978 if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type)) |
998 if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type)) |
979 symbol->candidate_datatypes.push_back(prev_instruction_type); |
999 symbol->candidate_datatypes.push_back(prev_instruction_type); |
980 } |
1000 } |
981 } |
1001 } |
982 if (debug) std::cout << "R [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1002 if (debug) std::cout << "R [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
983 prev_il_instruction = symbol; |
|
984 return NULL; |
1003 return NULL; |
985 } |
1004 } |
986 |
1005 |
987 void *fill_candidate_datatypes_c::visit(S1_operator_c *symbol) { |
1006 void *fill_candidate_datatypes_c::visit(S1_operator_c *symbol) { |
988 symbol_c *prev_instruction_type, *operand_type; |
1007 symbol_c *prev_instruction_type, *operand_type; |
995 if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type)) |
1014 if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type)) |
996 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1015 symbol->candidate_datatypes.push_back(prev_instruction_type); |
997 } |
1016 } |
998 } |
1017 } |
999 if (debug) std::cout << "S1 [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1018 if (debug) std::cout << "S1 [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1000 prev_il_instruction = symbol; |
|
1001 return NULL; |
1019 return NULL; |
1002 } |
1020 } |
1003 |
1021 |
1004 void *fill_candidate_datatypes_c::visit(R1_operator_c *symbol) { |
1022 void *fill_candidate_datatypes_c::visit(R1_operator_c *symbol) { |
1005 symbol_c *prev_instruction_type, *operand_type; |
1023 symbol_c *prev_instruction_type, *operand_type; |
1012 if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type)) |
1030 if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type)) |
1013 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1031 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1014 } |
1032 } |
1015 } |
1033 } |
1016 if (debug) std::cout << "R1 [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1034 if (debug) std::cout << "R1 [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1017 prev_il_instruction = symbol; |
|
1018 return NULL; |
1035 return NULL; |
1019 } |
1036 } |
1020 |
1037 |
1021 void *fill_candidate_datatypes_c::visit(CLK_operator_c *symbol) { |
1038 void *fill_candidate_datatypes_c::visit(CLK_operator_c *symbol) { |
1022 /* MANU: |
1039 /* MANU: |
1023 * How it works? I(MANU) don't know this function |
1040 * How it works? I(MANU) don't know this function |
1024 */ |
1041 */ |
1025 prev_il_instruction = symbol; |
|
1026 return NULL; |
1042 return NULL; |
1027 } |
1043 } |
1028 |
1044 |
1029 void *fill_candidate_datatypes_c::visit(CU_operator_c *symbol) { |
1045 void *fill_candidate_datatypes_c::visit(CU_operator_c *symbol) { |
1030 /* MANU: |
1046 /* MANU: |
1031 * How it works? I(MANU) don't know this function |
1047 * How it works? I(MANU) don't know this function |
1032 */ |
1048 */ |
1033 prev_il_instruction = symbol; |
|
1034 return NULL; |
1049 return NULL; |
1035 } |
1050 } |
1036 |
1051 |
1037 void *fill_candidate_datatypes_c::visit(CD_operator_c *symbol) { |
1052 void *fill_candidate_datatypes_c::visit(CD_operator_c *symbol) { |
1038 /* MANU: |
1053 /* MANU: |
1039 * How it works? I(MANU) don't know this function |
1054 * How it works? I(MANU) don't know this function |
1040 */ |
1055 */ |
1041 |
|
1042 prev_il_instruction = symbol; |
|
1043 return NULL; |
1056 return NULL; |
1044 } |
1057 } |
1045 |
1058 |
1046 void *fill_candidate_datatypes_c::visit(PV_operator_c *symbol) { |
1059 void *fill_candidate_datatypes_c::visit(PV_operator_c *symbol) { |
1047 /* MANU: |
1060 /* MANU: |
1048 * How it works? I(MANU) don't know this function |
1061 * How it works? I(MANU) don't know this function |
1049 */ |
1062 */ |
1050 |
|
1051 prev_il_instruction = symbol; |
|
1052 return NULL; |
1063 return NULL; |
1053 } |
1064 } |
1054 |
1065 |
1055 void *fill_candidate_datatypes_c::visit(IN_operator_c *symbol) { |
1066 void *fill_candidate_datatypes_c::visit(IN_operator_c *symbol) { |
1056 /* MANU: |
1067 /* MANU: |
1057 * How it works? I(MANU) don't know this function |
1068 * How it works? I(MANU) don't know this function |
1058 */ |
1069 */ |
1059 |
|
1060 prev_il_instruction = symbol; |
|
1061 return NULL; |
1070 return NULL; |
1062 } |
1071 } |
1063 |
1072 |
1064 void *fill_candidate_datatypes_c::visit(PT_operator_c *symbol) { |
1073 void *fill_candidate_datatypes_c::visit(PT_operator_c *symbol) { |
1065 /* MANU: |
1074 /* MANU: |
1066 * How it works? I(MANU) don't know this function |
1075 * How it works? I(MANU) don't know this function |
1067 */ |
1076 */ |
1068 |
|
1069 prev_il_instruction = symbol; |
|
1070 return NULL; |
1077 return NULL; |
1071 } |
1078 } |
1072 |
1079 |
1073 void *fill_candidate_datatypes_c::visit(AND_operator_c *symbol) { |
1080 void *fill_candidate_datatypes_c::visit(AND_operator_c *symbol) { |
1074 symbol_c *prev_instruction_type, *operand_type; |
1081 symbol_c *prev_instruction_type, *operand_type; |
1081 if (is_type_equal(prev_instruction_type, operand_type) && |
1088 if (is_type_equal(prev_instruction_type, operand_type) && |
1082 is_ANY_BIT_compatible(operand_type)) |
1089 is_ANY_BIT_compatible(operand_type)) |
1083 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1090 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1084 } |
1091 } |
1085 } |
1092 } |
1086 prev_il_instruction = symbol; |
|
1087 return NULL; |
1093 return NULL; |
1088 } |
1094 } |
1089 |
1095 |
1090 void *fill_candidate_datatypes_c::visit(OR_operator_c *symbol) { |
1096 void *fill_candidate_datatypes_c::visit(OR_operator_c *symbol) { |
1091 symbol_c *prev_instruction_type, *operand_type; |
1097 symbol_c *prev_instruction_type, *operand_type; |
1098 if (is_type_equal(prev_instruction_type, operand_type) && |
1104 if (is_type_equal(prev_instruction_type, operand_type) && |
1099 is_ANY_BIT_compatible(operand_type)) |
1105 is_ANY_BIT_compatible(operand_type)) |
1100 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1106 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1101 } |
1107 } |
1102 } |
1108 } |
1103 prev_il_instruction = symbol; |
|
1104 return NULL; |
1109 return NULL; |
1105 } |
1110 } |
1106 |
1111 |
1107 void *fill_candidate_datatypes_c::visit(XOR_operator_c *symbol) { |
1112 void *fill_candidate_datatypes_c::visit(XOR_operator_c *symbol) { |
1108 symbol_c *prev_instruction_type, *operand_type; |
1113 symbol_c *prev_instruction_type, *operand_type; |
1115 if (is_type_equal(prev_instruction_type, operand_type) && |
1120 if (is_type_equal(prev_instruction_type, operand_type) && |
1116 is_ANY_BIT_compatible(operand_type)) |
1121 is_ANY_BIT_compatible(operand_type)) |
1117 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1122 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1118 } |
1123 } |
1119 } |
1124 } |
1120 prev_il_instruction = symbol; |
|
1121 return NULL; |
1125 return NULL; |
1122 } |
1126 } |
1123 |
1127 |
1124 void *fill_candidate_datatypes_c::visit(ANDN_operator_c *symbol) { |
1128 void *fill_candidate_datatypes_c::visit(ANDN_operator_c *symbol) { |
1125 symbol_c *prev_instruction_type, *operand_type; |
1129 symbol_c *prev_instruction_type, *operand_type; |
1132 if (is_type_equal(prev_instruction_type, operand_type) && |
1136 if (is_type_equal(prev_instruction_type, operand_type) && |
1133 is_ANY_BIT_compatible(operand_type)) |
1137 is_ANY_BIT_compatible(operand_type)) |
1134 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1138 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1135 } |
1139 } |
1136 } |
1140 } |
1137 prev_il_instruction = symbol; |
|
1138 return NULL; |
1141 return NULL; |
1139 } |
1142 } |
1140 |
1143 |
1141 void *fill_candidate_datatypes_c::visit(ORN_operator_c *symbol) { |
1144 void *fill_candidate_datatypes_c::visit(ORN_operator_c *symbol) { |
1142 symbol_c *prev_instruction_type, *operand_type; |
1145 symbol_c *prev_instruction_type, *operand_type; |
1149 if (is_type_equal(prev_instruction_type, operand_type) && |
1152 if (is_type_equal(prev_instruction_type, operand_type) && |
1150 is_ANY_BIT_compatible(operand_type)) |
1153 is_ANY_BIT_compatible(operand_type)) |
1151 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1154 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1152 } |
1155 } |
1153 } |
1156 } |
1154 prev_il_instruction = symbol; |
|
1155 return NULL; |
1157 return NULL; |
1156 } |
1158 } |
1157 |
1159 |
1158 void *fill_candidate_datatypes_c::visit(XORN_operator_c *symbol) { |
1160 void *fill_candidate_datatypes_c::visit(XORN_operator_c *symbol) { |
1159 symbol_c *prev_instruction_type, *operand_type; |
1161 symbol_c *prev_instruction_type, *operand_type; |
1166 if (is_type_equal(prev_instruction_type, operand_type) && |
1168 if (is_type_equal(prev_instruction_type, operand_type) && |
1167 is_ANY_BIT_compatible(operand_type)) |
1169 is_ANY_BIT_compatible(operand_type)) |
1168 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1170 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1169 } |
1171 } |
1170 } |
1172 } |
1171 prev_il_instruction = symbol; |
|
1172 return NULL; |
1173 return NULL; |
1173 } |
1174 } |
1174 |
1175 |
1175 void *fill_candidate_datatypes_c::visit(ADD_operator_c *symbol) { |
1176 void *fill_candidate_datatypes_c::visit(ADD_operator_c *symbol) { |
1176 symbol_c *prev_instruction_type, *operand_type; |
1177 symbol_c *prev_instruction_type, *operand_type; |
1190 |
1191 |
1191 } |
1192 } |
1192 } |
1193 } |
1193 } |
1194 } |
1194 if (debug) std::cout << "ADD [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1195 if (debug) std::cout << "ADD [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1195 prev_il_instruction = symbol; |
|
1196 return NULL; |
1196 return NULL; |
1197 } |
1197 } |
1198 |
1198 |
1199 void *fill_candidate_datatypes_c::visit(SUB_operator_c *symbol) { |
1199 void *fill_candidate_datatypes_c::visit(SUB_operator_c *symbol) { |
1200 symbol_c *prev_instruction_type, *operand_type; |
1200 symbol_c *prev_instruction_type, *operand_type; |
1213 symbol->candidate_datatypes.push_back(result); |
1213 symbol->candidate_datatypes.push_back(result); |
1214 } |
1214 } |
1215 } |
1215 } |
1216 } |
1216 } |
1217 if (debug) std::cout << "SUB [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1217 if (debug) std::cout << "SUB [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1218 prev_il_instruction = symbol; |
|
1219 return NULL; |
1218 return NULL; |
1220 } |
1219 } |
1221 |
1220 |
1222 void *fill_candidate_datatypes_c::visit(MUL_operator_c *symbol) { |
1221 void *fill_candidate_datatypes_c::visit(MUL_operator_c *symbol) { |
1223 symbol_c *prev_instruction_type, *operand_type; |
1222 symbol_c *prev_instruction_type, *operand_type; |
1236 symbol->candidate_datatypes.push_back(result); |
1235 symbol->candidate_datatypes.push_back(result); |
1237 } |
1236 } |
1238 } |
1237 } |
1239 } |
1238 } |
1240 if (debug) std::cout << "MUL [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1239 if (debug) std::cout << "MUL [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1241 prev_il_instruction = symbol; |
|
1242 return NULL; |
1240 return NULL; |
1243 } |
1241 } |
1244 |
1242 |
1245 void *fill_candidate_datatypes_c::visit(DIV_operator_c *symbol) { |
1243 void *fill_candidate_datatypes_c::visit(DIV_operator_c *symbol) { |
1246 symbol_c *prev_instruction_type, *operand_type; |
1244 symbol_c *prev_instruction_type, *operand_type; |
1259 symbol->candidate_datatypes.push_back(result); |
1257 symbol->candidate_datatypes.push_back(result); |
1260 } |
1258 } |
1261 } |
1259 } |
1262 } |
1260 } |
1263 if (debug) std::cout << "DIV [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1261 if (debug) std::cout << "DIV [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1264 prev_il_instruction = symbol; |
|
1265 return NULL; |
1262 return NULL; |
1266 } |
1263 } |
1267 |
1264 |
1268 void *fill_candidate_datatypes_c::visit(MOD_operator_c *symbol) { |
1265 void *fill_candidate_datatypes_c::visit(MOD_operator_c *symbol) { |
1269 symbol_c *prev_instruction_type, *operand_type; |
1266 symbol_c *prev_instruction_type, *operand_type; |
1277 is_ANY_INT_compatible(prev_instruction_type)) |
1274 is_ANY_INT_compatible(prev_instruction_type)) |
1278 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1275 symbol->candidate_datatypes.push_back(prev_instruction_type); |
1279 } |
1276 } |
1280 } |
1277 } |
1281 if (debug) std::cout << "MOD [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1278 if (debug) std::cout << "MOD [" << prev_il_instruction->candidate_datatypes.size() << "," << il_operand->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1282 prev_il_instruction = symbol; |
|
1283 return NULL; |
1279 return NULL; |
1284 } |
1280 } |
1285 |
1281 |
1286 void *fill_candidate_datatypes_c::visit(GT_operator_c *symbol) { |
1282 void *fill_candidate_datatypes_c::visit(GT_operator_c *symbol) { |
1287 bool found = false; |
1283 bool found = false; |
1295 break; |
1291 break; |
1296 } |
1292 } |
1297 } |
1293 } |
1298 } |
1294 } |
1299 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1295 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1300 prev_il_instruction = symbol; |
|
1301 return NULL; |
1296 return NULL; |
1302 } |
1297 } |
1303 |
1298 |
1304 void *fill_candidate_datatypes_c::visit(GE_operator_c *symbol) { |
1299 void *fill_candidate_datatypes_c::visit(GE_operator_c *symbol) { |
1305 bool found = false; |
1300 bool found = false; |
1313 break; |
1308 break; |
1314 } |
1309 } |
1315 } |
1310 } |
1316 } |
1311 } |
1317 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1312 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1318 prev_il_instruction = symbol; |
|
1319 return NULL; |
1313 return NULL; |
1320 } |
1314 } |
1321 |
1315 |
1322 void *fill_candidate_datatypes_c::visit(EQ_operator_c *symbol) { |
1316 void *fill_candidate_datatypes_c::visit(EQ_operator_c *symbol) { |
1323 bool found = false; |
1317 bool found = false; |
1331 break; |
1325 break; |
1332 } |
1326 } |
1333 } |
1327 } |
1334 } |
1328 } |
1335 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1329 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1336 prev_il_instruction = symbol; |
|
1337 return NULL; |
1330 return NULL; |
1338 } |
1331 } |
1339 |
1332 |
1340 void *fill_candidate_datatypes_c::visit(LT_operator_c *symbol) { |
1333 void *fill_candidate_datatypes_c::visit(LT_operator_c *symbol) { |
1341 bool found = false; |
1334 bool found = false; |
1349 break; |
1342 break; |
1350 } |
1343 } |
1351 } |
1344 } |
1352 } |
1345 } |
1353 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1346 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1354 prev_il_instruction = symbol; |
|
1355 return NULL; |
1347 return NULL; |
1356 } |
1348 } |
1357 |
1349 |
1358 void *fill_candidate_datatypes_c::visit(LE_operator_c *symbol) { |
1350 void *fill_candidate_datatypes_c::visit(LE_operator_c *symbol) { |
1359 bool found = false; |
1351 bool found = false; |
1367 break; |
1359 break; |
1368 } |
1360 } |
1369 } |
1361 } |
1370 } |
1362 } |
1371 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1363 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1372 prev_il_instruction = symbol; |
|
1373 return NULL; |
1364 return NULL; |
1374 } |
1365 } |
1375 |
1366 |
1376 void *fill_candidate_datatypes_c::visit(NE_operator_c *symbol) { |
1367 void *fill_candidate_datatypes_c::visit(NE_operator_c *symbol) { |
1377 bool found = false; |
1368 bool found = false; |
1385 break; |
1376 break; |
1386 } |
1377 } |
1387 } |
1378 } |
1388 } |
1379 } |
1389 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1380 if (found) symbol->candidate_datatypes.push_back(&search_constant_type_c::bool_type_name); |
1390 prev_il_instruction = symbol; |
|
1391 return NULL; |
1381 return NULL; |
1392 } |
1382 } |
1393 |
1383 |
1394 void *fill_candidate_datatypes_c::visit(CAL_operator_c *symbol) { |
1384 void *fill_candidate_datatypes_c::visit(CAL_operator_c *symbol) { |
1395 if (NULL == prev_il_instruction) return NULL; |
1385 if (NULL == prev_il_instruction) return NULL; |
1396 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1386 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1397 /* does not need to be bool type !! */ |
1387 /* does not need to be bool type !! */ |
1398 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1388 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1399 } |
1389 } |
1400 if (debug) std::cout << "CAL [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1390 if (debug) std::cout << "CAL [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1401 prev_il_instruction = symbol; |
|
1402 return NULL; |
1391 return NULL; |
1403 } |
1392 } |
1404 |
1393 |
1405 void *fill_candidate_datatypes_c::visit(CALC_operator_c *symbol) { |
1394 void *fill_candidate_datatypes_c::visit(CALC_operator_c *symbol) { |
1406 if (NULL == prev_il_instruction) return NULL; |
1395 if (NULL == prev_il_instruction) return NULL; |
1407 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1396 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1408 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1397 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1409 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1398 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1410 } |
1399 } |
1411 if (debug) std::cout << "CALC [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1400 if (debug) std::cout << "CALC [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1412 prev_il_instruction = symbol; |
|
1413 return NULL; |
1401 return NULL; |
1414 } |
1402 } |
1415 |
1403 |
1416 void *fill_candidate_datatypes_c::visit(CALCN_operator_c *symbol) { |
1404 void *fill_candidate_datatypes_c::visit(CALCN_operator_c *symbol) { |
1417 if (NULL == prev_il_instruction) return NULL; |
1405 if (NULL == prev_il_instruction) return NULL; |
1418 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1406 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1419 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1407 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1420 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1408 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1421 } |
1409 } |
1422 if (debug) std::cout << "CALCN [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1410 if (debug) std::cout << "CALCN [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1423 prev_il_instruction = symbol; |
|
1424 return NULL; |
1411 return NULL; |
1425 } |
1412 } |
1426 |
1413 |
1427 void *fill_candidate_datatypes_c::visit(RET_operator_c *symbol) { |
1414 void *fill_candidate_datatypes_c::visit(RET_operator_c *symbol) { |
1428 if (NULL == prev_il_instruction) return NULL; |
1415 if (NULL == prev_il_instruction) return NULL; |
1429 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1416 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1430 /* does not need to be bool type !! */ |
1417 /* does not need to be bool type !! */ |
1431 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1418 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1432 } |
1419 } |
1433 if (debug) std::cout << "RET [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1420 if (debug) std::cout << "RET [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1434 prev_il_instruction = symbol; |
|
1435 return NULL; |
1421 return NULL; |
1436 } |
1422 } |
1437 |
1423 |
1438 void *fill_candidate_datatypes_c::visit(RETC_operator_c *symbol) { |
1424 void *fill_candidate_datatypes_c::visit(RETC_operator_c *symbol) { |
1439 if (NULL == prev_il_instruction) return NULL; |
1425 if (NULL == prev_il_instruction) return NULL; |
1440 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1426 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1441 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1427 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1442 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1428 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1443 } |
1429 } |
1444 if (debug) std::cout << "RETC [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1430 if (debug) std::cout << "RETC [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1445 prev_il_instruction = symbol; |
|
1446 return NULL; |
1431 return NULL; |
1447 } |
1432 } |
1448 |
1433 |
1449 void *fill_candidate_datatypes_c::visit(RETCN_operator_c *symbol) { |
1434 void *fill_candidate_datatypes_c::visit(RETCN_operator_c *symbol) { |
1450 if (NULL == prev_il_instruction) return NULL; |
1435 if (NULL == prev_il_instruction) return NULL; |
1451 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1436 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1452 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1437 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1453 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1438 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1454 } |
1439 } |
1455 if (debug) std::cout << "RETCN [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1440 if (debug) std::cout << "RETCN [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1456 prev_il_instruction = symbol; |
|
1457 return NULL; |
1441 return NULL; |
1458 } |
1442 } |
1459 |
1443 |
1460 void *fill_candidate_datatypes_c::visit(JMP_operator_c *symbol) { |
1444 void *fill_candidate_datatypes_c::visit(JMP_operator_c *symbol) { |
1461 if (NULL == prev_il_instruction) return NULL; |
1445 if (NULL == prev_il_instruction) return NULL; |
1462 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1446 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1463 /* does not need to be bool type !! */ |
1447 /* does not need to be bool type !! */ |
1464 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1448 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1465 } |
1449 } |
1466 if (debug) std::cout << "JMP [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1450 if (debug) std::cout << "JMP [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1467 prev_il_instruction = symbol; |
|
1468 return NULL; |
1451 return NULL; |
1469 } |
1452 } |
1470 |
1453 |
1471 void *fill_candidate_datatypes_c::visit(JMPC_operator_c *symbol) { |
1454 void *fill_candidate_datatypes_c::visit(JMPC_operator_c *symbol) { |
1472 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1455 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1473 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1456 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1474 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1457 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1475 } |
1458 } |
1476 if (debug) std::cout << "JMPC [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1459 if (debug) std::cout << "JMPC [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1477 prev_il_instruction = symbol; |
|
1478 return NULL; |
1460 return NULL; |
1479 } |
1461 } |
1480 |
1462 |
1481 void *fill_candidate_datatypes_c::visit(JMPCN_operator_c *symbol) { |
1463 void *fill_candidate_datatypes_c::visit(JMPCN_operator_c *symbol) { |
1482 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1464 for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) { |
1483 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1465 if (is_type(prev_il_instruction->candidate_datatypes[i], bool_type_name_c)) |
1484 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1466 symbol->candidate_datatypes.push_back(prev_il_instruction->candidate_datatypes[i]); |
1485 } |
1467 } |
1486 if (debug) std::cout << "JMPCN [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1468 if (debug) std::cout << "JMPCN [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << symbol->candidate_datatypes.size() << " result.\n"; |
1487 prev_il_instruction = symbol; |
|
1488 return NULL; |
1469 return NULL; |
1489 } |
1470 } |
1490 /* Symbol class handled together with function call checks */ |
1471 /* Symbol class handled together with function call checks */ |
1491 // void *visit(il_assign_operator_c *symbol, variable_name); |
1472 // void *visit(il_assign_operator_c *symbol, variable_name); |
1492 /* Symbol class handled together with function call checks */ |
1473 /* Symbol class handled together with function call checks */ |