[cs] Major option processing changes

Mike Stump mrs@apple.com
Thu Jan 22 05:16:00 GMT 2004


These changes move option processing from the server start line to the 
client command line.  This allow us to simplify server starting so much 
so, that we can default it to on, which I did.  This is mainly done for 
testing, and probably breaks the bootstrap and maybe the build, I'll be 
working on that next.  It is easy enough to default it to off.

Also contained in here is code to notice when files are changed and 
arrange to re-read them and code to fix PCH, again, and 
conditionalization of the output fragments on actually using the server 
and to use the normal option processing to get the input file names.

For the initialization code, I don't like the idiom I used:

init() {
	foo1();
	foo2();
	foo3();
}

==>

init() {
	static int first = 1;

	if (first)
		foo1();
	foo2();
	if (first)
		foo3();
	first = 0;
}

but, the init code is very tangled and very poorly engineered.

Long term, we should do this:

init_once_all() {
	init_foo1();
	init_foo3();
}

init_foo1() {
	init_deps_foo1();
	foo1();
}

init_foo2() {
	init_deps_foo2();
	foo2();
}

init_foo3() {
	init_deps_foo3();
	foo3();
}

and have all temporal ordering and dependancies explicit in the code in 
the form of the complete dependancy set for each fine-grained 
initialization.  This then dynamically creates a proper ordering, 
without the need to move or change code.  Also, one can radically 
change the code and be sure that it is easy to maintain, easy to get 
right and make it work, which is very hard with the current code.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cs-11.diffs.txt.gz
Type: application/x-gzip
Size: 18182 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040122/da3cc8c5/attachment.bin>


More information about the Gcc-patches mailing list