stage4/generate_c/generate_c_il.cc
changeset 721 5dc33058e041
parent 693 51a2fa6441b9
child 762 a3d917474ae4
equal deleted inserted replaced
720:f637ac331a68 721:5dc33058e041
   845       }
   845       }
   846     }
   846     }
   847   }
   847   }
   848 
   848 
   849   /* Check whether we are calling an overloaded function! */
   849   /* Check whether we are calling an overloaded function! */
   850   /* (fdecl_mutiplicity==2)  => calling overloaded function */
   850   /* (fdecl_mutiplicity > 1)  => calling overloaded function */
   851   int fdecl_mutiplicity =  function_symtable.multiplicity(symbol->function_name);
   851   int fdecl_mutiplicity =  function_symtable.count(symbol->function_name);
   852   if (fdecl_mutiplicity == 0) ERROR;
   852   if (fdecl_mutiplicity == 0) ERROR;
   853 
   853 
   854   this->implicit_variable_result.accept(*this);
   854   this->implicit_variable_result.accept(*this);
   855   s4o.print(" = ");
   855   s4o.print(" = ");
   856     
   856     
   866     fcall_number++;
   866     fcall_number++;
   867     s4o.print("__");
   867     s4o.print("__");
   868     fbname->accept(*this);
   868     fbname->accept(*this);
   869     s4o.print("_");
   869     s4o.print("_");
   870     function_name->accept(*this);
   870     function_name->accept(*this);
   871     if (fdecl_mutiplicity == 2) {
   871     if (fdecl_mutiplicity > 1) {
   872       /* function being called is overloaded! */
   872       /* function being called is overloaded! */
   873       s4o.print("__");
   873       s4o.print("__");
   874       print_function_parameter_data_types_c overloaded_func_suf(&s4o);
   874       print_function_parameter_data_types_c overloaded_func_suf(&s4o);
   875       f_decl->accept(overloaded_func_suf);
   875       f_decl->accept(overloaded_func_suf);
   876     }
   876     }
   877     s4o.print(fcall_number);
   877     s4o.print(fcall_number);
   878   }
   878   }
   879   else {
   879   else {
   880     if (function_name != NULL) {
   880     if (function_name != NULL) {
   881           function_name->accept(*this);
   881           function_name->accept(*this);
   882           if (fdecl_mutiplicity == 2) {
   882           if (fdecl_mutiplicity > 1) {
   883             /* function being called is overloaded! */
   883             /* function being called is overloaded! */
   884             s4o.print("__");
   884             s4o.print("__");
   885             print_function_parameter_data_types_c overloaded_func_suf(&s4o);
   885             print_function_parameter_data_types_c overloaded_func_suf(&s4o);
   886             f_decl->accept(overloaded_func_suf);
   886             f_decl->accept(overloaded_func_suf);
   887           }
   887           }
  1232       }
  1232       }
  1233     }
  1233     }
  1234   }
  1234   }
  1235 
  1235 
  1236   /* Check whether we are calling an overloaded function! */
  1236   /* Check whether we are calling an overloaded function! */
  1237   /* (fdecl_mutiplicity==2)  => calling overloaded function */
  1237   /* (fdecl_mutiplicity > 1)  => calling overloaded function */
  1238   int fdecl_mutiplicity =  function_symtable.multiplicity(symbol->function_name);
  1238   int fdecl_mutiplicity =  function_symtable.count(symbol->function_name);
  1239   if (fdecl_mutiplicity == 0) ERROR;
  1239   if (fdecl_mutiplicity == 0) ERROR;
  1240   if (fdecl_mutiplicity == 1) 
  1240   if (fdecl_mutiplicity == 1) 
  1241     /* function being called is NOT overloaded! */
  1241     /* function being called is NOT overloaded! */
  1242     f_decl = NULL; 
  1242     f_decl = NULL; 
  1243 
  1243 
  1256     fcall_number++;
  1256     fcall_number++;
  1257     s4o.print("__");
  1257     s4o.print("__");
  1258     fbname->accept(*this);
  1258     fbname->accept(*this);
  1259     s4o.print("_");
  1259     s4o.print("_");
  1260     function_name->accept(*this);
  1260     function_name->accept(*this);
  1261     if (fdecl_mutiplicity == 2) {
  1261     if (fdecl_mutiplicity > 1) {
  1262       /* function being called is overloaded! */
  1262       /* function being called is overloaded! */
  1263       s4o.print("__");
  1263       s4o.print("__");
  1264       print_function_parameter_data_types_c overloaded_func_suf(&s4o);
  1264       print_function_parameter_data_types_c overloaded_func_suf(&s4o);
  1265       f_decl->accept(overloaded_func_suf);
  1265       f_decl->accept(overloaded_func_suf);
  1266     }
  1266     }
  1267     s4o.print(fcall_number);
  1267     s4o.print(fcall_number);
  1268   }
  1268   }
  1269   else {
  1269   else {
  1270     if (function_name != NULL) {
  1270     if (function_name != NULL) {
  1271       function_name->accept(*this);
  1271       function_name->accept(*this);
  1272       if (fdecl_mutiplicity == 2) {
  1272       if (fdecl_mutiplicity > 1) {
  1273         /* function being called is overloaded! */
  1273         /* function being called is overloaded! */
  1274         s4o.print("__");
  1274         s4o.print("__");
  1275         print_function_parameter_data_types_c overloaded_func_suf(&s4o);
  1275         print_function_parameter_data_types_c overloaded_func_suf(&s4o);
  1276         f_decl->accept(overloaded_func_suf);
  1276         f_decl->accept(overloaded_func_suf);
  1277       }
  1277       }