[LLVMdev] DIFactory interface is going away

Duncan Sands baldrick at free.fr
Fri Feb 25 02:28:25 PST 2011


On 24/02/11 22:34, Jason Kim wrote:
> On Thu, Feb 24, 2011 at 1:29 PM, Devang Patel<dpatel at apple.com>  wrote:
>> Hi All,
>> DIFactory interface, part of DebugInfo.h, is used to emit LLVM IR constructs
>> to encode debugging information. We are replacing this interface with new
>> simple interface, DIBuilder.
>> Here is one example that demonstrates differences between two interfaces. To
>> create debug information entries to encode volatile type one would use
>> following call in a language front end,
>> CreateDerivedType(DW_TAG_volatile_type, Context, StringRef(), File,
>>                            0 /*line no*/, type_size_in_bits,
>> type_align_in_bits,
>>                            0 /* offset */, 0 /* flags */, OriginalType);
>> using DIFactory interface. Now, DIBuilder allows you to do the same using
>> following call.
>> createQualifiedType(DW_TAG_volatile_type, OriginalType);
>> DIBuilder interface was introduced in Nov/Dec last year. Now, clang has
>> fully adopted this new interface. So we are going to remove DIFactory from
>> llvm sources soon. Our plan is to move DIFactory interface in dragonegg (and
>> llvm-gcc) for now until the front-ends adopt DIBuilder.
>> If you have any concerns about this plan, please speak up now.
>
> Assuming it has no impact on the actual dwarf tags, smaller code is better!
> -jason

It does make me wonder how you are supposed to represent types which cannot
be properly represented by LLVM types, for example structs with fields at
variable offsets from the start and/or of variable size; or structs with
fields that may or may not be present depending on the value of other fields.
Such types occur in Ada for example.

Ciao, Duncan.



More information about the llvm-dev mailing list