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

Chris Lattner clattner at apple.com
Sat Aug 15 10:29:55 PDT 2009


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.

-Chris




More information about the cfe-dev mailing list