[PATCH] D66360: Expose constructing a virtual method dispatch through the include/clang/CodeGen APIs.

Parker Schuh via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 16 12:59:15 PDT 2019


pschuh created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

In swift, we want to be able to call c++ virtual methods by looking up in the virtual table. There appears to exist no way currently, via the standard APIs, to take a CXXMethodDecl and a llvm::Value representing a this-ptr and construct the llvm instructions necessary to extract the method from the virtual table as well as adjust the this-ptr.

For reference, this is used in https://github.com/apple/swift/pull/26658.


Repository:
  rC Clang

https://reviews.llvm.org/D66360

Files:
  include/clang/CodeGen/CodeGenABITypes.h
  include/clang/CodeGen/SwiftCallingConv.h
  lib/CodeGen/CodeGenABITypes.cpp
  lib/CodeGen/SwiftCallingConv.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66360.215655.patch
Type: text/x-patch
Size: 4938 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190816/cf6bbe46/attachment.bin>


More information about the cfe-commits mailing list