Hi! On Thu, Jun 17, 2021 at 10:18:54AM -0500, Bill Schmidt wrote: > * config/rs6000/rs6000-gen-builtins.c (rbtree.h): New #include. > (num_bifs): New variable. > (num_ovld_stanzas): Likewise. > (num_ovlds): Likewise. > (parse_codes): New enum. > (bif_rbt): New variable. > (ovld_rbt): Likewise. > (fntype_rbt): Likewise. > (bifo_rbt): Likewise. > (parse_bif): New stub function. > (create_bif_order): Likewise. > (parse_ovld): Likewise. > (write_header_file): Likewise. > (write_init_file): Likewise. > (write_defines_file): Likewise. > (delete_output_files): New function. > (main): Likewise.
> +/* Parse the built-in file. */ > +static parse_codes > +parse_bif (void) > +{ > + return PC_OK; > +} Baby steps :-) > +/* Write everything to the header file (rs6000-builtins.h). */ > +static int > +write_header_file (void) > +{ > + return 1; > +} What does the return value mean? Please document it in a comment. Same for other functions (where the function name does not make it obvious what the return value is). > +static void > +delete_output_files (void) > +{ > + /* Depending on whence we're called, some of these may already be > + closed. Don't check for errors. */ > + fclose (header_file); > + fclose (init_file); > + fclose (defines_file); > + > + unlink (header_path); > + unlink (init_path); > + unlink (defines_path); > +} What are header_path etc.? It is a very good idea to make sure this is never something terrible to call unlink on (including making sure the delete_output_files function is *obviously* never called if creating the files didn't succeed). > +/* Main program to convert flat files into built-in initialization code. */ > +int > +main (int argc, const char **argv) > +{ > + if (argc != 6) > + { > + fprintf (stderr, > + "Five arguments required: two input file and three output " > + "files.\n"); Two input file_s_ :-) (Or s/file //). > + pgm_path = argv[0]; This isn't portable (depending on what you use it for -- argv[0] is not necessarily a path at all). > + bif_file = fopen (bif_path, "r"); > + if (!bif_file) > + { > + fprintf (stderr, "Cannot find input built-in file '%s'.\n", bif_path); > + exit (1); > + } Say s/find/open/ in the error? > + fprintf (stderr, "Cannot find input overload file '%s'.\n", ovld_path); (more) Okay with those trivialities, and the unlink stuff looked at. Thanks! Segher