[llvm-commits] [llvm] r136481 - in /llvm/trunk: include/llvm/ADT/StringExtras.h utils/TableGen/Record.cpp

Chris Lattner clattner at apple.com
Fri Jul 29 14:07:22 PDT 2011


On Jul 29, 2011, at 1:48 PM, David A. Greene wrote:

> Chris Lattner <clattner at apple.com> writes:
> 
>> On Jul 29, 2011, at 12:06 PM, David Greene wrote:
> 
>>> Create a std::string wrapper for use as a DenseMap key.  DenseMap is
>>> not safe in generate with strings, so this wrapper indicates that only
>>> strings guaranteed not to have certain values should be used in the
>>> DenseMap.
>> 
>> This is fine with me in principle, but out of curiosity, why use
>> DenseMap<string, x> instead of StringMap<x>?  The later doesn't need
>> this and is *much* more efficient.
> 
> This isn't a DenseMap<string, x>.  It's a
> DenseMap<StructTypeThatIncludesAString, x>.

In that case, why do you need densemap traits for the string?

-Chris



More information about the llvm-commits mailing list