[cfe-dev] checking for virtual members

John Bytheway jbytheway+llvm at gmail.com
Mon Nov 15 15:25:34 PST 2010


On 10/11/10 06:09, John Thompson wrote:
> Doug,
>  
> I'm afraid I don't know the appropriate compiler terms to explain it
> most correctly.  Basically, the main idea for the attribute is to
> optimize a class that has one data member, which must be a vector, such
> that the whole object can be stored in a vector register, thus avoiding
> referencing memory.  Therefore, anything that would add extra storage,
> such as a vtable pointer would have to be detected.  I don't know that
> that would preclude multiple inheritance, but I would imagine it
> wouldn't make sense to have multiple base classes that don't add data
> members or virtual functions.  I was thinking that just checking for a
> vtable and only one member which must be a vector would be sufficient.

Is it really important that it have one member?  If you hadn't said that
I'd suggest that the correct thing to check was whether it has a trivial
copy constructor.

John Bytheway




More information about the cfe-dev mailing list