Hi, On Tue, 17 Jul 2018, Martin Liška wrote: > 1) gcc/optc-save-gen.awk is full of copy&pasted code, due to lack of flags type classes multiple > global variables are created (var_opt_char, var_opt_string, ...) > > 2) similar happens in gcc/opth-gen.awk > > 3) we do very many regex matches (mainly in gcc/opt-functions.awk), I believe > we should come up with a structured option format that will make parsing and > processing much simpler. > > 4) we can come up with new sanity checks of options: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81397 > > 5) there are various targets that generate *.opt files, one example is ARM: > gcc/config/arm/parsecpu.awk > > where transforms: > ./gcc/config/arm/arm-cpus.in > > I guess having a well-defined structured format for *.opt files will make > it easier to write generated opt files? > > I'm attaching a prototype that can transform optionlist into options-save.c > that can be compiled and works. > > I'm looking forward to a feedback. Using any python scripts as part of generally building GCC (i.e. where the generated files aren't prepackaged) will introduce a python dependency for distro packages. And for those distros that bootstrap a core cycle of packages (e.g. *SUSE) this will include python (and all its dependencies) into that bootstrap cycle. That will be terrible. Ciao, Michael.