ADT: Sink the guts of StringMapEntry::Create into StringMapEntryBase
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 28 Jan 2021 23:43:04 +0000 (15:43 -0800)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 9 Apr 2021 00:57:47 +0000 (17:57 -0700)
commit4a84b03eced28cf08636e45700d3c8594378f329
tree55701e8696984a41a5027e362381eabd12052673
parenteb8a28e2cf033f2bfbfe33a0bd0d9e75a12e2679
ADT: Sink the guts of StringMapEntry::Create into StringMapEntryBase

Sink the interesting parts of StringMapEntry::Create into a new function
StringMapEntryBase::allocateWithKey that's only templated on the
allocator, taking the entry size and alignment as parameters.

As dblaikie pointed out in the review, it'd be interesting as a
follow-up to make this more generic and maybe sink at least some of it
into a source file; I haven't done that yet myself, but I left behind an
encouraging comment.

Differential Revision: https://reviews.llvm.org/D95654
llvm/include/llvm/ADT/StringMapEntry.h