OSDN Git Service

PR c++/50512
[pf3gnuchains/gcc-fork.git] / gcc / c-aux-info.c
index b7267b2..694f9c1 100644 (file)
@@ -2,14 +2,14 @@
    on information stored in GCC's tree structure.  This code implements the
    -aux-info option.
    Copyright (C) 1989, 1991, 1994, 1995, 1997, 1998,
-   1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+   1999, 2000, 2003, 2004, 2007, 2010 Free Software Foundation, Inc.
    Contributed by Ron Guilmette (rfg@segfault.us.com).
 
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
+Software Foundation; either version 3, or (at your option) any later
 version.
 
 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
@@ -18,9 +18,8 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
 #include "config.h"
 #include "system.h"
@@ -29,7 +28,6 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 #include "flags.h"
 #include "tree.h"
 #include "c-tree.h"
-#include "toplev.h"
 
 enum formals_style_enum {
   ansi,
@@ -43,7 +41,6 @@ static const char *data_type;
 
 static char *affix_data_type (const char *) ATTRIBUTE_MALLOC;
 static const char *gen_formal_list_for_type (tree, formals_style);
-static int   deserves_ellipsis (tree);
 static const char *gen_formal_list_for_func_def (tree, formals_style);
 static const char *gen_type (const char *, tree, formals_style);
 static const char *gen_decl (tree, int, formals_style);
@@ -166,7 +163,7 @@ gen_formal_list_for_type (tree fntype, formals_style style)
 
   if (!*formal_list)
     {
-      if (TYPE_ARG_TYPES (fntype))
+      if (prototype_p (fntype))
        /* assert (TREE_VALUE (TYPE_ARG_TYPES (fntype)) == void_type_node);  */
        formal_list = "void";
       else
@@ -184,28 +181,6 @@ gen_formal_list_for_type (tree fntype, formals_style style)
   return concat (" (", formal_list, ")", NULL);
 }
 
-/* For the generation of an ANSI prototype for a function definition, we have
-   to look at the formal parameter list of the function's own "type" to
-   determine if the function's formal parameter list should end with an
-   ellipsis.  Given a tree node, the following function will return nonzero
-   if the "function type" parameter list should end with an ellipsis.  */
-
-static int
-deserves_ellipsis (tree fntype)
-{
-  tree formal_type;
-
-  formal_type = TYPE_ARG_TYPES (fntype);
-  while (formal_type && TREE_VALUE (formal_type) != void_type_node)
-    formal_type = TREE_CHAIN (formal_type);
-
-  /* If there were at least some parameters, and if the formals-types-list
-     petered out to a NULL (i.e. without being terminated by a void_type_node)
-     then we need to tack on an ellipsis.  */
-
-  return (!formal_type && TYPE_ARG_TYPES (fntype));
-}
-
 /* Generate a parameter list for a function definition (in some given style).
 
    Note that this routine has to be separate (and different) from the code that
@@ -249,7 +224,7 @@ gen_formal_list_for_func_def (tree fndecl, formals_style style)
     {
       if (!DECL_ARGUMENTS (fndecl))
        formal_list = concat (formal_list, "void", NULL);
-      if (deserves_ellipsis (TREE_TYPE (fndecl)))
+      if (stdarg_p (TREE_TYPE (fndecl)))
        formal_list = concat (formal_list, ", ...", NULL);
     }
   if ((style == ansi) || (style == k_and_r_names))
@@ -427,6 +402,7 @@ gen_type (const char *ret_val, tree t, formals_style style)
          break;
 
        case INTEGER_TYPE:
+       case FIXED_POINT_TYPE:
          data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t)));
          /* Normally, `unsigned' is part of the deal.  Not so if it comes
             with a type qualifier.  */