OSDN Git Service

* config/alpha/vms.h (INCLUDE_DEFAULTS): Add /gnu/lib/gcc-lib/include.
[pf3gnuchains/gcc-fork.git] / gcc / ch / satisfy.c
index df5d78e..00d90f8 100644 (file)
@@ -1,5 +1,5 @@
 /* Name-satisfaction for GNU Chill compiler.
-   Copyright (C) 1993, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1998, 1999, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -15,7 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 #include "config.h"
 #include "system.h"
@@ -34,8 +35,12 @@ struct decl_chain
   tree decl;
 };
 
-/* forward declaration */
-tree satisfy PROTO((tree, struct decl_chain *));
+/* forward declarations */
+static tree satisfy            PARAMS ((tree, struct decl_chain *));
+static void cycle_error_print  PARAMS ((struct decl_chain *, tree));
+static tree safe_satisfy_decl  PARAMS ((tree, struct decl_chain *));
+static void satisfy_list       PARAMS ((tree, struct decl_chain *));
+static void satisfy_list_values        PARAMS ((tree, struct decl_chain *));
 
 static struct decl_chain dummy_chain;
 #define LOOKUP_ONLY (chain==&dummy_chain)
@@ -54,7 +59,7 @@ cycle_error_print (chain, decl)
     }
 }
 
-tree
+static tree
 safe_satisfy_decl (decl, prev_chain)
      tree decl;
      struct decl_chain *prev_chain;
@@ -62,7 +67,7 @@ safe_satisfy_decl (decl, prev_chain)
   struct decl_chain new_link;
   struct decl_chain *link;
   struct decl_chain *chain = prev_chain;
-  char *save_filename = input_filename;
+  const char *save_filename = input_filename;
   int save_lineno = lineno;
   tree result = decl;
   
@@ -82,7 +87,7 @@ safe_satisfy_decl (decl, prev_chain)
            {
              if (!pointer_type_breaks_cycle)
                {
-                 error_with_decl (decl, "Cycle: `%s' depends on ...");
+                 error_with_decl (decl, "cycle: `%s' depends on ...");
                  cycle_error_print (prev_chain, decl);
                  error_with_decl (decl, "  `%s'");
                  return error_mark_node;
@@ -181,6 +186,8 @@ safe_satisfy_decl (decl, prev_chain)
                }
              /* DECL_SIZE is set to prevent re-doing this stuff. */
              DECL_SIZE (decl) = TYPE_SIZE (TREE_TYPE (decl));
+             DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (TREE_TYPE (decl));
+
              if (! TREE_CONSTANT (DECL_INITIAL (decl))
                  && TREE_CODE (DECL_INITIAL (decl)) != ERROR_MARK)
                {
@@ -199,8 +206,7 @@ safe_satisfy_decl (decl, prev_chain)
     case FUNCTION_DECL:
       SATISFY (TREE_TYPE (decl));
       if (CH_DECL_PROCESS (decl))
-       safe_satisfy_decl (DECL_TASKING_CODE_DECL (decl), 
-                          prev_chain);
+       safe_satisfy_decl ((tree) DECL_TASKING_CODE_DECL (decl), prev_chain);
       break;
     case PARM_DECL:
       SATISFY (TREE_TYPE (decl));
@@ -210,8 +216,7 @@ safe_satisfy_decl (decl, prev_chain)
     case TYPE_DECL:
       SATISFY (TREE_TYPE (decl));
       if (CH_DECL_SIGNAL (decl))
-       safe_satisfy_decl (DECL_TASKING_CODE_DECL (decl), 
-                          prev_chain);
+       safe_satisfy_decl ((tree) DECL_TASKING_CODE_DECL (decl), prev_chain);
       if (!LOOKUP_ONLY)
        {
          if (TYPE_NAME (TREE_TYPE (decl)) == NULL_TREE)
@@ -299,7 +304,7 @@ satisfy_list_values (exp, chain)
     }
 }
 
-tree
+static tree
 satisfy (exp, chain)
      tree exp;
      struct decl_chain *chain;
@@ -366,7 +371,8 @@ satisfy (exp, chain)
        default:
          ;
        }
-      arg_length = tree_code_length[TREE_CODE (exp)];
+
+      arg_length = TREE_CODE_LENGTH (TREE_CODE (exp));
       for (i = 0; i < arg_length; i++)
        SATISFY (TREE_OPERAND (exp, i));
       return exp;
@@ -530,8 +536,7 @@ satisfy (exp, chain)
            /* if we have an ACCESS or TEXT mode we have to set
               maximum_field_alignment to 0 to fit with runtime
               system, even when we compile with -fpack. */
-           extern int maximum_field_alignment;
-           int save_maximum_field_alignment = maximum_field_alignment;
+           unsigned int save_maximum_field_alignment = maximum_field_alignment;
 
            if (CH_IS_ACCESS_MODE (exp) || CH_IS_TEXT_MODE (exp))
              maximum_field_alignment = 0;