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
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index 7ae83f4..62c3954 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -358,16 +358,21 @@
 
 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 @@
                                  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");
+}