* c-decl.c (c_decode_option): Likewise.
* c-typeck.c (warn_for_assignment): Likewise.
* collect2.c (libexts, is_ctor_dtor, main, ignore_library):
Likewise.
* cppinit.c (output_deps): Likewise.
* dependence.c (dependence_string, direction_string): Likewise.
* dwarf2out.c (output_ranges): Likewise.
* fixinc/fixfixes.c (emit_gnu_type): Likewise.
* fixinc/gnu-regex.c (re_error_msgid): Likewise.
* gcc.c (standard_exec_prefix, standard_exec_prefix_1,
standard_startfile_prefix, standard_startfile_prefix_1,
standard_startfile_prefix_2, tooldir_base_prefix,
standard_bindir_prefix, find_a_file): Likewise.
* genattrtab.c (make_length_attrs): Likewise.
* gencheck.c (tree_codes): Likewise.
* genemit.c (gen_split): Likewise.
* genrecog.c (special_mode_pred_table): Likewise.
* graph.c (graph_ext): Likewise.
* protoize (default_include): Likewise.
* reload.c (reload_when_needed_name): Likewise.
* sched-vis.c (visualize_stall_cycles): Likewise.
* tlink.c (recompile_files): Likewise.
* toplev.c (decode_g_option): Likewise.
* tradcpp.c (output_deps): Likewise.
* varasm.c (decode_reg_name): Likewise.
* arm.c (arm_condition_codes, strings_fpa, thumb_condition_code):
Const-ification.
* arm.md: Likewise.
* avr.c (avr_regnames, encode_section_info): Likewise.
* c4x.c (float_reg_names): Likewise.
* darwin.h (ASM_GLOBALIZE_LABEL): Likewise.
* elfos.h (const_section): Likewise.
* i386.c (ix86_comp_type_attributes): Likewise.
* i386/win32.h (STRIP_NAME_ENCODING): Likewise.
* ia64/aix.h (UNIQUE_SECTION): Likewise.
* ia64.c (type_names): Likewise.
* m68hc11.c (reg_class_names): Likewise.
* m88k.c (m_options): Likewise.
* mips.c (mips_output_conditional_branch, mips_unique_section):
Likewise.
* rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Likewise.
* sparc.c (sparc_flat_function_prologue, sparc_flat_function_epilogue,
ultra_code_names): Likewise.
* sparc.h (OVERRIDE_OPTIONS): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45567
138bc75d-0d04-0410-961f-
82ee72b054a4
+2001-09-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-common.c (c_tree_code_name): Const-ification.
+ * c-decl.c (c_decode_option): Likewise.
+ * c-typeck.c (warn_for_assignment): Likewise.
+ * collect2.c (libexts, is_ctor_dtor, main, ignore_library):
+ Likewise.
+ * cppinit.c (output_deps): Likewise.
+ * dependence.c (dependence_string, direction_string): Likewise.
+ * dwarf2out.c (output_ranges): Likewise.
+ * fixinc/fixfixes.c (emit_gnu_type): Likewise.
+ * fixinc/gnu-regex.c (re_error_msgid): Likewise.
+ * gcc.c (standard_exec_prefix, standard_exec_prefix_1,
+ standard_startfile_prefix, standard_startfile_prefix_1,
+ standard_startfile_prefix_2, tooldir_base_prefix,
+ standard_bindir_prefix, find_a_file): Likewise.
+ * genattrtab.c (make_length_attrs): Likewise.
+ * gencheck.c (tree_codes): Likewise.
+ * genemit.c (gen_split): Likewise.
+ * genrecog.c (special_mode_pred_table): Likewise.
+ * graph.c (graph_ext): Likewise.
+ * protoize (default_include): Likewise.
+ * reload.c (reload_when_needed_name): Likewise.
+ * sched-vis.c (visualize_stall_cycles): Likewise.
+ * tlink.c (recompile_files): Likewise.
+ * toplev.c (decode_g_option): Likewise.
+ * tradcpp.c (output_deps): Likewise.
+ * varasm.c (decode_reg_name): Likewise.
+
+ * arm.c (arm_condition_codes, strings_fpa, thumb_condition_code):
+ Const-ification.
+ * arm.md: Likewise.
+ * avr.c (avr_regnames, encode_section_info): Likewise.
+ * c4x.c (float_reg_names): Likewise.
+ * darwin.h (ASM_GLOBALIZE_LABEL): Likewise.
+ * elfos.h (const_section): Likewise.
+ * i386.c (ix86_comp_type_attributes): Likewise.
+ * i386/win32.h (STRIP_NAME_ENCODING): Likewise.
+ * ia64/aix.h (UNIQUE_SECTION): Likewise.
+ * ia64.c (type_names): Likewise.
+ * m68hc11.c (reg_class_names): Likewise.
+ * m88k.c (m_options): Likewise.
+ * mips.c (mips_output_conditional_branch, mips_unique_section):
+ Likewise.
+ * rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Likewise.
+ * sparc.c (sparc_flat_function_prologue, sparc_flat_function_epilogue,
+ ultra_code_names): Likewise.
+ * sparc.h (OVERRIDE_OPTIONS): Likewise.
+
2001-09-12 Jakub Jelinek <jakub@redhat.com>
* configure.in (gcc_cv_as_shf_merge): Fix a typo.
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
-static const char *c_tree_code_name[] = {
+static const char *const c_tree_code_name[] = {
"@@dummy",
#include "c-common.def"
};
-std=gnu89 default, iso9899:1990 + gnu extensions
-std=gnu99 iso9899:1999 + gnu extensions
*/
- const char *argstart = &p[5];
+ const char *const argstart = &p[5];
if (!strcmp (argstart, "iso9899:1990")
|| !strcmp (argstart, "c89"))
if (function)
{
/* Function name is known; supply it. */
- const char *argstring = _("passing arg %d of `%s'");
+ const char *const argstring = _("passing arg %d of `%s'");
new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
+ strlen (argstring) + 1 + 25
/*%d*/ + 1);
else
{
/* Function name unknown (call through ptr); just give arg number.*/
- const char *argnofun = _("passing arg %d of pointer to function");
+ const char *const argnofun = _("passing arg %d of pointer to function");
new_opname = (char *) alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argnofun, argnum);
}
static struct path_prefix libpath_lib_dirs; /* directories in LIBPATH */
static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs,
&libpath_lib_dirs, NULL};
-static const char *libexts[3] = {"a", "so", NULL}; /* possible library extentions */
+static const char *const libexts[3] = {"a", "so", NULL}; /* possible library extentions */
#endif
static void handler PARAMS ((int));
is_ctor_dtor (s)
const char *s;
{
- struct names { const char *name; int len; int ret; int two_underscores; };
+ struct names { const char *const name; int len; int ret; int two_underscores; };
register struct names *p;
register int ch;
int argc;
char *argv[];
{
- const char *ld_suffix = "ld";
+ const char *const ld_suffix = "ld";
const char *full_ld_suffix = ld_suffix;
- const char *real_ld_suffix = "real-ld";
- const char *collect_ld_suffix = "collect-ld";
- const char *nm_suffix = "nm";
+ const char *const real_ld_suffix = "real-ld";
+ const char *const collect_ld_suffix = "collect-ld";
+ const char *const nm_suffix = "nm";
const char *full_nm_suffix = nm_suffix;
- const char *gnm_suffix = "gnm";
+ const char *const gnm_suffix = "gnm";
const char *full_gnm_suffix = gnm_suffix;
#ifdef LDD_SUFFIX
- const char *ldd_suffix = LDD_SUFFIX;
+ const char *const ldd_suffix = LDD_SUFFIX;
const char *full_ldd_suffix = ldd_suffix;
#endif
- const char *strip_suffix = "strip";
+ const char *const strip_suffix = "strip";
const char *full_strip_suffix = strip_suffix;
- const char *gstrip_suffix = "gstrip";
+ const char *const gstrip_suffix = "gstrip";
const char *full_gstrip_suffix = gstrip_suffix;
const char *arg;
FILE *outf;
/* Array of standard AIX libraries which should not
be scanned for ctors/dtors. */
-static const char *aix_std_libs[] = {
+static const char *const aix_std_libs[] = {
"/unix",
"/lib/libc.a",
"/lib/libm.a",
ignore_library (name)
const char *name;
{
- const char **p = &aix_std_libs[0];
+ const char *const *p = &aix_std_libs[0];
while (*p++ != NULL)
if (! strcmp (name, *p)) return 1;
return 0;
int arm_target_label;
/* The condition codes of the ARM, and the inverse function. */
-const char * arm_condition_codes[] =
+const char *const arm_condition_codes[] =
{
"eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc",
"hi", "ls", "ge", "lt", "gt", "le", "al", "nv"
static int fpa_consts_inited = 0;
-static const char * strings_fpa[8] =
+static const char *const strings_fpa[8] =
{
"0", "1", "2", "3",
"4", "5", "0.5", "10"
rtx x;
int invert;
{
- static const char * conds[] =
+ static const char *const conds[] =
{
"eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc",
"hi", "ls", "ge", "lt", "gt", "le"
arm_cc;
extern arm_cc arm_current_cc;
-extern const char * arm_condition_codes[];
+extern const char *const arm_condition_codes[];
#define ARM_INVERSE_CONDITION_CODE(X) ((arm_cc) (((int)X) ^ 1))
do \
{ \
int mi_delta = (DELTA); \
- const char * mi_op = mi_delta < 0 ? "sub" : "add"; \
+ const char *const mi_op = mi_delta < 0 ? "sub" : "add"; \
int shift = 0; \
int this_regno = (aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) \
? 1 : 0); \
"TARGET_ARM"
"*
{
- const char * opcodes[4][2] =
+ static const char *const opcodes[4][2] =
{
{\"cmp\\t%2, %3\;cmp%d5\\t%0, %1\",
\"cmp\\t%0, %1\;cmp%d4\\t%2, %3\"},
"TARGET_ARM"
"*
{
- const char * opcodes[4][2] =
+ static const char *const opcodes[4][2] =
{
{\"cmp\\t%0, %1\;cmp%D4\\t%2, %3\",
\"cmp\\t%2, %3\;cmp%D5\\t%0, %1\"},
rtx ldi_reg_rtx;
/* AVR register names {"r0", "r1", ..., "r31"} */
-const char * avr_regnames[] = REGISTER_NAMES;
+static const char *const avr_regnames[] = REGISTER_NAMES;
/* This holds the last insn address. */
static int last_insn_address = 0;
&& TREE_CODE (decl) == VAR_DECL
&& avr_progmem_p (decl))
{
- const char *dsec = ".progmem.data";
+ const char *const dsec = ".progmem.data";
DECL_SECTION_NAME (decl) = build_string (strlen (dsec), dsec);
TREE_READONLY (decl) = 1;
}
static int c4x_leaf_function;
-static const char *float_reg_names[] = FLOAT_REGISTER_NAMES;
+static const char *const float_reg_names[] = FLOAT_REGISTER_NAMES;
/* Array of the smallest class containing reg number REGNO, indexed by
REGNO. Used by REGNO_REG_CLASS in c4x.h. We assume that all these
#undef ASM_GLOBALIZE_LABEL
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
- do { const char* _x = (NAME); if (!!strncmp (_x, "_OBJC_", 6)) { \
+ do { const char *const _x = (NAME); if (!!strncmp (_x, "_OBJC_", 6)) { \
(fputs (".globl ", FILE), assemble_name (FILE, _x), fputs ("\n", FILE)); \
}} while (0)
const char *name; \
char *string; \
const char *prefix; \
- static const char *prefixes[4][2] = \
+ static const char *const prefixes[4][2] = \
{ \
{ ".text.", ".gnu.linkonce.t." }, \
{ ".rodata.", ".gnu.linkonce.r." }, \
tree type2;
{
/* Check for mismatch of non-default calling convention. */
- const char *rtdstr = TARGET_RTD ? "cdecl" : "stdcall";
+ const char *const rtdstr = TARGET_RTD ? "cdecl" : "stdcall";
if (TREE_CODE (type1) != FUNCTION_TYPE)
return 1;
#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
do { \
const char *_p; \
- const char *_name = ((SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*')); \
+ const char *const _name = ((SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*'));\
for (_p = _name; *_p && *_p != '@'; ++_p) \
; \
if (*_p == '@') \
const char *name; \
char *string; \
const char *prefix; \
- static const char *prefixes[/*4*/3][2] = \
+ static const char *const prefixes[/*4*/3][2] = \
{ \
{ ".text.", ".gnu.linkonce.t." }, \
{ ".rodata.", ".gnu.linkonce.r." }, \
/* Map attr_type to a string with the name. */
-static const char *type_names[] =
+static const char *const type_names[] =
{
"UNKNOWN", "A", "I", "M", "F", "B", "L", "X", "S"
};
/* Reload and register operations. */
-static const char *reg_class_names[] = REG_CLASS_NAMES;
+static const char *const reg_class_names[] = REG_CLASS_NAMES;
void
return pos + fprintf (file, "%s%s%s", sep, type, name);
}
-static struct { const char *name; int value; } m_options[] = TARGET_SWITCHES;
+static struct { const char *const name; int value; } m_options[] = TARGET_SWITCHES;
static void
output_options (file, f_options, f_len, W_options, W_len,
operand. */
const char *op2 = (two_operands_p ? ",%z3" : ",%.");
/* The operand-printing string for the comparison. */
- const char *comp = (float_p ? "%F0" : "%C0");
+ const char *const comp = (float_p ? "%F0" : "%C0");
/* The operand-printing string for the inverted comparison. */
- const char *inverted_comp = (float_p ? "%W0" : "%N0");
+ const char *const inverted_comp = (float_p ? "%W0" : "%N0");
/* The MIPS processors (for levels of the ISA at least two), have
"likely" variants of each branch instruction. These instructions
int len, size, sec;
const char *name, *prefix;
char *string;
- static const char *prefixes[4][2] = {
+ static const char *const prefixes[4][2] = {
{ ".text.", ".gnu.linkonce.t." },
{ ".rodata.", ".gnu.linkonce.r." },
{ ".data.", ".gnu.linkonce.d." },
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
do { \
- const char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \
+ const char *const init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \
\
if (TARGET_RELOCATABLE && (get_pool_size () != 0 || profile_flag) \
&& uses_TOC()) \
if (size > 0)
{
unsigned int reg_offset = current_frame_info.reg_offset;
- const char *fp_str = reg_names[FRAME_POINTER_REGNUM];
- const char *t1_str = "%g1";
+ const char *const fp_str = reg_names[FRAME_POINTER_REGNUM];
+ const char *const t1_str = "%g1";
/* Things get a little tricky if local variables take up more than ~4096
bytes and outgoing arguments take up more than ~4096 bytes. When that
{
unsigned HOST_WIDE_INT reg_offset = current_frame_info.reg_offset;
unsigned HOST_WIDE_INT size1;
- const char *sp_str = reg_names[STACK_POINTER_REGNUM];
- const char *fp_str = reg_names[FRAME_POINTER_REGNUM];
- const char *t1_str = "%g1";
+ const char *const sp_str = reg_names[STACK_POINTER_REGNUM];
+ const char *const fp_str = reg_names[FRAME_POINTER_REGNUM];
+ const char *const t1_str = "%g1";
/* In the reload sequence, we don't need to fill the load delay
slots for most of the loads, also see if we can fill the final
static enum ultra_code ultra_code_from_mask PARAMS ((int));
static void ultra_schedule_insn PARAMS ((rtx *, rtx *, int, enum ultra_code));
-static const char *ultra_code_names[NUM_ULTRA_CODES] = {
+static const char *const ultra_code_names[NUM_ULTRA_CODES] = {
"NONE", "IEU0", "IEU1", "IEUN", "LSU", "CTI",
"FPM", "FPA", "SINGLE" };
{ \
if (flag_pic) \
{ \
- const char *pic_string = (flag_pic == 1) ? "-fpic" : "-fPIC";\
+ const char *const pic_string = (flag_pic == 1) ? "-fpic" : "-fPIC";\
warning ("%s and profiling conflict: disabling %s", \
pic_string, pic_string); \
flag_pic = 0; \
{
/* Stream on which to print the dependency information. */
FILE *deps_stream = 0;
- const char *deps_mode = CPP_OPTION (pfile, print_deps_append) ? "a" : "w";
+ const char *const deps_mode =
+ CPP_OPTION (pfile, print_deps_append) ? "a" : "w";
if (CPP_OPTION (pfile, deps_file) == 0)
deps_stream = stdout;
enum dependence_type {dt_flow, dt_anti, dt_output, dt_none};
#if 0
-static const char * dependence_string [] = {"flow", "anti", "output", "none"};
+static const char *const dependence_string [] = {"flow", "anti", "output", "none"};
#endif
enum direction_type {lt, le, eq, gt, ge, star, independent, undef};
#if 0
-static const char * direction_string [] = {"<", "<=", "=", ">", ">=", "*",
+static const char *const direction_string [] = {"<", "<=", "=", ">", ">=", "*",
"INDEPENDENT", "UNDEFINED"};
#endif
enum def_use_type {def, use, init_def_use};
output_ranges ()
{
register unsigned i;
- const char *start_fmt = "Offset 0x%x";
+ const char *const start_fmt = "Offset 0x%x";
const char *fmt = start_fmt;
for (i = 0; i < ranges_table_in_use; ++i)
typedef __%s_TYPE__ %s_t;\n\
#endif\n";
- const char* pz_guard = (strcmp (z_type, "wchar") == 0)
+ const char *const pz_guard = (strcmp (z_type, "wchar") == 0)
? " && ! defined(__cplusplus)" : "";
printf (z_fmt, z_TYPE, pz_guard, z_TYPE, z_TYPE, z_type);
POSIX doesn't require that we do anything for REG_NOERROR,
but why not be nice? */
-static const char *re_error_msgid[] =
+static const char *const re_error_msgid[] =
{
gettext_noop ("Success"), /* REG_NOERROR */
gettext_noop ("No match"), /* REG_NOMATCH */
#define STANDARD_BINDIR_PREFIX "/usr/local/bin"
#endif
-static const char *standard_exec_prefix = STANDARD_EXEC_PREFIX;
-static const char *standard_exec_prefix_1 = "/usr/lib/gcc/";
+static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
+static const char *const standard_exec_prefix_1 = "/usr/lib/gcc/";
static const char *md_exec_prefix = MD_EXEC_PREFIX;
static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
-static const char *standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
-static const char *standard_startfile_prefix_1 = "/lib/";
-static const char *standard_startfile_prefix_2 = "/usr/lib/";
+static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+static const char *const standard_startfile_prefix_1 = "/lib/";
+static const char *const standard_startfile_prefix_2 = "/usr/lib/";
-static const char *tooldir_base_prefix = TOOLDIR_BASE_PREFIX;
+static const char *const tooldir_base_prefix = TOOLDIR_BASE_PREFIX;
static const char *tooldir_prefix;
-static const char *standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
+static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
/* Subdirectory to use for locating libraries. Set by
set_multilib_dir based on the compilation options. */
int mode;
{
char *temp;
- const char *file_suffix = ((mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : "");
+ const char *const file_suffix =
+ ((mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : "");
struct prefix_list *pl;
int len = pprefix->max_len + strlen (name) + strlen (file_suffix) + 1;
static void
make_length_attrs ()
{
- static const char *new_names[] = {"*insn_default_length",
+ static const char *const new_names[] = {"*insn_default_length",
"*insn_variable_length_p",
"*insn_current_length"};
static rtx (*no_address_fn[]) PARAMS ((rtx)) = {identity_fn, zero_fn, zero_fn};
#define DEFTREECODE(SYM, NAME, TYPE, LEN) STRINGX(SYM),
-const char *tree_codes[] = {
+static const char *const tree_codes[] = {
#include "tree.def"
#include "c-common.def"
#include "gencheck.h"
{
register int i;
int operands;
- const char *name = "split";
+ const char *const name =
+ ((GET_CODE (split) == DEFINE_PEEPHOLE2) ? "peephole2" : "split");
const char *unused;
- if (GET_CODE (split) == DEFINE_PEEPHOLE2)
- name = "peephole2";
-
if (XVEC (split, 0) == 0)
fatal ("define_%s (definition %d) lacks a pattern", name,
insn_index_number);
#define NUM_KNOWN_PREDS ARRAY_SIZE (preds)
-static const char * special_mode_pred_table[] = {
+static const char *const special_mode_pred_table[] = {
#ifdef SPECIAL_MODE_PREDICATES
SPECIAL_MODE_PREDICATES
#endif
#include "toplev.h"
#include "graph.h"
-static const char *graph_ext[] =
+static const char *const graph_ext[] =
{
/* no_graph */ "",
/* vcg */ ".vcg",
#define LOCAL_INCLUDE_DIR "/usr/local/include"
#endif
-struct default_include { const char *fname;
- const char *component;
+struct default_include { const char *const fname;
+ const char *const component;
int x1, x2; } include_defaults[]
#ifdef INCLUDE_DEFAULTS
= INCLUDE_DEFAULTS;
return 0;
}
-static const char *reload_when_needed_name[] =
+static const char *const reload_when_needed_name[] =
{
"RELOAD_FOR_INPUT",
"RELOAD_FOR_OUTPUT",
visualize_stall_cycles (stalls)
int stalls;
{
- const char *prefix = ";; ";
+ const char *const prefix = ";; ";
const char *suffix = "\n";
char *p;
{
char *line, *command;
FILE *stream = fopen ((char*) f->root.key, "r");
- const char *outname = frob_extension ((char*) f->root.key, ".rnw");
+ const char *const outname = frob_extension ((char*) f->root.key, ".rnw");
FILE *output = fopen (outname, "w");
while ((line = tfgets (stream)) != NULL)
-gdwarf -g3 is equivalent to -gdwarf3. */
static int type_explicitly_set_p = 0;
/* Indexed by enum debug_info_type. */
- static const char *debug_type_names[] =
+ static const char *const debug_type_names[] =
{
"none", "stabs", "coff", "dwarf-1", "dwarf-2", "xcoff"
};
{
/* Stream on which to print the dependency information. */
FILE *deps_stream = 0;
- const char *deps_mode = deps_append ? "a" : "w";
+ const char *const deps_mode = deps_append ? "a" : "w";
if (deps_file == 0)
deps_stream = stdout;
#ifdef ADDITIONAL_REGISTER_NAMES
{
- static struct { const char *name; int number; } table[]
+ static struct { const char *const name; int number; } table[]
= ADDITIONAL_REGISTER_NAMES;
for (i = 0; i < (int) ARRAY_SIZE (table); i++)