comparison gcc/genenums.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents 561a7518be6b
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Generate from machine description the strings for each enum. 1 /* Generate from machine description the strings for each enum.
2 Copyright (C) 2010 Free Software Foundation, Inc. 2 Copyright (C) 2010-2017 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify 6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
19 19
20 #include "bconfig.h" 20 #include "bconfig.h"
21 #include "system.h" 21 #include "system.h"
22 #include "coretypes.h" 22 #include "coretypes.h"
23 #include "errors.h" 23 #include "errors.h"
24 #include "statistics.h"
25 #include "vec.h"
24 #include "read-md.h" 26 #include "read-md.h"
25 27
26 /* Called via traverse_enum_types. Emit an enum definition for 28 /* Called via traverse_enum_types. Emit an enum definition for
27 enum_type *SLOT. */ 29 enum_type *SLOT. */
28 30
43 printf ("\n};\n"); 45 printf ("\n};\n");
44 return 1; 46 return 1;
45 } 47 }
46 48
47 int 49 int
48 main (int argc, char **argv) 50 main (int argc, const char **argv)
49 { 51 {
50 progname = "genenums"; 52 progname = "genenums";
51 53
52 if (!read_md_files (argc, argv, NULL, NULL)) 54 noop_reader reader;
55 if (!reader.read_md_files (argc, argv, NULL))
53 return (FATAL_EXIT_CODE); 56 return (FATAL_EXIT_CODE);
54 57
55 puts ("/* Generated automatically by the program `genenums'"); 58 puts ("/* Generated automatically by the program `genenums'");
56 puts (" from the machine description file. */\n"); 59 puts (" from the machine description file. */\n");
57 puts ("#include \"config.h\"\n"); 60 puts ("#include \"config.h\"\n");
58 puts ("#include \"system.h\"\n"); 61 puts ("#include \"system.h\"\n");
59 puts ("#include \"insn-constants.h\"\n"); 62 puts ("#include \"insn-constants.h\"\n");
60 63
61 traverse_enum_types (print_enum_type, 0); 64 reader.traverse_enum_types (print_enum_type, 0);
62 65
63 if (ferror (stdout) || fflush (stdout) || fclose (stdout)) 66 if (ferror (stdout) || fflush (stdout) || fclose (stdout))
64 return FATAL_EXIT_CODE; 67 return FATAL_EXIT_CODE;
65 68
66 return SUCCESS_EXIT_CODE; 69 return SUCCESS_EXIT_CODE;