Hi Ian, Ian Lance Taylor <i...@google.com> writes:
> Unfortunately we have discovered over time that all the memory usage > matters. A rule of thumb for gcc is that compilation speed is roughly > proportional to the amount of memory used. I think fundamentally the requirements of those who use GCC as just a compiler and those who use it to do other things (via plugins) will be often at odds. The "compiler users" will always strive to keep as little syntactic information as possible to maximize performance. While the "plugin users" will want as much context as possible. A more general approach which could satisfy both camps would be to allow the "plugin users" to maintain the extra information if they need to. For example, I would be perfectly happy to build and use the typedef hierarchy outside of the AST. And all that I would need for this is a plugin event, similar to PLUGIN_FINISH_TYPE, that would give me base type, new type, and the decl nodes. In the parser source code the overhead would be an additional if-statement for each typedef: if (finish_typedef_callbacks_count != 0) /* Call registered callbacks. */ The nice thing about this approach is that it can be applied equally well to a lot of things without having to fit them into the existing tree. What do you think? Thanks, Boris