Exemplo n.º 1
0
type_t* fortran_replace_return_type_of_function_type(type_t* function_type, type_t* new_return_type)
{
    ERROR_CONDITION(!is_function_type(function_type), "Must be a function type", 0);

    int num_parameters = function_type_get_num_parameters(function_type);
    if (!function_type_get_lacking_prototype(function_type))
    {
        parameter_info_t parameter_info[1 + num_parameters];
        memset(&parameter_info, 0, sizeof(parameter_info));
        int i;
        for (i = 0; i < num_parameters; i++)
        {
            parameter_info[i].type_info = function_type_get_parameter_type_num(function_type, i);
        }

        return get_new_function_type(new_return_type, parameter_info, num_parameters);
    }
    else
    {
        return get_nonproto_function_type(new_return_type, num_parameters);
    }
}
 bool Type::lacks_prototype() const
 {
     return function_type_get_lacking_prototype(this->_type_info);
 }