[llvm-commits] PATCH: add ContextualDenseMap

Chris Lattner clattner at apple.com
Mon Aug 30 14:03:57 PDT 2010

On Aug 26, 2010, at 8:22 AM, Nick Lewycky wrote:

> This patch adds a new ContextualDenseMap and sinks most of the dense map logic into DenseMapImpl. A ContextualDenseMap takes a ContextualDenseMapInfo pointer instead of just a typename. I need this for mergefuncs where I want a comparison operation that involves target data.
> The four map info functions (getTombstoneKey, getEmptyKey, getHashValue and isEqual) are made virtual in DenseMapImpl and then implemented once in DenseMap and again in ContextualDenseMap. This implementation is modelled after the relationship between ContextualFoldingSet and FoldingSet.

This seems like it will slow down densemap, perhaps substantially, by introducing virtual methods.  It's also not clear to me what this is actually doing.  Please explain what you are trying to do and why the current densemap can't do it.


More information about the llvm-commits mailing list