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

Hans Wennborg hans at chromium.org
Thu Nov 14 13:47:02 PST 2013


  Thanks for the comments! New patch coming up.


================
Comment at: lib/CodeGen/CodeGenFunction.h:1159
@@ +1158,3 @@
+  void EmitCallAndReturnForThunk(GlobalDecl GD, llvm::Value *Callee,
+                                 llvm::Value *AdjustedThisPtr,
+                                 const ThunkInfo *Thunk);
----------------
Timur Iskhodzhanov wrote:
> Hans Wennborg wrote:
> > Timur Iskhodzhanov wrote:
> > > Is there any strong reason why "this" adjustment can't be performed by this function?
> > Yes, the vcall thunks shouldn't do this-adjustment.
> Wait, how is that different from return adjustment? You're passing Thunk=0 anyways, right?
Ah, you're right. Yeah we can do it in here conditional on Thunk != 0.

================
Comment at: lib/CodeGen/MicrosoftCXXABI.cpp:1012
@@ +1011,3 @@
+  // Disable the final ARC autorelease.
+  CGF.AutoreleaseResult = false;
+
----------------
Timur Iskhodzhanov wrote:
> You might want to reconsider how you've shared/duplicated lines 1009-1014 with the "standard" thunks now.
Yeah, those can be shared too.

I think we're now sharing everything except the stuff that actually differs between the "standard" thunks and vcall thunks: how to get the callee, and setting the linkage.


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



More information about the cfe-commits mailing list