[llvm-commits] [dragonegg] r150341 - in /dragonegg/trunk: include/dragonegg/ABI.h src/DefaultABI.cpp

Chris Lattner clattner at apple.com
Mon Feb 13 13:05:22 PST 2012


On Feb 13, 2012, at 12:57 PM, Bill Wendling wrote:

> On Feb 12, 2012, at 9:13 PM, Chris Lattner <clattner at apple.com> wrote:
> 
>> On Feb 12, 2012, at 8:40 PM, Bill Wendling wrote:
>>>> Modified: dragonegg/trunk/include/dragonegg/ABI.h
>>>> URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/dragonegg/ABI.h?rev=150341&r1=150340&r2=150341&view=diff
>>>> ==============================================================================
>>>> --- dragonegg/trunk/include/dragonegg/ABI.h (original)
>>>> +++ dragonegg/trunk/include/dragonegg/ABI.h Sun Feb 12 09:35:35 2012
>>>> @@ -42,6 +42,7 @@
>>>> /// DefaultABIClient - This is a simple implementation of the ABI client
>>>> /// interface that can be subclassed.
>>>> struct DefaultABIClient {
>>>> +  virtual void anchor();
>>>> virtual ~DefaultABIClient() {}
>>> 
>>> Why not just use the d'tor as the anchor instead of a whole other (unused) method?
>> 
>> That actually slows down destruction of subclasses by preventing the virtual dtor from being inlined.  It probably doesn't matter in this case though :)
>> 
> True, but it's still a virtual call. :-) I mentioned it because there was already a lot of LLVM code which out-lines their d'tors for just this reason...

Dtor calls from derived class to base class dtors are not virtual, even if the dtor is virtual.  Think about what would happen if they were.

-Chris



More information about the llvm-commits mailing list