Fix PR 1654.

llvm-svn: 43769
diff --git a/llvm-gcc-4.2/gcc/objc/objc-act.c b/llvm-gcc-4.2/gcc/objc/objc-act.c
index 2fc52bc..4b50d44 100644
--- a/llvm-gcc-4.2/gcc/objc/objc-act.c
+++ b/llvm-gcc-4.2/gcc/objc/objc-act.c
@@ -13048,13 +13048,8 @@
 	      && TREE_TYPE (receiver) == objc_class_type))
 	check_for_nil = false;
 
-      if (!targetm.calls.struct_value_rtx (0, 0)
-          && (TREE_CODE (ret_type) == RECORD_TYPE 
-       	      || TREE_CODE (ret_type) == UNION_TYPE)
-          /* APPLE LOCAL begin radar 5080710 */
-          && (TREE_ADDRESSABLE (ret_type)
-              || targetm.calls.return_in_memory (ret_type, 0)))
-          /* APPLE LOCAL end radar 5080710 */
+      /* LLVM LOCAL pr 1654 */
+      if (aggregate_value_p (ret_type, 0))
 	{
 	  if (super)
 	    message_func_decl = umsg_id_super2_stret_fixup_decl;
@@ -13188,13 +13183,8 @@
 	 argument, then change which messenger entry point this
 	 expr will call.  NB: Note that sender_cast remains
 	 unchanged (it already has a struct return type).  */
-      if (!targetm.calls.struct_value_rtx (0, 0)
-	  && (TREE_CODE (ret_type) == RECORD_TYPE
-	      || TREE_CODE (ret_type) == UNION_TYPE)
-          /* APPLE LOCAL begin radar 5080710 */
-          && (TREE_ADDRESSABLE (ret_type)
-              || targetm.calls.return_in_memory (ret_type, 0)))
-          /* APPLE LOCAL end radar 5080710 */
+      /* LLVM LOCAL pr 1654 */
+      if (aggregate_value_p (ret_type, 0))
 	sender = (super_flag ? umsg_super_stret_decl :
 		flag_nil_receivers ? umsg_stret_decl : umsg_nonnil_stret_decl);
       /* APPLE LOCAL begin radar 4280641 */