/* 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.
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 *, ...))
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 *));
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)
obstack_1grow (ob, c);
}
-
+
/* Read a double-quoted string onto the obstack. Caller has scanned
the leading quote. */
obstack_1grow (ob, c);
}
-
+
obstack_1grow (ob, 0);
return obstack_finish (ob);
}
}
else
fatal_with_file_and_line (infile, "expected `\"' or `{', found `%c'", c);
-
+
if (saw_paren)
{
c = read_skip_spaces (infile);
/* 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++;
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;
#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));
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
int valid = 1;
cp = string;
- while (*cp && ISSPACE(*cp))
+ while (*cp && ISSPACE (*cp))
cp++;
if (*cp == '-' || *cp == '+')
cp++;
{
XVEC (return_rtx, i) = 0;
break;
- }
+ }
/* Now process the vector. */
case 'E':
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
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
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;