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

Chris Lattner clattner at apple.com
Sat Aug 15 11:07:03 PDT 2009


On Aug 15, 2009, at 10:53 AM, Abramo Bagnara wrote:

> 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.

We still don't want it, a DenseMap works great.

-Chris



More information about the cfe-dev mailing list