[PATCH] D11859: Generating vptr assume loads
Piotr Padlewski via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 13 17:46:09 PDT 2015
Prazek added inline comments.
================
Comment at: lib/CodeGen/CGClass.cpp:1832
@@ +1831,3 @@
+ // Generate vtable assumptions if we are calling dynamic class ctor
+ // and we are not in another ctor.
+ if (CGM.getCodeGenOpts().OptimizationLevel > 0 &&
----------------
hfinkel wrote:
> I think this comment should be a little more verbose. How about this:
>
> // Generate vtable assumptions if we are calling dynamic-class's ctor, except when doing so as part of a derived class's ctor's base-class initialization. Doing so in this latter case would be useless, because the vtable is about to be overwritten by the derived class's vtable.
>
The main point of not calling this function, is because it is useless to have assumption loads inside constructor, when they are generated also outside of ctor. I guess You could have case when You are not overriding base vptr, and You are calling base ctor from dynamic class
http://reviews.llvm.org/D11859
More information about the cfe-commits
mailing list