stage4/generate_c/il_code_gen.c
changeset 233 3d23a68183d3
parent 217 f5dfadf5de54
child 235 ed66dc50f31a
--- a/stage4/generate_c/il_code_gen.c	Fri Dec 11 13:01:17 2009 +0100
+++ b/stage4/generate_c/il_code_gen.c	Sat Dec 12 20:41:32 2009 +0100
@@ -13368,6 +13368,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = &search_constant_type_c::integer;
                 function_type_prefix = (symbol_c*)(new pragma_c("int"));
+                if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -13762,6 +13764,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = IN_type_symbol;
+                if (search_expression_type->is_literal_integer_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lint_type_name;
                 break;
                 
             }
@@ -13798,6 +13802,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = IN_type_symbol;
+                if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -13834,6 +13840,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = IN_type_symbol;
+                if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -13870,6 +13878,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = IN_type_symbol;
+                if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -13906,6 +13916,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = IN_type_symbol;
+                if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -13942,6 +13954,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = IN_type_symbol;
+                if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -13978,6 +13992,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = IN_type_symbol;
+                if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -14014,6 +14030,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = IN_type_symbol;
+                if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -14050,6 +14068,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = IN_type_symbol;
+                if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -14086,6 +14106,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = IN_type_symbol;
+                if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -14122,6 +14144,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = IN_type_symbol;
+                if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -14207,13 +14231,7 @@
                             }
                             
                         }while(param_value != NULL);
-                        symbol_c * return_type_symbol;
-                        if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lint_type_name;
-                        else if (search_expression_type->is_literal_real_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lreal_type_name;
-                        else
-                            return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = last_type_symbol;
                         function_type_suffix = return_type_symbol;
                         break;
                         
@@ -14426,13 +14444,7 @@
                             }
                             
                         }while(param_value != NULL);
-                        symbol_c * return_type_symbol;
-                        if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lint_type_name;
-                        else if (search_expression_type->is_literal_real_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lreal_type_name;
-                        else
-                            return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = last_type_symbol;
                         function_type_suffix = return_type_symbol;
                         break;
                         
@@ -14474,6 +14486,8 @@
                           IN2_type_symbol = last_type_symbol;
                         ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+                        if (search_expression_type->is_literal_integer_type(function_type_suffix))
+                            function_type_suffix = &search_constant_type_c::lint_type_name;
                         break;
                         
                     }
@@ -14535,13 +14549,7 @@
                         if (IN2_type_symbol == NULL)
                           IN2_type_symbol = last_type_symbol;
                         ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
-                        symbol_c * return_type_symbol;
-                        if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lint_type_name;
-                        else if (search_expression_type->is_literal_real_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lreal_type_name;
-                        else
-                            return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = last_type_symbol;
                         function_type_suffix = return_type_symbol;
                         break;
                         
@@ -14798,13 +14806,7 @@
                         if (IN2_type_symbol == NULL)
                           IN2_type_symbol = last_type_symbol;
                         ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
-                        symbol_c * return_type_symbol;
-                        if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lint_type_name;
-                        else if (search_expression_type->is_literal_real_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lreal_type_name;
-                        else
-                            return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = last_type_symbol;
                         function_type_suffix = return_type_symbol;
                         break;
                         
@@ -14846,6 +14848,8 @@
                           IN2_type_symbol = last_type_symbol;
                         ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
                         symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
+                        if (search_expression_type->is_literal_integer_type(function_type_suffix))
+                            function_type_suffix = &search_constant_type_c::lint_type_name;
                         break;
                         
                     }
@@ -14907,13 +14911,7 @@
                         if (IN2_type_symbol == NULL)
                           IN2_type_symbol = last_type_symbol;
                         ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
-                        symbol_c * return_type_symbol;
-                        if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lint_type_name;
-                        else if (search_expression_type->is_literal_real_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lreal_type_name;
-                        else
-                            return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = last_type_symbol;
                         function_type_suffix = return_type_symbol;
                         break;
                         
@@ -14976,13 +14974,7 @@
                         if (IN2_type_symbol == NULL)
                           IN2_type_symbol = last_type_symbol;
                         ADD_PARAM_LIST(&IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
-                        symbol_c * return_type_symbol;
-                        if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lint_type_name;
-                        else if (search_expression_type->is_literal_real_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lreal_type_name;
-                        else
-                            return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = last_type_symbol;
                         function_type_suffix = IN1_type_symbol;
                         break;
                         
@@ -15024,14 +15016,12 @@
                 if (IN_type_symbol == NULL)
                   IN_type_symbol = last_type_symbol;
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
-                symbol_c * return_type_symbol;
-                if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                    return_type_symbol = &search_constant_type_c::lint_type_name;
-                else if (search_expression_type->is_literal_real_type(last_type_symbol))
-                    return_type_symbol = &search_constant_type_c::lreal_type_name;
-                else
-                    return_type_symbol = last_type_symbol;
+                symbol_c * return_type_symbol = last_type_symbol;
                 function_type_suffix = return_type_symbol;
+                if (search_expression_type->is_literal_integer_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lint_type_name;
+                else if (search_expression_type->is_literal_real_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                 break;
                 
             }
@@ -15369,11 +15359,7 @@
                             }
                             
                         }while(param_value != NULL);
-                        symbol_c * return_type_symbol;
-                        if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lword_type_name;
-                        else
-                            return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = last_type_symbol;
                         function_type_suffix = return_type_symbol;
                         break;
                         
@@ -15466,11 +15452,7 @@
                             }
                             
                         }while(param_value != NULL);
-                        symbol_c * return_type_symbol;
-                        if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lword_type_name;
-                        else
-                            return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = last_type_symbol;
                         function_type_suffix = return_type_symbol;
                         break;
                         
@@ -15563,11 +15545,7 @@
                             }
                             
                         }while(param_value != NULL);
-                        symbol_c * return_type_symbol;
-                        if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lword_type_name;
-                        else
-                            return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = last_type_symbol;
                         function_type_suffix = return_type_symbol;
                         break;
                         
@@ -15611,6 +15589,8 @@
                 ADD_PARAM_LIST(&IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
                 symbol_c * return_type_symbol = IN_type_symbol;
                 function_type_suffix = return_type_symbol;
+                if (search_expression_type->is_literal_integer_type(function_type_suffix))
+                    function_type_suffix = &search_constant_type_c::lword_type_name;
                 break;
                 
             }
@@ -15687,13 +15667,7 @@
                                 if (IN1_type_symbol == NULL)
                                   IN1_type_symbol = last_type_symbol;
                                 ADD_PARAM_LIST(&IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
-                                symbol_c * return_type_symbol;
-                                if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                                    return_type_symbol = &search_constant_type_c::lint_type_name;
-                                else if (search_expression_type->is_literal_real_type(last_type_symbol))
-                                    return_type_symbol = &search_constant_type_c::lreal_type_name;
-                                else
-                                    return_type_symbol = last_type_symbol;
+                                symbol_c * return_type_symbol = last_type_symbol;
                                 function_type_suffix = IN0_type_symbol;
                                 break;
                                 
@@ -15792,13 +15766,7 @@
                             }
                             
                         }while(param_value != NULL);
-                        symbol_c * return_type_symbol;
-                        if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lint_type_name;
-                        else if (search_expression_type->is_literal_real_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lreal_type_name;
-                        else
-                            return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = last_type_symbol;
                         function_type_suffix = return_type_symbol;
                         break;
                         
@@ -15891,13 +15859,7 @@
                             }
                             
                         }while(param_value != NULL);
-                        symbol_c * return_type_symbol;
-                        if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lint_type_name;
-                        else if (search_expression_type->is_literal_real_type(last_type_symbol))
-                            return_type_symbol = &search_constant_type_c::lreal_type_name;
-                        else
-                            return_type_symbol = last_type_symbol;
+                        symbol_c * return_type_symbol = last_type_symbol;
                         function_type_suffix = return_type_symbol;
                         break;
                         
@@ -15983,6 +15945,10 @@
                                 ADD_PARAM_LIST(&MX_param_name, MX_param_value, MX_type_symbol, function_param_iterator_c::direction_in)
                                 symbol_c * return_type_symbol = IN_type_symbol;
                                 function_type_suffix = IN_type_symbol;
+                                if (search_expression_type->is_literal_integer_type(function_type_suffix))
+                                    function_type_suffix = &search_constant_type_c::lint_type_name;
+                                else if (search_expression_type->is_literal_real_type(function_type_suffix))
+                                    function_type_suffix = &search_constant_type_c::lreal_type_name;
                                 break;
                                 
                             }
@@ -16101,13 +16067,7 @@
                                     }
                                     
                                 }while(param_value != NULL);
-                                symbol_c * return_type_symbol;
-                                if (search_expression_type->is_literal_integer_type(last_type_symbol))
-                                    return_type_symbol = &search_constant_type_c::lint_type_name;
-                                else if (search_expression_type->is_literal_real_type(last_type_symbol))
-                                    return_type_symbol = &search_constant_type_c::lreal_type_name;
-                                else
-                                    return_type_symbol = last_type_symbol;
+                                symbol_c * return_type_symbol = last_type_symbol;
                                 function_type_suffix = return_type_symbol;
                                 break;