Hi Chris,

On Jul 12, 2009, at 3:35 PM, Chris Lattner wrote:

>
>> +class Entity : public llvm::FoldingSetNode {
>> +public:
>
> Why should Entity's be FoldingSetNodes?  There are two reasons to use
> a folding set (instead of a DenseMap<pair<Entity*,void*>, Entity*>):
>
> 1. If you want to derive from Entity, so you may have heterogenous
> keys indexing the map.
> 2. If the key data is large.
>
> I don't think either of these applies here, should Entity's be uniqued
> with a DenseMap instead of a FoldingSet?

The key data is simple now but eventually it will grow, especially for  
supporting C++.
e.g., overloaded functions will be associated with different entities,  
so the key will include info about the parameter types.
And templates will introduce more complexity as well.

-Argiris
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to