[llvm] r204204 - When destroying a StringMap, just iterate over the map and destroy the contained elements. Don't reset them back to 0 as their values aren't needed any more. This results in ~StringMap() being mostly empty for POD types in BumpPtrAllocators

Philip Reames listmail at philipreames.com
Thu Mar 20 17:34:56 PDT 2014


On 03/19/2014 09:53 AM, David Blaikie wrote:
> On Wed, Mar 19, 2014 at 9:47 AM, Philip Reames
> <listmail at philipreames.com> wrote:
>> Is there a good performance justification for this change?  From what I can
>> tell, you're removing one assignment per Bucket + 2 assignments.  This seems
>> hardly worth the code duplication.
>>
>> Also, having destructed pointers be null is useful for catching
>> use-after-free bugs.  I'm reluctant to give that up.
>>
>> Unless you can justify this change from a performance standpoint, I'd
>> request that you revert it.
>>
>> p.s. If there was a review for this, sorry for not catching it.
> Refer to the thread entitled "[PATCH] Make StringMap aware of POD types".
>
Thanks.  Objection withdrawn.

Philip



More information about the llvm-commits mailing list