On Fri, 3 Oct 2014, David Malcolm wrote: > The "main" function for the driver in gcc.c has grown from ~200 lines > in its original form (way back in r262) to ~1000 lines today, with a > dozen locals (if we include the params). > > The following patch splits it up into 15 smaller functions, moving the > various locals into the places where they're needed, so we can easily > see e.g where argc/argv get read vs written. > > The functions are private methods of a new "driver" class to give an > extra level of encapsualation beyond just being static in gcc.c, and so > that we can hide some state as member data inside the driver instance. > > Turning them into named functions/methods also makes it easier to talk > about the different phases of "main", and put breakpoints on them. > > Bootstrapped®rtested on x86_64-unknown-linux-gnu (Fedora 20). > > OK for trunk?
OK, minus the if (0) code: > + if (0) > + { > + int i; > + for (i = 0; i < argc; i++) > + printf ("argc[%i]: %s\n", i, argv[i]); > + } -- Joseph S. Myers jos...@codesourcery.com