[PATCH] [-cxx-abi microsoft] Emit thunks for pointers to virtual member functions

Reid Kleckner rnk at google.com
Wed Nov 13 11:41:34 PST 2013



================
Comment at: lib/CodeGen/MicrosoftCXXABI.cpp:1972
@@ +1971,3 @@
+  CGF.FinishFunction();
+  CGM.setFunctionLinkage(MD, ThunkFn); // XXX: Do we need this?
+
----------------
Timur Iskhodzhanov wrote:
> Reid Kleckner wrote:
> > Timur Iskhodzhanov wrote:
> > > Isn't this copying the function's linkage over to the thunk?
> > > Don't you get "symbol already defined" if you link two TUs generating the same thunk together?
> > These should be merged like inline functions.  They should be linkonce_odr for externally visible types and internal for internal types.  We probably have logic for that somewhere.
> I don't see this in the lit test expectations:
> 
>   define x86_thiscallcc void @"\01??_9C@@$B7AE"
Yes, I agree with you, the logic needs to change.  :)  I'm just adding that if the type is internal than we can make the thunk internal too, which is slightly better for the optimizers.  We can probably reuse some existing code for this.


http://llvm-reviews.chandlerc.com/D2104



More information about the cfe-commits mailing list