[LLVMdev] Adding DenseMap::FindAndConstruct with a default value

Ted Kremenek kremenek at apple.com
Thu Jun 5 09:48:07 PDT 2008

On Jun 5, 2008, at 7:49 AM, Matthijs Kooijman wrote:

> So, to solve this, I propose adding a second version of
> DenseMap::FindAndConstruct, which has an extra argument for the  
> default value.
> So, it would do the same thing as the original (return a reference  
> to the
> value from the map, adding it if it's not already in), but instead  
> of using
> ValueT() as a default value, it would use an argument.

This sounds fine to me.  I believe that member functions of template  
classes are not instantiated until they are used, so it shouldn't pose  
a problem  for existing clients of DenseMap, nor have an impact on  
code size of existing clients, etc.

More information about the llvm-dev mailing list