diff options
author | John McCall <rjmccall@apple.com> | 2010-08-22 03:04:22 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-22 03:04:22 +0000 |
commit | 3023def6bea3af6dbb51eea51f8cb8ea892d26cf (patch) | |
tree | 6b36fd5c4cd5344c45cd709f58d267a1d3b83093 /lib/CodeGen/CGCXX.cpp | |
parent | a7e6845660f91ec611427e1db842780e1ec12bdb (diff) |
Abstract out member-pointer conversions.
Pretty much everything having to do with member pointers is ABI-specific.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111770 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index 7ae83f44b4..62c3954ee6 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -358,16 +358,21 @@ CodeGenFunction::BuildVirtualCall(const CXXDestructorDecl *DD, CXXDtorType Type, CGCXXABI::~CGCXXABI() {} +static void ErrorUnsupportedABI(CodeGenFunction &CGF, + llvm::StringRef S) { + Diagnostic &Diags = CGF.CGM.getDiags(); + unsigned DiagID = Diags.getCustomDiagID(Diagnostic::Error, + "cannot yet compile %s in this ABI"); + Diags.Report(CGF.getContext().getFullLoc(CGF.CurCodeDecl->getLocation()), + DiagID) + << S; +} + llvm::Value *CGCXXABI::EmitLoadOfMemberFunctionPointer(CodeGenFunction &CGF, llvm::Value *&This, llvm::Value *MemPtr, const MemberPointerType *MPT) { - Diagnostic &Diags = CGF.CGM.getDiags(); - unsigned DiagID = - Diags.getCustomDiagID(Diagnostic::Error, - "cannot yet compile member pointer calls in this ABI"); - Diags.Report(CGF.getContext().getFullLoc(CGF.CurCodeDecl->getLocation()), - DiagID); + ErrorUnsupportedABI(CGF, "calls through member pointers"); const FunctionProtoType *FPT = MPT->getPointeeType()->getAs<FunctionProtoType>(); @@ -379,3 +384,11 @@ llvm::Value *CGCXXABI::EmitLoadOfMemberFunctionPointer(CodeGenFunction &CGF, FPT->isVariadic()); return llvm::Constant::getNullValue(FTy->getPointerTo()); } + +void CGCXXABI::EmitMemberPointerConversion(CodeGenFunction &CGF, + const CastExpr *E, + llvm::Value *Src, + llvm::Value *Dest, + bool VolatileDest) { + ErrorUnsupportedABI(CGF, "member pointer conversions"); +} |