Waldek Hebisch wrote:
- Ada front end is very different from GPC. At least one GPC bug would be very easy to fix if GPC worked the Gnat way (but GPC is much simpler then Gnat).
Which one exactly are you referring to?
The following program ilustrates the problem (AFAIR something similar is in the todo directory). In procedure k reference to x is illegal becouse k is in the scope of second declaratin, but before the defining point. It would be easy to catch such things by tree-walk, but otherwise housekeeping is quite messy.
program scope; var x : integer; procedure p; procedure k; begin x:= x+1; end; var x : boolean; begin end; begin writeln('failed') end .
I think we could improve a few things (in particular operations on string/set constants) by not converting things to backend trees so early. AFAIK, we'll have to do something like what Gnat does sometime anyway to support TreeSSA in a future GCC version, but I hope we can do it in a rather lightweight way. I think, using extended trees (only where necessary/useful) in the frontend and translate them to backend trees at the latest moment should be possible. The latter will require recursive traversal of expression trees, but this isn't such a big deal, we do it for schemata already.
Yes, if we had full expression tree we could infer types of set constants much more accurately.