On Jan 5, 2010, at 11:46 AM, Chris Lattner wrote:

>
> On Jan 5, 2010, at 11:06 AM, Douglas Gregor wrote:
>
>> Author: dgregor
>> Date: Tue Jan  5 13:06:31 2010
>> New Revision: 92753
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=92753&view=rev
>> Log:
>> Improve key-function computation for templates. In particular:
>> - All classes can have a key function; templates don't change that.
>> non-template classes when computing the key function.
>> - We always mark all of the virtual member functions of class
>> template instantiations.
>> - The vtable for an instantiation of a class template has weak
>> linkage.
>>
>> We could probably use available_externally linkage for vtables of
>> classes instantiated by explicit instantiation declarations (extern
>> templates), but GCC doesn't do this and I'm not 100% that the ABI
>> permits it.
>
> GCC is missing several optimizations in this area that prevent  
> devirtualization etc.  available_externally can be used any time we  
> know the contents of the object and we know it will be emitted to  
> some other translation unit.  It just gives the optimizer the  
> ability to see into the data without emitting it.


Yes, I know. The question is whether the ABI requires us to emit a  
(weak) vtable when there is an explicit instantiation declaration,  
since the ABI document just refers to "template instantiations" as if  
they were all the same.

        - Doug
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to