Add Objective-C property setter support.
 - Change Obj-C runtime message API, drop the ObjCMessageExpr arg in
   favor of just result type and selector. Necessary so it can be
   reused in situations where we don't want to cons up an
   ObjCMessageExpr.
 - Update aggregate binary assignment to know about special property
   ref lvalues.
 - Add CodeGenFunction::EmitCallArg overload which takes an already
   emitted rvalue.

Add CodeGenFunction::StoreComplexIntoAddr.

Disabled logic in Sema for parsing Objective-C dot-syntax that
accesses methods. This code does not search in the correct order and
the AST node has no way of properly representing its results.

Updated StmtDumper to print a bit more information about
ObjCPropertyRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55561 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 2a808f8..79b5011 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -86,13 +86,15 @@
   if (isSuperMessage) {
     // super is only valid in an Objective-C method
     const ObjCMethodDecl *OMD = cast<ObjCMethodDecl>(CurFuncDecl);
-    return Runtime.GenerateMessageSendSuper(*this, E,
+    return Runtime.GenerateMessageSendSuper(*this, E->getType(),
+                                            E->getSelector(),
                                             OMD->getClassInterface(),
                                             Receiver,
                                             isClassMessage,
                                             Args);
   }
-  return Runtime.GenerateMessageSend(*this, E, Receiver, isClassMessage, Args);
+  return Runtime.GenerateMessageSend(*this, E->getType(), E->getSelector(), 
+                                     Receiver, isClassMessage, Args);
 }
 
 /// StartObjCMethod - Begin emission of an ObjCMethod. This generates
@@ -234,20 +236,28 @@
     S = cast<ObjCPropertyDecl>(E->getDecl())->getGetterName();
   }
 
-  // FIXME: Improve location information.
-  SourceLocation Loc = E->getLocation();
-  // PropertyRefExprs are always instance messages.
-  // FIXME: Is there any reason to try and pass the method here?
-  ObjCMessageExpr GetExpr(const_cast<Expr*>(E->getBase()), 
-                          S, E->getType(), 0, Loc, Loc,
-                          0, 0);
-
-  return EmitObjCMessageExpr(&GetExpr);
+  return CGM.getObjCRuntime().
+    GenerateMessageSend(*this, E->getType(), S, 
+                        EmitScalarExpr(E->getBase()), 
+                        false, CallArgList());
 }
 
 void CodeGenFunction::EmitObjCPropertySet(const ObjCPropertyRefExpr *E,
                                           RValue Src) {
-  ErrorUnsupported(E, "Objective-C property setter call");
+  Selector S;
+  if (const ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(E->getDecl())) {
+    S = PD->getSetterName();
+  } else {
+    // FIXME: How can we have a method decl here?
+    ErrorUnsupported(E, "Objective-C property setter call");
+    return;
+  }
+
+  CallArgList Args;
+  EmitCallArg(Src, E->getType(), Args);
+  CGM.getObjCRuntime().GenerateMessageSend(*this, getContext().VoidTy, S, 
+                                           EmitScalarExpr(E->getBase()), 
+                                           false, Args);
 }
 
 CGObjCRuntime::~CGObjCRuntime() {}