OSDN Git Service

2003-01-30 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
[pf3gnuchains/gcc-fork.git] / gcc / read-rtl.c
index fd79176..95bc2fe 100644 (file)
@@ -1,5 +1,5 @@
 /* RTL reader for GNU C Compiler.
-   Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999, 2000, 2001
+   Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -19,21 +19,14 @@ along with GCC; see the file COPYING.  If not, write to the Free
 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
-#include "hconfig.h"
+#include "bconfig.h"
 #include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "rtl.h"
 #include "obstack.h"
 #include "hashtab.h"
 
-#ifndef ISDIGIT
-#include <ctype.h>
-#define ISDIGIT isdigit
-#define ISSPACE isspace
-#endif
-
-#define        obstack_chunk_alloc     xmalloc
-#define        obstack_chunk_free      free
-
 static htab_t md_constants;
 
 static void fatal_with_file_and_line PARAMS ((FILE *, const char *, ...))
@@ -44,7 +37,7 @@ static char *read_string      PARAMS ((struct obstack *, FILE *, int));
 static char *read_quoted_string        PARAMS ((struct obstack *, FILE *));
 static char *read_braced_string        PARAMS ((struct obstack *, FILE *));
 static void read_escape                PARAMS ((struct obstack *, FILE *));
-static unsigned def_hash PARAMS ((const void *));
+static hashval_t def_hash      PARAMS ((const void *));
 static int def_name_eq_p PARAMS ((const void *, const void *));
 static void read_constants PARAMS ((FILE *infile, char *tmp_char));
 static void validate_const_int PARAMS ((FILE *, const char *));
@@ -73,7 +66,7 @@ fatal_with_file_and_line VPARAMS ((FILE *infile, const char *msg, ...))
   putc ('\n', stderr);
 
   /* Gather some following context.  */
-  for (i = 0; i < sizeof(context)-1; ++i)
+  for (i = 0; i < sizeof (context)-1; ++i)
     {
       c = getc (infile);
       if (c == EOF)
@@ -265,7 +258,7 @@ read_escape (ob, infile)
 
   obstack_1grow (ob, c);
 }
-      
+
 
 /* Read a double-quoted string onto the obstack.  Caller has scanned
    the leading quote.  */
@@ -325,7 +318,7 @@ read_braced_string (ob, infile)
 
       obstack_1grow (ob, c);
     }
-      
+
   obstack_1grow (ob, 0);
   return obstack_finish (ob);
 }
@@ -361,7 +354,7 @@ read_string (ob, infile, star_if_braced)
     }
   else
     fatal_with_file_and_line (infile, "expected `\"' or `{', found `%c'", c);
-       
+
   if (saw_paren)
     {
       c = read_skip_spaces (infile);
@@ -375,14 +368,16 @@ read_string (ob, infile, star_if_braced)
 /* Provide a version of a function to read a long long if the system does
    not provide one.  */
 #if HOST_BITS_PER_WIDE_INT > HOST_BITS_PER_LONG && !defined(HAVE_ATOLL) && !defined(HAVE_ATOQ)
+HOST_WIDE_INT atoll PARAMS ((const char *));
+
 HOST_WIDE_INT
-atoll(p)
+atoll (p)
     const char *p;
 {
   int neg = 0;
   HOST_WIDE_INT tmp_wide;
 
-  while (ISSPACE(*p))
+  while (ISSPACE (*p))
     p++;
   if (*p == '-')
     neg = 1, p++;
@@ -390,13 +385,13 @@ atoll(p)
     p++;
 
   tmp_wide = 0;
-  while (ISDIGIT(*p))
+  while (ISDIGIT (*p))
     {
       HOST_WIDE_INT new_wide = tmp_wide*10 + (*p - '0');
       if (new_wide < tmp_wide)
        {
          /* Return INT_MAX equiv on overflow.  */
-         tmp_wide = (~(unsigned HOST_WIDE_INT)0) >> 1;
+         tmp_wide = (~(unsigned HOST_WIDE_INT) 0) >> 1;
          break;
        }
       tmp_wide = new_wide;
@@ -410,12 +405,12 @@ atoll(p)
 #endif
 
 /* Given a constant definition, return a hash code for its name.  */
-static unsigned
+static hashval_t
 def_hash (def)
      const void *def;
 {
   unsigned result, i;
-  const char *string = ((const struct md_constant *)def)->name;
+  const char *string = ((const struct md_constant *) def)->name;
 
   for (result = i = 0;*string++ != '\0'; i++)
     result += ((unsigned char) *string << (i % CHAR_BIT));
@@ -427,8 +422,8 @@ static int
 def_name_eq_p (def1, def2)
      const void *def1, *def2;
 {
-  return ! strcmp (((const struct md_constant *)def1)->name,
-                  ((const struct md_constant *)def2)->name);
+  return ! strcmp (((const struct md_constant *) def1)->name,
+                  ((const struct md_constant *) def2)->name);
 }
 
 /* INFILE is a FILE pointer to read text from.  TMP_CHAR is a buffer suitable
@@ -510,7 +505,7 @@ validate_const_int (infile, string)
   int valid = 1;
 
   cp = string;
-  while (*cp && ISSPACE(*cp))
+  while (*cp && ISSPACE (*cp))
     cp++;
   if (*cp == '-' || *cp == '+')
     cp++;
@@ -639,7 +634,7 @@ again:
          {
            XVEC (return_rtx, i) = 0;
            break;
-         }
+         }
        /* Now process the vector.  */
 
       case 'E':
@@ -694,7 +689,7 @@ again:
             gets a star inserted as its first character, if it is
             written with a brace block instead of a string constant.  */
          int star_if_braced = (format_ptr[-1] == 'T');
-           
+
          stringbuf = read_string (&rtl_obstack, infile, star_if_braced);
 
          /* For insn patterns, we want to provide a default name
@@ -728,7 +723,7 @@ again:
 
       case 'w':
        read_name (tmp_char, infile);
-       validate_const_int(infile, tmp_char);
+       validate_const_int (infile, tmp_char);
 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
        tmp_wide = atoi (tmp_char);
 #else
@@ -750,7 +745,7 @@ again:
       case 'i':
       case 'n':
        read_name (tmp_char, infile);
-       validate_const_int(infile, tmp_char);
+       validate_const_int (infile, tmp_char);
        tmp_int = atoi (tmp_char);
        XINT (return_rtx, i) = tmp_int;
        break;