[LLVMdev] DIFactory interface is going away

Devang Patel dpatel at apple.com
Fri Feb 25 08:55:39 PST 2011


On Feb 25, 2011, at 5:23 AM, Renato Golin wrote:

> On 24 February 2011 21:34, Jason Kim <jasonwkim at google.com> wrote:
>> On Thu, Feb 24, 2011 at 1:29 PM, Devang Patel <dpatel at apple.com> wrote:
> 
> It simplified a bit type construction but the overall code did not
> reduce that much.

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.

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. 

Now, with the encapsulation provided by DIBuilder, we have more freedom. 
-
Devang





More information about the llvm-dev mailing list