]> granicus.if.org Git - clang/commit
[-cxx-abi microsoft] Emit thunks for pointers to virtual member functions
authorHans Wennborg <hans@hanshq.net>
Fri, 15 Nov 2013 17:24:45 +0000 (17:24 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 15 Nov 2013 17:24:45 +0000 (17:24 +0000)
commit93b717ac956f5c82f7895ed8874cbd514c6d0a4e
tree80c2e524edbe556e59532a4d293e408482f3ce9f
parent16205cd0bd60bf38c9647a8bb787b6af7e0b7fa4
[-cxx-abi microsoft] Emit thunks for pointers to virtual member functions

Instead of storing the vtable offset directly in the function pointer and
doing a branch to check for virtualness at each call site, the MS ABI
generates a thunk for calling the function at a specific vtable offset,
and puts that in the function pointer.

This patch adds support for emitting such thunks. However, it doesn't support
pointers to virtual member functions that are variadic, have an incomplete
aggregate return type or parameter, or are overriding a function in a virtual
base class.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194827 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Mangle.h
lib/AST/MicrosoftMangle.cpp
lib/CodeGen/CGVTables.cpp
lib/CodeGen/CodeGenFunction.h
lib/CodeGen/MicrosoftCXXABI.cpp
test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp [new file with mode: 0644]