On 25 February 2011 16:55, Devang Patel <dpatel at apple.com>
wrote:> The old interface expected FEs to keep track of everything, where as new
interface tries to encapsulate as much info as possible. This should help
cleanup FE code responsible to generate debugging information. I made a first
pass in clang and simplified code little bit. There is more room for improvement
now. If you look at CGDebugInfo.cpp in clang, you'll see "Unit"
variable/argument used all over the place. IMO, majority of these could be
eliminated thanks to DIBuilder.
Yes, I got rid of that, too.
> Another significant improvement is that it does not expose internal data
structures (e.g. DerivedType, CompositeType... ) to FEs. The front-end should
not be forced to learn about them and they do not directly represent any DWARF
concept anyway. It is just an approach used my predecessor to communicate debug
info from FE to llvm code generator.
Indeed, I liked the way it's hidden in DIBuilder. Also the way
typerefs are dealt with, too, is very good.
Would be good to split CreateLocalVariable into CreateArgValue and
CreateAutoVariable. Also would be good to have a simpler array types
creation (CreateArrayType(size, align, ty, num_elms)).
cheers,
--renato