[cfe-dev] Feature proposal: adding optional custom info to clang AST nodes.

Abramo Bagnara abramobagnara at tin.it
Sat Aug 15 10:53:24 PDT 2009


Chris Lattner ha scritto:
> On Aug 15, 2009, at 10:18 AM, Abramo Bagnara wrote:
>> This stated, it is nonetheless clear that the ability to attach
>> arbitrary data to AST nodes (for specifically compiled versions of the
>> library) is of great usefulness.
>>
>> The library is less general but using a map it would be much less
>> efficient.
> 
> Hi Abramo,
> 
> LLVM heavily uses the "map on the side" approach.  This is how
> optimization passes associate data with IR objects etc.  The LLVM
> "DenseMap" datastructure is heavily optimized for this use, we don't
> want void*'s on AST nodes.

This is why this approach has been discarded.

The heart of the proposal is to have a special configure option to add a
custom field only when client needs it.

The change is fully transparent to ordinary applications.




More information about the cfe-dev mailing list