From 66b0fe8f4ef0d0345a66c9783b056e765ea6065b Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 6 May 2016 15:14:05 +0000 Subject: [PATCH] Make argv const char ** in read_md_files etc gcc/ChangeLog: * genattr-common.c (main): Convert argv from char ** to const char **. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (initiate_automaton_gen): Likewise. (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genenums.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genmddeps.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genpreds.c (main): Likewise. * genrecog.c (main): Likewise. * gensupport.c (init_rtx_reader_args_cb): Likewise. (init_rtx_reader_args): Likewise. * gensupport.h (init_rtx_reader_args_cb): Likewise. (init_rtx_reader_args): Likewise. * gentarget-def.c (main): Likewise. * read-md.c (read_md_files): Likewise. * read-md.h (read_md_files): Likewise. From-SVN: r235976 --- gcc/ChangeLog | 30 ++++++++++++++++++++++++++++++ gcc/genattr-common.c | 2 +- gcc/genattr.c | 2 +- gcc/genattrtab.c | 2 +- gcc/genautomata.c | 4 ++-- gcc/gencodes.c | 2 +- gcc/genconditions.c | 2 +- gcc/genconfig.c | 2 +- gcc/genconstants.c | 2 +- gcc/genemit.c | 2 +- gcc/genenums.c | 2 +- gcc/genextract.c | 2 +- gcc/genflags.c | 2 +- gcc/genmddeps.c | 2 +- gcc/genopinit.c | 2 +- gcc/genoutput.c | 4 ++-- gcc/genpeep.c | 4 ++-- gcc/genpreds.c | 2 +- gcc/genrecog.c | 2 +- gcc/gensupport.c | 4 ++-- gcc/gensupport.h | 5 +++-- gcc/gentarget-def.c | 2 +- gcc/read-md.c | 2 +- gcc/read-md.h | 2 +- 24 files changed, 59 insertions(+), 28 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4e40912d866..82620983289 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,33 @@ +2016-05-06 David Malcolm + + * genattr-common.c (main): Convert argv from + char ** to const char **. + * genattr.c (main): Likewise. + * genattrtab.c (main): Likewise. + * genautomata.c (initiate_automaton_gen): Likewise. + (main): Likewise. + * gencodes.c (main): Likewise. + * genconditions.c (main): Likewise. + * genconfig.c (main): Likewise. + * genconstants.c (main): Likewise. + * genemit.c (main): Likewise. + * genenums.c (main): Likewise. + * genextract.c (main): Likewise. + * genflags.c (main): Likewise. + * genmddeps.c (main): Likewise. + * genopinit.c (main): Likewise. + * genoutput.c (main): Likewise. + * genpeep.c (main): Likewise. + * genpreds.c (main): Likewise. + * genrecog.c (main): Likewise. + * gensupport.c (init_rtx_reader_args_cb): Likewise. + (init_rtx_reader_args): Likewise. + * gensupport.h (init_rtx_reader_args_cb): Likewise. + (init_rtx_reader_args): Likewise. + * gentarget-def.c (main): Likewise. + * read-md.c (read_md_files): Likewise. + * read-md.h (read_md_files): Likewise. + 2016-05-06 Uros Bizjak * config/i386/i386.md (int cmove peephole2s): Use general_reg_operand diff --git a/gcc/genattr-common.c b/gcc/genattr-common.c index e073faf7509..a11fbf707b1 100644 --- a/gcc/genattr-common.c +++ b/gcc/genattr-common.c @@ -61,7 +61,7 @@ gen_attr (md_rtx_info *info) } int -main (int argc, char **argv) +main (int argc, const char **argv) { bool have_delay = false; bool have_sched = false; diff --git a/gcc/genattr.c b/gcc/genattr.c index c6db37fa942..656a9a72b06 100644 --- a/gcc/genattr.c +++ b/gcc/genattr.c @@ -138,7 +138,7 @@ find_tune_attr (rtx exp) } int -main (int argc, char **argv) +main (int argc, const char **argv) { bool have_annul_true = false; bool have_annul_false = false; diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index c956527cd42..d39d4a70e92 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -5197,7 +5197,7 @@ handle_arg (const char *arg) } int -main (int argc, char **argv) +main (int argc, const char **argv) { struct attr_desc *attr; struct insn_def *id; diff --git a/gcc/genautomata.c b/gcc/genautomata.c index e3a6c59056d..dcde604f190 100644 --- a/gcc/genautomata.c +++ b/gcc/genautomata.c @@ -9300,7 +9300,7 @@ parse_automata_opt (const char *str) /* The following is top level function to initialize the work of pipeline hazards description translator. */ static void -initiate_automaton_gen (char **argv) +initiate_automaton_gen (const char **argv) { const char *base_name; @@ -9592,7 +9592,7 @@ write_automata (void) } int -main (int argc, char **argv) +main (int argc, const char **argv) { progname = "genautomata"; diff --git a/gcc/gencodes.c b/gcc/gencodes.c index e0dd32a9075..3b0fc5ce9f8 100644 --- a/gcc/gencodes.c +++ b/gcc/gencodes.c @@ -47,7 +47,7 @@ gen_insn (md_rtx_info *info) } int -main (int argc, char **argv) +main (int argc, const char **argv) { progname = "gencodes"; diff --git a/gcc/genconditions.c b/gcc/genconditions.c index 8abf1c243a9..e4f45b097cd 100644 --- a/gcc/genconditions.c +++ b/gcc/genconditions.c @@ -212,7 +212,7 @@ write_writer (void) } int -main (int argc, char **argv) +main (int argc, const char **argv) { progname = "genconditions"; diff --git a/gcc/genconfig.c b/gcc/genconfig.c index b6ca35ae6c4..815e30d7330 100644 --- a/gcc/genconfig.c +++ b/gcc/genconfig.c @@ -269,7 +269,7 @@ gen_peephole2 (md_rtx_info *info) } int -main (int argc, char **argv) +main (int argc, const char **argv) { progname = "genconfig"; diff --git a/gcc/genconstants.c b/gcc/genconstants.c index b96bc509018..c10e3e34cd1 100644 --- a/gcc/genconstants.c +++ b/gcc/genconstants.c @@ -75,7 +75,7 @@ print_enum_type (void **slot, void *info ATTRIBUTE_UNUSED) } int -main (int argc, char **argv) +main (int argc, const char **argv) { progname = "genconstants"; diff --git a/gcc/genemit.c b/gcc/genemit.c index 87f53010926..33040aac36d 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -745,7 +745,7 @@ output_peephole2_scratches (rtx split) } int -main (int argc, char **argv) +main (int argc, const char **argv) { progname = "genemit"; diff --git a/gcc/genenums.c b/gcc/genenums.c index d0d80a662c5..db46a67b591 100644 --- a/gcc/genenums.c +++ b/gcc/genenums.c @@ -45,7 +45,7 @@ print_enum_type (void **slot, void *info ATTRIBUTE_UNUSED) } int -main (int argc, char **argv) +main (int argc, const char **argv) { progname = "genenums"; diff --git a/gcc/genextract.c b/gcc/genextract.c index 52227b5645a..d5917813436 100644 --- a/gcc/genextract.c +++ b/gcc/genextract.c @@ -394,7 +394,7 @@ insn_extract (rtx_insn *insn)\n{\n\ } int -main (int argc, char **argv) +main (int argc, const char **argv) { unsigned int i; struct extraction *p; diff --git a/gcc/genflags.c b/gcc/genflags.c index 5c3fa795539..8b37b151a1d 100644 --- a/gcc/genflags.c +++ b/gcc/genflags.c @@ -198,7 +198,7 @@ gen_insn (md_rtx_info *info) } int -main (int argc, char **argv) +main (int argc, const char **argv) { rtx dummy; rtx *insns; diff --git a/gcc/genmddeps.c b/gcc/genmddeps.c index 078053142a9..fd26a3335f4 100644 --- a/gcc/genmddeps.c +++ b/gcc/genmddeps.c @@ -40,7 +40,7 @@ add_filedep (const char *pathname) } int -main (int argc, char **argv) +main (int argc, const char **argv) { struct filedep *d; diff --git a/gcc/genopinit.c b/gcc/genopinit.c index 6d7ad4ffc38..5f4f354384e 100644 --- a/gcc/genopinit.c +++ b/gcc/genopinit.c @@ -105,7 +105,7 @@ open_outfile (const char *file_name) } int -main (int argc, char **argv) +main (int argc, const char **argv) { FILE *h_file, *s_file; unsigned int i, j, n, last_kind[5]; diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 6ca1bb89cf7..f8c25ac4df0 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -983,10 +983,10 @@ init_insn_for_nothing (void) idata_end = &idata->next; } -extern int main (int, char **); +extern int main (int, const char **); int -main (int argc, char **argv) +main (int argc, const char **argv) { progname = "genoutput"; diff --git a/gcc/genpeep.c b/gcc/genpeep.c index aef9c74145f..132cdced690 100644 --- a/gcc/genpeep.c +++ b/gcc/genpeep.c @@ -340,10 +340,10 @@ print_code (RTX_CODE code) putchar (TOUPPER (*p1)); } -extern int main (int, char **); +extern int main (int, const char **); int -main (int argc, char **argv) +main (int argc, const char **argv) { max_opno = -1; diff --git a/gcc/genpreds.c b/gcc/genpreds.c index c0d7ce4146c..dd7dbbfc6b7 100644 --- a/gcc/genpreds.c +++ b/gcc/genpreds.c @@ -1618,7 +1618,7 @@ parse_option (const char *opt) /* Master control. */ int -main (int argc, char **argv) +main (int argc, const char **argv) { progname = argv[0]; if (argc <= 1) diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 47e42660fcc..a9f5a4a1300 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -5223,7 +5223,7 @@ remove_clobbers (acceptance_type *acceptance_ptr, rtx *pattern_ptr) } int -main (int argc, char **argv) +main (int argc, const char **argv) { state insn_root, split_root, peephole2_root; diff --git a/gcc/gensupport.c b/gcc/gensupport.c index 8c5a1ab8602..0eb45919ec8 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -2501,7 +2501,7 @@ check_define_attr_duplicates () /* The entry point for initializing the reader. */ bool -init_rtx_reader_args_cb (int argc, char **argv, +init_rtx_reader_args_cb (int argc, const char **argv, bool (*parse_opt) (const char *)) { /* Prepare to read input. */ @@ -2538,7 +2538,7 @@ init_rtx_reader_args_cb (int argc, char **argv, /* Programs that don't have their own options can use this entry point instead. */ bool -init_rtx_reader_args (int argc, char **argv) +init_rtx_reader_args (int argc, const char **argv) { return init_rtx_reader_args_cb (argc, argv, 0); } diff --git a/gcc/gensupport.h b/gcc/gensupport.h index 3620afd6b9e..645512c23f4 100644 --- a/gcc/gensupport.h +++ b/gcc/gensupport.h @@ -125,8 +125,9 @@ struct optab_pattern }; extern rtx add_implicit_parallel (rtvec); -extern bool init_rtx_reader_args_cb (int, char **, bool (*)(const char *)); -extern bool init_rtx_reader_args (int, char **); +extern bool init_rtx_reader_args_cb (int, const char **, + bool (*)(const char *)); +extern bool init_rtx_reader_args (int, const char **); extern bool read_md_rtx (md_rtx_info *); extern unsigned int get_num_insn_codes (); diff --git a/gcc/gentarget-def.c b/gcc/gentarget-def.c index 606d7292767..adbb564ed46 100644 --- a/gcc/gentarget-def.c +++ b/gcc/gentarget-def.c @@ -279,7 +279,7 @@ add_insn (md_rtx_info *info) } int -main (int argc, char **argv) +main (int argc, const char **argv) { progname = "gentarget-def"; diff --git a/gcc/read-md.c b/gcc/read-md.c index b5beb4ac9da..6c588781978 100644 --- a/gcc/read-md.c +++ b/gcc/read-md.c @@ -1063,7 +1063,7 @@ parse_include (const char *arg) details about the callback's interface. */ bool -read_md_files (int argc, char **argv, bool (*parse_opt) (const char *), +read_md_files (int argc, const char **argv, bool (*parse_opt) (const char *), directive_handler_t handle_directive) { int i; diff --git a/gcc/read-md.h b/gcc/read-md.h index cc6a5be250d..fc3b077325b 100644 --- a/gcc/read-md.h +++ b/gcc/read-md.h @@ -150,7 +150,7 @@ extern void upcase_string (char *); extern void traverse_md_constants (htab_trav, void *); extern void traverse_enum_types (htab_trav, void *); extern struct enum_type *lookup_enum_type (const char *); -extern bool read_md_files (int, char **, bool (*) (const char *), +extern bool read_md_files (int, const char **, bool (*) (const char *), directive_handler_t); #endif /* GCC_READ_MD_H */ -- 2.30.2