[PATCH] Optimize pointers to member function

Olivier Goffart ogoffart at kde.org
Thu Feb 14 03:57:42 PST 2013


Hi,

This patch optimize comparison and calling of pointers to member function.

If we know that a given class do not have multiple inheritance, we can 
simplify the comparison and the calls as the pointer to this will never be 
shifted.
On the Microsoft ABI (which is not implemented in clang), the size of a 
pointer to a member function is even reduced in that case.[1]

Similarly, if we know the class has no virtual table, no need to emit a branch 
for virtual functions.

[1] http://blogs.msdn.com/b/oldnewthing/archive/2004/02/09/70002.aspx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Optimize-pointers-to-member-function.patch
Type: text/x-patch
Size: 8701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130214/ee5a09a5/attachment.bin>


More information about the cfe-commits mailing list