From 52ce8670b90d819a9b9ce0571355a07adce303bf Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Sat, 19 Mar 2016 02:36:32 -0400
Subject: [PATCH 003/117] FIXME: make argv const char ** in read_md_files etc

---
 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 +-
 23 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/gcc/genattr-common.c b/gcc/genattr-common.c
index e073faf..a11fbf7 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 c6db37f..656a9a7 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 b64d8b9..91d04d4 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -5182,7 +5182,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 e3a6c59..dcde604 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 e0dd32a..3b0fc5c 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 8abf1c2..e4f45b0 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 b6ca35a..815e30d 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 b96bc50..c10e3e3 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 87f5301..33040aa 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 d0d80a6..db46a67 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 52227b5..d591781 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 5c3fa79..8b37b15 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 0780531..fd26a33 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 6d7ad4f..5f4f354 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 6ca1bb8..f8c25ac 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 aef9c74..132cdce 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 c0d7ce4..dd7dbbf 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 f8b8ef4..7c513d7 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 8c5a1ab..0eb4591 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 3620afd..645512c 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 606d729..adbb564 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 b5beb4a..6c58878 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 cc6a5be..fc3b077 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 */
-- 
1.8.5.3

