stage4/generate_c/generate_c_inlinefcall.cc
changeset 399 55b074ea7255
parent 392 9b88b8b6bccd
child 406 6381589697ff
child 495 8c6823fee086
equal deleted inserted replaced
398:f1f3facc59e7 399:55b074ea7255
   167       s4o.print("_");
   167       s4o.print("_");
   168       function_name->accept(*this);
   168       function_name->accept(*this);
   169       if (f_decl != NULL) {
   169       if (f_decl != NULL) {
   170         /* function being called is overloaded! */
   170         /* function being called is overloaded! */
   171         s4o.print("__");
   171         s4o.print("__");
   172         print_function_parameter_data_types_c overloaded_func_suf(&s4o);
   172         print_function_parameter_data_types_c overloaded_func_suf(&s4o, function_type_prefix);
   173         f_decl->accept(overloaded_func_suf);
   173         f_decl->accept(overloaded_func_suf);
   174       }	
   174       }	
   175       if (function_type_suffix) {
   175       if (function_type_suffix) {
   176         function_type_suffix->accept(*this);
   176         function_type_suffix->accept(*this);
   177       }
   177       }
   220       s4o.print(" = ");
   220       s4o.print(" = ");
   221       function_name->accept(*this);
   221       function_name->accept(*this);
   222       if (f_decl != NULL) {
   222       if (f_decl != NULL) {
   223     	/* function being called is overloaded! */
   223     	/* function being called is overloaded! */
   224     	s4o.print("__");
   224     	s4o.print("__");
   225         print_function_parameter_data_types_c overloaded_func_suf(&s4o);
   225         print_function_parameter_data_types_c overloaded_func_suf(&s4o, function_type_prefix);
   226         f_decl->accept(overloaded_func_suf);
   226         f_decl->accept(overloaded_func_suf);
   227       }
   227       }
   228 
   228 
   229       if (function_type_suffix)
   229       if (function_type_suffix)
   230         function_type_suffix->accept(*this);
   230         function_type_suffix->accept(*this);
   490       function_declaration_c *f_decl = (function_declaration_c *)symbol->called_function_declaration;
   490       function_declaration_c *f_decl = (function_declaration_c *)symbol->called_function_declaration;
   491       if (f_decl == NULL) ERROR;
   491       if (f_decl == NULL) ERROR;
   492       
   492       
   493       /* determine the base data type returned by the function being called... */
   493       /* determine the base data type returned by the function being called... */
   494       search_base_type_c search_base_type;
   494       search_base_type_c search_base_type;
   495       function_type_prefix = (symbol_c *)f_decl->type_name->accept(search_base_type);
   495       if (symbol->overloaded_return_type == NULL)
       
   496         function_type_prefix = (symbol_c *)f_decl->type_name->accept(search_base_type);
       
   497       else
       
   498     	function_type_prefix = symbol->overloaded_return_type;
   496       
   499       
   497       function_name = symbol->function_name;      
   500       function_name = symbol->function_name;      
   498       
   501       
   499       /* loop through each function parameter, find the value we should pass
   502       /* loop through each function parameter, find the value we should pass
   500        * to it, and then output the c equivalent...
   503        * to it, and then output the c equivalent...
   673       function_declaration_c *f_decl = (function_declaration_c *)symbol->called_function_declaration;
   676       function_declaration_c *f_decl = (function_declaration_c *)symbol->called_function_declaration;
   674       if (f_decl == NULL) ERROR;
   677       if (f_decl == NULL) ERROR;
   675 
   678 
   676       /* determine the base data type returned by the function being called... */
   679       /* determine the base data type returned by the function being called... */
   677       search_base_type_c search_base_type;
   680       search_base_type_c search_base_type;
   678       function_type_prefix = (symbol_c *)f_decl->type_name->accept(search_base_type);
   681       if (symbol->overloaded_return_type == NULL)
       
   682 		function_type_prefix = (symbol_c *)f_decl->type_name->accept(search_base_type);
       
   683       else
       
   684 		function_type_prefix = symbol->overloaded_return_type;
   679       if (NULL == function_type_prefix) ERROR;
   685       if (NULL == function_type_prefix) ERROR;
   680       
   686       
   681       function_name = symbol->function_name;
   687       function_name = symbol->function_name;
   682 
   688 
   683       /* loop through each function parameter, find the value we should pass
   689       /* loop through each function parameter, find the value we should pass
  1042 
  1048 
  1043       function_name = symbol->function_name;
  1049       function_name = symbol->function_name;
  1044 
  1050 
  1045       /* determine the base data type returned by the function being called... */
  1051       /* determine the base data type returned by the function being called... */
  1046       search_base_type_c search_base_type;
  1052       search_base_type_c search_base_type;
  1047       function_type_prefix = (symbol_c *)f_decl->type_name->accept(search_base_type);
  1053       if (symbol->overloaded_return_type == NULL)
       
  1054         function_type_prefix = (symbol_c *)f_decl->type_name->accept(search_base_type);
       
  1055       else
       
  1056         function_type_prefix = symbol->overloaded_return_type;
  1048       if (NULL == function_type_prefix) ERROR;
  1057       if (NULL == function_type_prefix) ERROR;
  1049 
  1058 
  1050       /* loop through each function parameter, find the value we should pass
  1059       /* loop through each function parameter, find the value we should pass
  1051        * to it, and then output the c equivalent...
  1060        * to it, and then output the c equivalent...
  1052        */
  1061        */