[fpc-devel] Less global variables

Hans-Peter Diettrich DrDiettrich1 at aol.com
Sat Oct 9 15:22:45 CEST 2010


In this new approach I moved some global variables into classes, 
omitting variables that require to many consequential changes to the 
remaining compiler code - see patch #17584. This patch will allow for 
easier implementation of parallel processing in the compiler, or for 
multiple front-ends.

The variables have been replaced by (getter) functions, with some added 
procedures for updating their values - this is where getter/setter pairs 
are inapplicable for structured types, or require too many consequential 
changes for using pointers instead of plain variables. If somebody can 
suggest a less intrusive solution, more global variables can be moved.

Now I hope that this patch will be applied to the trunk soon. It's a 
very big one, including some previously supplied patches. These 
mandatory patches already have been included, because I found it not so 
easy to merge these together. Maybe my fault...

As already mentioned, I'll try to implement further front-ends now. This 
work will be based on this patch, and result in changes to almost all 
parser units. This time I'll try to implement the required changes in 
just another front-end, so that both the old and new parser can be 
tested and compared easily. If there is common interest in this project, 
I can open another branch for it, where I (hopefully) can avoid the 
problems with my preceding branches.

DoDi




More information about the fpc-devel mailing list