[PATCH] D94439: [ADT][NFC] Use empty base optimisation in BumpPtrAllocatorImpl

Nathan James via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 13:01:44 PST 2021


njames93 added a comment.

In D94439#2491194 <https://reviews.llvm.org/D94439#2491194>, @dblaikie wrote:

> In D94439#2491180 <https://reviews.llvm.org/D94439#2491180>, @njames93 wrote:
>
>> In D94439#2491075 <https://reviews.llvm.org/D94439#2491075>, @dblaikie wrote:
>>
>>> I think for full generality the standard library does some things to check if a type can be derived from before using it in this way - but we probably don't need all that machinery for LLVM-internal allocator stuff like this?
>>
>> We just have to make sure people don't use an allocator that's defined with the final keyword. I doubt we are going to run into many cases of that. 
>> I have done the template magic to get it make it work if someone wants to use an allocator marked final, should I include it?
>
> Probably wouldn't bother - might be worth leaving it here or in the commit message, or in a comment in the code as a "here's how to do it if it turns out someone needs it".

To make the class work is code than I'd be happy to tack onto the commit message. I'll just make a note in the commit message about it.
Basically just create a class that has an instance of the `final` Allocator type, then create calls that forward to that instance.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94439/new/

https://reviews.llvm.org/D94439



More information about the llvm-commits mailing list