diff options
author | John McCall <rjmccall@apple.com> | 2016-10-26 23:46:34 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2016-10-26 23:46:34 +0000 |
commit | a896e9a7d27788e7573f3ca13066cc5fc6d91da6 (patch) | |
tree | 5c973ba5e89c894464a6365f764955ff10e54b97 /lib/CodeGen/CGCXXABI.cpp | |
parent | 9b0930125c1489b2a4dbe3bce28cd1f31a662baa (diff) |
Refactor call emission to package the function pointer together with
abstract information about the callee. NFC.
The goal here is to make it easier to recognize indirect calls and
trigger additional logic in certain cases. That logic will come in
a later patch; in the meantime, I felt that this was a significant
improvement to the code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285258 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXXABI.cpp')
-rw-r--r-- | lib/CodeGen/CGCXXABI.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGCXXABI.cpp b/lib/CodeGen/CGCXXABI.cpp index e4da447edd..df75a7d7ff 100644 --- a/lib/CodeGen/CGCXXABI.cpp +++ b/lib/CodeGen/CGCXXABI.cpp @@ -73,7 +73,7 @@ CGCXXABI::ConvertMemberPointerType(const MemberPointerType *MPT) { return CGM.getTypes().ConvertType(CGM.getContext().getPointerDiffType()); } -llvm::Value *CGCXXABI::EmitLoadOfMemberFunctionPointer( +CGCallee CGCXXABI::EmitLoadOfMemberFunctionPointer( CodeGenFunction &CGF, const Expr *E, Address This, llvm::Value *&ThisPtrForCall, llvm::Value *MemPtr, const MemberPointerType *MPT) { @@ -86,7 +86,8 @@ llvm::Value *CGCXXABI::EmitLoadOfMemberFunctionPointer( cast<CXXRecordDecl>(MPT->getClass()->getAs<RecordType>()->getDecl()); llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType( CGM.getTypes().arrangeCXXMethodType(RD, FPT, /*FD=*/nullptr)); - return llvm::Constant::getNullValue(FTy->getPointerTo()); + llvm::Constant *FnPtr = llvm::Constant::getNullValue(FTy->getPointerTo()); + return CGCallee::forDirect(FnPtr, FPT); } llvm::Value * |