"Simon Brenner" <[EMAIL PROTECTED]> writes:

> I propose to implement incremental parsing in C++ (through hand-waving, C++ 
> has
> been decided to be the language most in need of incremental parsing), similar 
> to
> the approach in article [1]. Basically, a diff algorithm is run on the 
> character
> or token stream, producing a list of insertions, modifications, and deletions,
> and this list of changed characters/tokens is compared to the previous parse
> tree to decide what parts of the tree need reparsing and recompilation.
> 
> In this project, I wouldn't even try to attack incremental code generation, 
> but
> just run the entire middle/back end on an updated tree. A future extension
> would be to use the information about which trees have changed to perform
> minimal code generation. This approach obviously limits the improvement in
> compile time, and an important initial part of the project would be to measure
> the time spent in lexing, parsing and everything after parsing to see what the
> potential gain would be.

Another approach I've considered is to skip parsing functions until
they are needed.  Since the parser dominates the -O0 compilation time,
and since large C++ projects have hundreds of inline functions which
are never needed by any particular compilation, I think there could be
a big -O0 benefit from only parsing functions as needed.

My main comment on your approach is that storing the tree
representation in an object file is nontrivial.  However, you may be
able to take advantage of the partially implemented LTO work.

Either way it sounds like an interesting and useful project.

Ian

Reply via email to