[cfe-commits] r103887 - in /cfe/trunk: lib/CodeGen/CGExprCXX.cpp test/CodeGenObjCXX/property-objects.mm

Fariborz Jahanian fjahanian at apple.com
Sat May 15 16:05:52 PDT 2010


Author: fjahanian
Date: Sat May 15 18:05:52 2010
New Revision: 103887

URL: http://llvm.org/viewvc/llvm-project?rev=103887&view=rev
Log:
Fix API gen for objc_msgSend property of aggregate types
in Objective-c++ mode. Fixes radar 7986354.


Modified:
    cfe/trunk/lib/CodeGen/CGExprCXX.cpp
    cfe/trunk/test/CodeGenObjCXX/property-objects.mm

Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=103887&r1=103886&r2=103887&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Sat May 15 18:05:52 2010
@@ -264,9 +264,11 @@
       LValue LV = EmitLValue(E->getArg(0));
       llvm::Value *This;
       if (LV.isPropertyRef()) {
-        RValue RV = EmitLoadOfPropertyRefLValue(LV, E->getArg(0)->getType());
-        assert (!RV.isScalar() && "EmitCXXOperatorMemberCallExpr");
-        This = RV.getAggregateAddr();
+        llvm::Value *AggLoc  = CreateMemTemp(E->getArg(0)->getType());
+        EmitAggExpr(E->getArg(1), AggLoc, false /*VolatileDest*/);
+        EmitObjCPropertySet(LV.getPropertyRefExpr(),
+                            RValue::getAggregate(AggLoc, false /*VolatileDest*/));
+        return RValue::getAggregate(0, false);
       }
       else
         This = LV.getAddress();
@@ -285,9 +287,11 @@
   LValue LV = EmitLValue(E->getArg(0));
   llvm::Value *This;
   if (LV.isPropertyRef()) {
-    RValue RV = EmitLoadOfPropertyRefLValue(LV, E->getArg(0)->getType());
-    assert (!RV.isScalar() && "EmitCXXOperatorMemberCallExpr");
-    This = RV.getAggregateAddr();
+    llvm::Value *AggLoc  = CreateMemTemp(E->getArg(0)->getType());
+    EmitAggExpr(E->getArg(1), AggLoc, false /*VolatileDest*/);
+    EmitObjCPropertySet(LV.getPropertyRefExpr(),
+                        RValue::getAggregate(AggLoc, false /*VolatileDest*/));
+    return RValue::getAggregate(0, false);
   }
   else
     This = LV.getAddress();

Modified: cfe/trunk/test/CodeGenObjCXX/property-objects.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/property-objects.mm?rev=103887&r1=103886&r2=103887&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/property-objects.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/property-objects.mm Sat May 15 18:05:52 2010
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o - | FileCheck %s
+// CHECK-NOT: callq	_objc_msgSend_stret
 // CHECK: call void @_ZN1SC1ERKS_
 // CHECK: call %class.S* @_ZN1SaSERKS_
 // CHECK: call %class.S* @_ZN6CGRectaSERKS_
@@ -20,15 +21,24 @@
 }
 @property(assign, nonatomic) S position;
 @property CGRect bounds;
+ at property CGRect frame;
+- (void)setFrame:(CGRect)frameRect;
+- (CGRect)frame;
 - (void) initWithOwner;
 @end
 
 @implementation I
 @synthesize position;
 @synthesize bounds;
+ at synthesize frame;
+- (void)setFrame:(CGRect)frameRect {}
+- (CGRect)frame {return bounds;}
+
 - (void)initWithOwner {
+  I* _labelLayer;
   CGRect labelLayerFrame = self.bounds;
   labelLayerFrame = self.bounds;
+  _labelLayer.frame = labelLayerFrame;
 }
 @end
 





More information about the cfe-commits mailing list