[llvm] r221960 - IR: Rewrite uniquing and creation of MDString

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu Dec 4 17:13:21 PST 2014


> On 2014-Dec-04, at 15:56, David Blaikie <dblaikie at gmail.com> wrote:
> 
> 
> 
> On Thu, Dec 4, 2014 at 3:44 PM, Alexey Samsonov <vonosmas at gmail.com> wrote:
> FYI, StringMapEntry<>::GetStringMapEntryFromValue is inherently broken - I've failed to fix it in r223402, but failed. We can't just "get the offset" of a non-standard-layout object field. I'd be happy to delete GetStringMapEntryFromValue from the codebase completely, but currently MDString::getString() is its only user.
> 
> FWIW when I was refactoring the StringMap API to be more consistent with the associative container concept (removing GetOrCreate in favor of the 'insert', etc) I found several other uses that wanted/were doing similar things to MDString, but paid the overhead of a StringRef in their value that referenced back into the key.
>  

It's cheaper to store a pointer to the StringMapEntry, but yeah :(.



More information about the llvm-commits mailing list