Steven Bosscher wrote: > On Saturday 03 December 2005 20:43, Mark Mitchell wrote: > >>There is one advantage I see in the LTO design over LLVM's design. In >>particular, the LTO proposal envisions a file format that is roughly at >>the level of GIMPLE. Such a file format could easily be extended to be >>at the source-level version of Tree used in the front-ends, so that >>object files could contain two extra sections: one for LTO and one for >>source-level information. The latter section could be used for things >>like C++ "export" -- but, more importantly, for other tools that need >>source-level information, like IDEs, indexers, checkers, etc. > > > I actually see this as a disadvantage. > > IMVHO dumping for "export" and front-end tools and for the optimizers > should not be coupled like this. Iff we decide to dump trees, then I > would hope the dumper would dump GIMPLE only, not the full front end > and middle-end tree representation.
You and I have disagreed about this before, and I think we will continue to do so. I don't see anything about Tree that I find inherently awful; in fact, it looks very much like what I see in other front ends. There are aspects I dislike (overuse of pointers, lack of type-safety, unncessary copies of types), but I couldn't possibly justify changing the C++ front-end, for example, to use something entirely other than Tree. That would be a big project, and I don't see much benefit; I think that the things I don't like can be fixed incrementally. (For example, it occurred to me a while back that by fixing the internal type-correctness of expressions, which we want to do anyhow, we could eliminate TREE_TYPE from expression nodes, which would save a pointer.) It's not that I would object to waking up one day to find out that the C++ front-end no longer used Tree, but it just doesn't seem very compelling to me. > Sharing a tree dumper between the front ends and the middle-end would > only make it more difficult again to move to sane data structures for > the middle end and to cleaner data structures for the front ends. The differences between GIMPLE and C++ Trees are small, structurally; there are just a lot of extra nodes in C++ that never reach GIMPLE. If we had a tree dumper for one, we'd get the other one almost for free. So, I don't think sharing the tree dumper stands in the way of anything; you can still switch either part of the compiler to use non-Tree whenever you like. You'll just need a new dumper, which you would have wanted anyhow. -- Mark Mitchell CodeSourcery, LLC [EMAIL PROTECTED] (916) 791-8304