On Sun, Jul 22, 2007 at 07:37:43PM -0400, Kenneth Zadeck wrote: > I find it somewhat surprising that we need so many blocks. My > experience is that in real programs few blocks actually have any local > declarations and it appears that we do not bother to get rid of the > blocks that have no local decls. However the biggest problem for lto > is that when a procedure is inlined, the set of blocks for the inlined > function is copied and the new copies have a cross link to the original > version. It would help a lot if that pointer could be replaced with > something like a pointer to a function decl and the dfs number of the > block in the original function. I do not know the semantics of what is > needed by the debuggers, but some representation where each function can > be managed as a separate unit is going to be required to process large > programs.
We need to emit all blocks containing local declarations, and maybe some parents of such blocks to maintain a correctly nested tree (not sure). For each block that we emit in an inlined function we need some way to reference the associated abstract block, because that's where variable declarations end up in DWARF; take a look at DW_AT_abstract_origin in the spec. -- Daniel Jacobowitz CodeSourcery