Page MenuHomePhabricator

MS ABI: Use musttail for vtable thunks that pass arguments by value
ClosedPublic

Authored by rnk on Jul 21 2014, 8:07 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

rnk updated this revision to Diff 11736.Jul 21 2014, 8:07 PM
rnk retitled this revision from to MS ABI: Use musttail for vtable thunks that pass arguments by value.
rnk updated this object.
rnk added a reviewer: majnemer.
rnk added a subscriber: Unknown Object (MLST).
rnk updated this revision to Diff 11907.Jul 25 2014, 6:05 PM
  • Clean up the code a bit, add more test cases, fix bugs
majnemer accepted this revision.Jul 25 2014, 6:19 PM
majnemer edited edge metadata.

LGTM with comments addressed.

lib/CodeGen/CGVTables.cpp
260–261 ↗(On Diff #11907)

Commit this separately.

317–319 ↗(On Diff #11907)

SmallVector<llvm::Value *, 8> Args(CurFn->arg_begin(), CurFn->arg_end()); would be more efficient, it will reserve the "right" amount up-front.

lib/CodeGen/MicrosoftCXXABI.cpp
1470 ↗(On Diff #11907)

CGF.EmitCallAndReturnForThunk(Callee, /*Thunk=*/nullptr);

This revision is now accepted and ready to land.Jul 25 2014, 6:19 PM
rnk added a comment.Jul 25 2014, 6:35 PM

Thanks!

lib/CodeGen/CGVTables.cpp
260–261 ↗(On Diff #11907)

Sure

317–319 ↗(On Diff #11907)

I need to take the address of the argument, so I need the for loop. :(

lib/CodeGen/MicrosoftCXXABI.cpp
1470 ↗(On Diff #11907)

Sure.

rnk closed this revision.Jul 25 2014, 6:43 PM
rnk updated this revision to Diff 11908.

Closed by commit rL214004 (authored by @rnk).