* arc.c (arc_hard_regno_mode_ok): Const-ify.
* arc.h (arc_hard_regno_mode_ok): Likewise.
* i386.c (x86_64_reg_class_name): Make static.
* m68k.c (regno_reg_class): Const-ify.
* m68k.h (regno_reg_class): Likewise.
* mcore.c (reg_class_from_letter): Likewise.
* mcore.h (reg_class_from_letter): Likewise.
* sh.c (reg_class_from_letter, ashiftrt_insns, shift_insns,
ext_shift_insns, ext_shift_amounts): Likewise.
* sh.h (reg_class_from_letter): Likewise.
* sparc.c (hard_regno_mode_classes, hard_32bit_mode_classes,
hard_64bit_mode_classes): Likewise.
* sparc.h (hard_regno_mode_classes): Likewise.
* gcc.c (modify_target): Make static.
* gengenrtl.c (defs, formats): Likewise.
* reload1.c (elim_table_1, init_elim_table): Const-ify.
* tradcpp.c (directive, directive_table, handle_directive,
skip_if_group, run_directive): Likewise.
cp:
* decl2.c (lang_f_options): Const-ify.
f:
* com.c (ffecom_gfrt_volatile_, ffecom_gfrt_complex_,
ffecom_gfrt_const_, ffecom_gfrt_type_): Const-ify.
java:
* Make-lang.in (keyword.h): Pass -C to gperf to const-ify
the static arrays that are output.
* jvspec.c (jvgenmain_spec): Make static.
* keyword.gperf (struct java_keyword, java_keyword): Const-ify.
* keyword.h: Regenerate.
* lang.c (string_option, process_option_with_no, lang_f_options,
lang_W_options): Const-ify.
* lex.c (java_lex): Likewise.
From-SVN: r48290
+2001-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * arc.c (arc_hard_regno_mode_ok): Const-ify.
+ * arc.h (arc_hard_regno_mode_ok): Likewise.
+ * i386.c (x86_64_reg_class_name): Make static.
+ * m68k.c (regno_reg_class): Const-ify.
+ * m68k.h (regno_reg_class): Likewise.
+ * mcore.c (reg_class_from_letter): Likewise.
+ * mcore.h (reg_class_from_letter): Likewise.
+ * sh.c (reg_class_from_letter, ashiftrt_insns, shift_insns,
+ ext_shift_insns, ext_shift_amounts): Likewise.
+ * sh.h (reg_class_from_letter): Likewise.
+ * sparc.c (hard_regno_mode_classes, hard_32bit_mode_classes,
+ hard_64bit_mode_classes): Likewise.
+ * sparc.h (hard_regno_mode_classes): Likewise.
+
+ * gcc.c (modify_target): Make static.
+ * gengenrtl.c (defs, formats): Likewise.
+ * reload1.c (elim_table_1, init_elim_table): Const-ify.
+ * tradcpp.c (directive, directive_table, handle_directive,
+ skip_if_group, run_directive): Likewise.
+
2001-12-23 Richard Henderson <rth@redhat.com>
* calls.c (expand_call): Don't turn off ECF_LIBCALL_BLOCK for
/* Value is 1 if register/mode pair is acceptable on arc. */
-unsigned int arc_hard_regno_mode_ok[] = {
+const unsigned int arc_hard_regno_mode_ok[] = {
T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES,
T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES,
T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, D_MODES,
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
-extern unsigned int arc_hard_regno_mode_ok[];
+extern const unsigned int arc_hard_regno_mode_ok[];
extern unsigned int arc_mode_class[];
#define HARD_REGNO_MODE_OK(REGNO, MODE) \
((arc_hard_regno_mode_ok[REGNO] & arc_mode_class[MODE]) != 0)
X86_64_X87UP_CLASS,
X86_64_MEMORY_CLASS
};
-const char * const x86_64_reg_class_name[] =
+static const char * const x86_64_reg_class_name[] =
{"no", "integer", "integerSI", "sse", "sseSF", "sseDF", "sseup", "x87", "x87up", "no"};
#define MAX_CLASSES 4
/* Index into this array by (register number >> 3) to find the
smallest class which contains that register. */
-enum reg_class regno_reg_class[]
+const enum reg_class regno_reg_class[]
= { DATA_REGS, ADDR_REGS, FP_REGS,
LO_FPA_REGS, LO_FPA_REGS, FPA_REGS, FPA_REGS };
reg number REGNO. This could be a conditional expression
or could index an array. */
-extern enum reg_class regno_reg_class[];
+extern const enum reg_class regno_reg_class[];
#define REGNO_REG_CLASS(REGNO) (regno_reg_class[(REGNO)>>3])
#endif /* SUPPORT_SUN_FPA */
/* Provide reg_class from a letter such as appears in the machine
description. */
-enum reg_class reg_class_from_letter[] =
+const enum reg_class reg_class_from_letter[] =
{
/* a */ LRW_REGS, /* b */ ONLYR1_REGS, /* c */ C_REGS, /* d */ NO_REGS,
/* e */ NO_REGS, /* f */ NO_REGS, /* g */ NO_REGS, /* h */ NO_REGS,
/* Get reg_class from a letter such as appears in the machine
description. */
-extern enum reg_class reg_class_from_letter[];
+extern const enum reg_class reg_class_from_letter[];
#define REG_CLASS_FROM_LETTER(C) \
( ISLOWER (C) ? reg_class_from_letter[(C) - 'a'] : NO_REGS )
/* Provide reg_class from a letter such as appears in the machine
description. */
-enum reg_class reg_class_from_letter[] =
+const enum reg_class reg_class_from_letter[] =
{
/* a */ ALL_REGS, /* b */ NO_REGS, /* c */ FPSCR_REGS, /* d */ DF_REGS,
/* e */ NO_REGS, /* f */ FP_REGS, /* g */ NO_REGS, /* h */ NO_REGS,
}
\f
/* Actual number of instructions used to make a shift by N. */
-static char ashiftrt_insns[] =
+static const char ashiftrt_insns[] =
{ 0,1,2,3,4,5,8,8,8,8,8,8,8,8,8,8,2,3,4,5,8,8,8,8,8,8,8,8,8,8,8,2};
/* Left shift and logical right shift are the same. */
-static char shift_insns[] =
+static const char shift_insns[] =
{ 0,1,1,2,2,3,3,4,1,2,2,3,3,4,3,3,1,2,2,3,3,4,3,3,2,3,3,4,4,4,3,3};
/* Individual shift amounts needed to get the above length sequences.
might be clobbered. This is typically used when combined with some
kind of sign or zero extension. */
-static char ext_shift_insns[] =
+static const char ext_shift_insns[] =
{ 0,1,1,2,2,3,2,2,1,2,2,3,3,3,2,2,1,2,2,3,3,4,3,3,2,3,3,4,4,4,3,3};
-static short ext_shift_amounts[32][4] = {
+static const short ext_shift_amounts[32][4] = {
{0}, {1}, {2}, {2, 1},
{2, 2}, {2, 1, 2}, {8, -2}, {8, -1},
{8}, {8, 1}, {8, 2}, {8, 1, 2},
/* Get reg_class from a letter such as appears in the machine
description. */
-extern enum reg_class reg_class_from_letter[];
+extern const enum reg_class reg_class_from_letter[];
#define REG_CLASS_FROM_LETTER(C) \
( ISLOWER (C) ? reg_class_from_letter[(C)-'a'] : NO_REGS )
they cross fixed registers). */
/* This points to either the 32 bit or the 64 bit version. */
-int *hard_regno_mode_classes;
+const int *hard_regno_mode_classes;
-static int hard_32bit_mode_classes[] = {
+static const int hard_32bit_mode_classes[] = {
S_MODES, S_MODES, T_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES,
T_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES, D_MODES, S_MODES,
T_MODES, S_MODES, T_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES,
CC_MODES
};
-static int hard_64bit_mode_classes[] = {
+static const int hard_64bit_mode_classes[] = {
D_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES,
O_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES,
T_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES,
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
See sparc.c for how we initialize this. */
-extern int *hard_regno_mode_classes;
+extern const int *hard_regno_mode_classes;
extern int sparc_mode_class[];
/* ??? Because of the funny way we pass parameters we should allow certain
+2001-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * decl2.c (lang_f_options): Const-ify.
+
2001-12-20 Joseph S. Myers <jsm28@cam.ac.uk>
* config-lang.in (diff_excludes): Remove.
if `-fSTRING' is seen as an option.
(If `-fno-STRING' is seen as an option, the opposite value is stored.) */
-static struct { const char *const string; int *variable; int on_value;}
+static const struct { const char *const string; int *const variable; const int on_value;}
lang_f_options[] =
{
/* C/C++ options. */
+Sun Dec 23 10:45:09 2001 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * com.c (ffecom_gfrt_volatile_, ffecom_gfrt_complex_,
+ ffecom_gfrt_const_, ffecom_gfrt_type_): Const-ify.
+
Sat Dec 22 16:01:51 2001 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* bld.c (ffebld_arity_op_): Declare array size explicitly.
/* Whether the function returns. */
-static bool ffecom_gfrt_volatile_[FFECOM_gfrt]
+static const bool ffecom_gfrt_volatile_[FFECOM_gfrt]
=
{
#define DEFGFRT(CODE,NAME,TYPE,ARGS,VOLATILE,COMPLEX,CONST) VOLATILE,
/* Whether the function returns type complex. */
-static bool ffecom_gfrt_complex_[FFECOM_gfrt]
+static const bool ffecom_gfrt_complex_[FFECOM_gfrt]
=
{
#define DEFGFRT(CODE,NAME,TYPE,ARGS,VOLATILE,COMPLEX,CONST) COMPLEX,
/* Whether the function is const
(i.e., has no side effects and only depends on its arguments). */
-static bool ffecom_gfrt_const_[FFECOM_gfrt]
+static const bool ffecom_gfrt_const_[FFECOM_gfrt]
=
{
#define DEFGFRT(CODE,NAME,TYPE,ARGS,VOLATILE,COMPLEX,CONST) CONST,
/* Type code for the function return value. */
-static ffecomRttype_ ffecom_gfrt_type_[FFECOM_gfrt]
+static const ffecomRttype_ ffecom_gfrt_type_[FFECOM_gfrt]
=
{
#define DEFGFRT(CODE,NAME,TYPE,ARGS,VOLATILE,COMPLEX,CONST) TYPE,
switch. The only case we support now is simply appending or deleting a
string to or from the end of the first part of the configuration name. */
-const struct modify_target
+static const struct modify_target
{
const char *const sw;
const enum add_del {ADD, DELETE} add_del;
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { STRINGX(ENUM), NAME, FORMAT },
-const struct rtx_definition defs[] =
+static const struct rtx_definition defs[] =
{
#include "rtl.def" /* rtl expressions are documented here */
};
-const char *formats[NUM_RTX_CODE];
+static const char *formats[NUM_RTX_CODE];
static const char *type_from_format PARAMS ((int));
static const char *accessor_from_format PARAMS ((int));
+2001-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Make-lang.in (keyword.h): Pass -C to gperf to const-ify
+ the static arrays that are output.
+ * jvspec.c (jvgenmain_spec): Make static.
+ * keyword.gperf (struct java_keyword, java_keyword): Const-ify.
+ * keyword.h: Regenerate.
+ * lang.c (string_option, process_option_with_no, lang_f_options,
+ lang_W_options): Const-ify.
+ * lex.c (java_lex): Likewise.
+
2001-12-21 Richard Henderson <rth@redhat.com>
* boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Merge into ..
$(srcdir)/java/keyword.h: $(srcdir)/java/keyword.gperf
(cd $(srcdir)/java || exit 1; \
- gperf -L C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k1,4,$$ \
+ gperf -L C -C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k1,4,$$ \
keyword.gperf > k$$$$.h || { \
echo "Please update gperf from ftp://ftp.gnu.org/pub/gnu/gperf/" >&2; \
rm -f k$$$$.h; \
/* True if we should add -shared-libgcc to the command-line. */
int shared_libgcc = 1;
-const char jvgenmain_spec[] =
+static const char jvgenmain_spec[] =
"jvgenmain %{D*} %b %{!pipe:%u.i} |\n\
cc1 %{!pipe:%U.i} %1 \
%{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
The Free Software Foundation is independent of Sun Microsystems, Inc. */
%}
-struct java_keyword { const char *const name; int token; };
+struct java_keyword { const char *const name; const int token; };
#ifdef __GNUC__
__inline
#endif
#ifdef __GNUC__
__inline
#endif
-struct java_keyword *java_keyword PARAMS ((const char *, unsigned int));
+const struct java_keyword *java_keyword PARAMS ((const char *, unsigned int));
%%
abstract, ABSTRACT_TK
default, DEFAULT_TK
-/* C code produced by gperf version 2.7 */
-/* Command-line: gperf -L C -F , 0 -p -t -j1 -i 1 -g -o -N java_keyword -k1,4,$ keyword.gperf */
+/* C code produced by gperf version 2.7.2 */
+/* Command-line: gperf -L C -C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k'1,4,$' keyword.gperf */
/* Keyword definition for the GNU compiler for the Java(TM) language.
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
of Sun Microsystems, Inc. in the United States and other countries.
The Free Software Foundation is independent of Sun Microsystems, Inc. */
-struct java_keyword { const char *const name; int token; };
+struct java_keyword { const char *const name; const int token; };
#ifdef __GNUC__
__inline
#endif
#ifdef __GNUC__
__inline
#endif
-struct java_keyword *java_keyword PARAMS ((const char *, unsigned int));
+const struct java_keyword *java_keyword PARAMS ((const char *, unsigned int));
#define TOTAL_KEYWORDS 51
#define MIN_WORD_LENGTH 2
#ifdef __GNUC__
__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
#endif
static unsigned int
hash (str, len)
register const char *str;
register unsigned int len;
{
- static unsigned char asso_values[] =
+ static const unsigned char asso_values[] =
{
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
#ifdef __GNUC__
__inline
#endif
-struct java_keyword *
+const struct java_keyword *
java_keyword (str, len)
register const char *str;
register unsigned int len;
{
- static struct java_keyword wordlist[] =
+ static const struct java_keyword wordlist[] =
{
- {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0},
{"else", ELSE_TK},
{"true", TRUE_TK},
{"case", CASE_TK},
{"instanceof", INSTANCEOF_TK},
{"", 0},
{"throw", THROW_TK},
- {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0},
{"native", NATIVE_TK},
{"", 0}, {"", 0}, {"", 0}, {"", 0},
{"import", IMPORT_TK},
- {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
- {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
{"goto", GOTO_TK}
};
struct string_option
{
- const char *string;
- int *variable;
- int on_value;
+ const char *const string;
+ int *const variable;
+ const int on_value;
};
static const char *java_init PARAMS ((const char *));
static void put_decl_node PARAMS ((tree));
static void java_dummy_print PARAMS ((diagnostic_context *, const char *));
static void lang_print_error PARAMS ((diagnostic_context *, const char *));
-static int process_option_with_no PARAMS ((char *,
- struct string_option *,
+static int process_option_with_no PARAMS ((const char *,
+ const struct string_option *,
int));
#ifndef TARGET_OBJECT_SUFFIX
if `-fSTRING' is seen as an option.
(If `-fno-STRING' is seen as an option, the opposite value is stored.) */
-static struct string_option
+static const struct string_option
lang_f_options[] =
{
{"emit-class-file", &flag_emit_class_files, 1},
{"indirect-dispatch", &flag_indirect_dispatch, 1}
};
-static struct string_option
+static const struct string_option
lang_W_options[] =
{
{ "redundant-modifiers", &flag_redundant, 1 },
Return 1 if option found, 0 otherwise. */
static int
process_option_with_no (p, table, table_size)
- char *p;
- struct string_option *table;
+ const char *p;
+ const struct string_option *table;
int table_size;
{
int j;
this is an identifier (possibly not respecting formation rule). */
if (all_ascii)
{
- struct java_keyword *kw;
+ const struct java_keyword *kw;
if ((kw=java_keyword (string, ascii_index)))
{
JAVA_LEX_KW (string);
/* This is an intermediate structure to initialize the table. It has
exactly the members provided by ELIMINABLE_REGS. */
-static struct elim_table_1
+static const struct elim_table_1
{
- int from;
- int to;
+ const int from;
+ const int to;
} reg_eliminate_1[] =
/* If a set of eliminable registers was specified, define the table from it.
{
struct elim_table *ep;
#ifdef ELIMINABLE_REGS
- struct elim_table_1 *ep1;
+ const struct elim_table_1 *ep1;
#endif
if (!reg_eliminate)
/* `struct directive' defines one #-directive, including how to handle it. */
struct directive {
- int length; /* Length of name */
- void (*func) PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
+ const int length; /* Length of name */
+ void (*const func) PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
/* Function to handle directive */
- const char *name; /* Name of directive */
- enum node_type type; /* Code which describes which directive. */
+ const char *const name; /* Name of directive */
+ const enum node_type type; /* Code which describes which directive. */
};
/* Last arg to output_line_command. */
/* Here is the actual list of #-directives, most-often-used first. */
-struct directive directive_table[] = {
+static const struct directive directive_table[] = {
{ 6, do_define, "define", T_DEFINE },
{ 7, do_include, "include", T_INCLUDE },
{ 5, do_endif, "endif", T_ENDIF },
FILE_BUF *ip, *op;
{
U_CHAR *bp, *cp;
- struct directive *kt;
+ const struct directive *kt;
int ident_length;
U_CHAR *resume_p;
{
U_CHAR *bp = ip->bufp, *cp;
U_CHAR *endb = ip->buf + ip->length;
- struct directive *kt;
+ const struct directive *kt;
IF_STACK_FRAME *save_if_stack = if_stack; /* don't pop past here */
U_CHAR *beg_of_line = bp;
size_t len;
enum node_type type;
{
- struct directive *kt;
+ const struct directive *kt;
FILE_BUF *ip = &instack[++indepth];
ip->fname = "*command line*";