[PATCH] D12455: [IR] Teach `llvm::User` to co-allocate a descriptor.

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 15:34:44 PDT 2015


On Wed, Sep 2, 2015 at 3:30 PM, Pete Cooper <peter_cooper at apple.com> wrote:
>
>> On Sep 2, 2015, at 3:20 PM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:
>>
>> sanjoy added a comment.
>>
>> @pete - can you please take a look to see if you're okay with how I've specialized `operator new`?
> The implementation generally looks good with just one question.
>
> Can you check to see if allocateFixedOperandUser can just be static inline in User.cpp and avoid the declaration in User.h?

That's exactly what I tried first. :)  The problem with that is that
the fields it needs to populate in the allocated User instance are
protected, so that leaves me with either

 - make allocateFixedOperandUser a friend, which IMHO is even uglier
than what I have now
or
 - copy the stores to the fields in the User instance to the operator
new implementations, in which case the benefit of a shared
implementation is lost

-- Sanjoy


>
> Otherwise LGTM.
>
> Thanks,
> Pete
>>
>>
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D12455&d=BQIFaQ&c=eEvniauFctOgLOKGJOplqw&r=03tkj3107244TlY4t3_hEgkDY-UG6gKwwK0wOUS3qjM&m=Xw5go3ocA3WFS9VUceYGLOtQZatFzfVq0EIKS_CkaaY&s=7bd4hN0eD59OPZIU3JMqMub6oRpT45d4V4D6bIWGGTo&e=
>>
>>
>>
>



-- 
Sanjoy Das
http://playingwithpointers.com


More information about the llvm-commits mailing list