Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79365 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 6b597d1..a7cae8a 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2342,13 +2342,11 @@
 
         if (Getter)
           PType = Getter->getResultType();
-        else {
-          for (ObjCMethodDecl::param_iterator PI = Setter->param_begin(),
-               E = Setter->param_end(); PI != E; ++PI)
-            PType = (*PI)->getType();
-        }
+        else
+          // Get the expression type from Setter's incoming parameter.
+          PType = (*(Setter->param_end() -1))->getType();
         // FIXME: we must check that the setter has property type.
-        return Owned(new (Context) ObjCKVCRefExpr(Getter, PType,
+        return Owned(new (Context) ObjCImplctSetterGetterRefExpr(Getter, PType,
                                         Setter, MemberLoc, BaseExpr));
       }
       return ExprError(Diag(MemberLoc, diag::err_property_not_found)
@@ -2535,13 +2533,11 @@
 
       if (Getter)
         PType = Getter->getResultType();
-      else {
-        for (ObjCMethodDecl::param_iterator PI = Setter->param_begin(),
-             E = Setter->param_end(); PI != E; ++PI)
-          PType = (*PI)->getType();
-      }
+      else
+        // Get the expression type from Setter's incoming parameter.
+        PType = (*(Setter->param_end() -1))->getType();
       // FIXME: we must check that the setter has property type.
-      return Owned(new (Context) ObjCKVCRefExpr(Getter, PType,
+      return Owned(new (Context) ObjCImplctSetterGetterRefExpr(Getter, PType,
                                       Setter, MemberLoc, BaseExpr));
     }
     return ExprError(Diag(MemberLoc, diag::err_property_not_found)