[PATCH] Make StringMap aware of POD types

Pete Cooper peter_cooper at apple.com
Mon Mar 17 11:47:47 PDT 2014


Hi all

Please review this patch to make StringMap be aware of when it contains POD types allocated on a BumpPtrAllocator.  In this case its unnecessary to clear the map in its destructor.  This is particularly painful on IdentiferTable in clang where we walk an 8192 entry map of pointers and uselessly destruct them.

Unfortunately I needed to move a couple of class declarations inside their headers instead of cpp files (to use isPODLike), but otherwise I hope this looks ok.  I’m totally open to suggestions on better naming or a better way to enable this functionality.

There’s also a small clang diff.  I’ll didn’t want to cross-post both lists so will wait until the other details are worked out before I email it there.

Thanks,
Pete

-------------- next part --------------
A non-text attachment was scrubbed...
Name: stringmap-llvm.diff
Type: application/octet-stream
Size: 14407 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140317/a84729fe/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stringmap-clang.diff
Type: application/octet-stream
Size: 884 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140317/a84729fe/attachment-0001.obj>


More information about the llvm-commits mailing list