stage3/fill_candidate_datatypes.cc
changeset 921 d228aaa4d616
parent 919 8da635655f37
child 933 76324f461aed
equal deleted inserted replaced
920:4369ce5e687f 921:d228aaa4d616
   718 	 *     ...
   718 	 *     ...
   719 	 * 
   719 	 * 
   720 	 * However, doing this for all NULL constants that may show up is probably a little too crazy, just for 
   720 	 * However, doing this for all NULL constants that may show up is probably a little too crazy, just for 
   721 	 * the 'pleasure' of following the standard fill/narrow algorithm.
   721 	 * the 'pleasure' of following the standard fill/narrow algorithm.
   722 	 *
   722 	 *
   723 	 * I have therefore opted to handle this as a special case: We use the ref_value_null_literal_c symbol itself as the NULL datatype!
   723 	 * I have therefore opted to handle this as a special case:
   724 	 * This implies the following changes:
   724 	 *     We use the ref_spec_c, pointing to a generic_type_any_c, as a pointer to ANY (basically, a void *)
   725 	 *   - We change the get_datatype_info_c::is_type_equal() to take the NULL datatype into account
       
   726 	 *   - We change the get_datatype_info_c::is_ref_to()     to take the NULL datatype into account
       
   727 	 *   - We change the fill_candidate_datatypes_c::visit(assignment_statement_c) to make sure it uses the datatype of the lvalue 
       
   728 	 *            as the datatype of the assignment statement
       
   729 	 *   - We search_base_type_c::get_basetype_decl
       
   730 	 */
   725 	 */
   731 	add_datatype_to_candidate_list(symbol, symbol);
   726 	add_datatype_to_candidate_list(symbol, new ref_spec_c(new generic_type_any_c()));
   732 	return NULL;
   727 	return NULL;
   733 }
   728 }
   734 
   729 
   735 
   730 
   736 /******************************/
   731 /******************************/