[llvm-branch-commits] [llvm-gcc-branch] r100335 - in /llvm-gcc-4.2/branches/Apple/Morbo/gcc: objc/ChangeLog.apple objc/objc-act.c testsuite/ChangeLog.apple testsuite/obj-c++.dg/property-getter-codegen.mm

Evan Cheng evan.cheng at apple.com
Sun Apr 4 11:05:20 PDT 2010


Author: evancheng
Date: Sun Apr  4 13:05:20 2010
New Revision: 100335

URL: http://llvm.org/viewvc/llvm-project?rev=100335&view=rev
Log:
Merge: 100330, 100333, 100334.

Modified:
    llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/ChangeLog.apple
    llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/objc-act.c
    llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/ChangeLog.apple
    llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm

Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/ChangeLog.apple?rev=100335&r1=100334&r2=100335&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/ChangeLog.apple (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/ChangeLog.apple Sun Apr  4 13:05:20 2010
@@ -1,3 +1,10 @@
+2010-04-02 Fariborz Jahanian <fjahanian at apple.com>
+
+        Radar 7591784
+	* objc-act.c (objc_build_compound_setter_call): Issue unimplemented 
+        error attempting to use dot-syntax on a RHS which is c++ object
+        requiring construction.
+
 2019-03-17  Jim Grosbach <grosbach at apple.com>
 
         Radar 6671703

Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/objc-act.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/objc-act.c?rev=100335&r1=100334&r2=100335&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/objc-act.c Sun Apr  4 13:05:20 2010
@@ -1983,7 +1983,22 @@
       bind = build3 (BIND_EXPR, void_type_node, temp, NULL, NULL);
       TREE_SIDE_EFFECTS (bind) = 1;
       add_stmt (bind);
+      /* APPLE LOCAL begin radar 7591784 */
+#ifdef OBJCPLUS
+      {
+	tree type = TREE_TYPE (rhs);
+	if (TYPE_NEEDS_CONSTRUCTING (type))
+          {
+	    comma_exp = temp;
+	    error("setting a C++ non-POD object value is not implemented - assign the value to a temporary and use the temporary.");
+	  }
+	else
+      	  comma_exp = build_modify_expr (temp, NOP_EXPR, rhs);
+      }
+#else
       comma_exp = build_modify_expr (temp, NOP_EXPR, rhs);
+#endif
+      /* APPLE LOCAL end radar 7591784 */
       comma_exp = build_compound_expr (comma_exp,
 		    objc_setter_func_call (receiver, prop_ident, temp));
       /* APPLE LOCAL begin radar 6264448 */

Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/ChangeLog.apple?rev=100335&r1=100334&r2=100335&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/ChangeLog.apple (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/ChangeLog.apple Sun Apr  4 13:05:20 2010
@@ -1,3 +1,8 @@
+2010-04-02 Fariborz Jahanian <fjahanian at apple.com>
+
+	Radar 7591784
+	* obj-c++.dg/property-getter-codegen.mm: Modified.
+
 2010-03-18  Jim Grosbach <grosbach at apple.com>
 
         Radar 6671703

Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/obj-c%2B%2B.dg/property-getter-codegen.mm?rev=100335&r1=100334&r2=100335&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm Sun Apr  4 13:05:20 2010
@@ -12,54 +12,54 @@
 
 class Vector3D
 {
-	public:
-		float x, y, z;
-	
-	public:
-		Vector3D();
-		Vector3D(const Vector3D &inVector);
-		Vector3D(float initX, float initY, float initZ);
-		Vector3D &operator=(const Vector3D & rhs);
-		
-		NSString *description();
+        public:
+                float x, y, z;
+        
+        public:
+                Vector3D();
+                Vector3D(const Vector3D &inVector);
+                Vector3D(float initX, float initY, float initZ);
+                Vector3D &operator=(const Vector3D & rhs);
+                
+                NSString *description();
 };
 
 Vector3D::Vector3D()
 {
-	x = y = z = 0;
+        x = y = z = 0;
 }
 
 Vector3D::Vector3D(const Vector3D &inVector)
 {
-	x = inVector.x;
-	y = inVector.y;
-	z = inVector.z;
+        x = inVector.x;
+        y = inVector.y;
+        z = inVector.z;
 }
 
 Vector3D::Vector3D(float initX, float initY, float initZ)
 {
-	x = initX;
-	y = initY;
-	z = initZ;
+        x = initX;
+        y = initY;
+        z = initZ;
 }
 
 Vector3D &Vector3D::operator=(const Vector3D & rhs)
 {
-	x = rhs.x;
-	y = rhs.y;
-	z = rhs.z;
-	
-	return *this;
+        x = rhs.x;
+        y = rhs.y;
+        z = rhs.z;
+        
+        return *this;
 }
 
 NSString *Vector3D::description()
 {
-	return [NSString stringWithFormat: @"(%f, %f, %f)", x, y, z];
+        return [NSString stringWithFormat: @"(%f, %f, %f)", x, y, z];
 }
 
 @interface Object3D : NSObject
 {
-	Vector3D position;
+        Vector3D position;
 }
 
 @property (assign) Vector3D position;
@@ -73,43 +73,47 @@
 
 - (id) init
 {
-	self = [super init];
-	if(self)
-	{
-		position = Vector3D(0, 0, 0);
-	}
-	
-	return self;
+        self = [super init];
+        if(self)
+        {
+                position = Vector3D(0, 0, 0);
+        }
+        
+        return self;
 }
 
 - (void) setPosition: (Vector3D) inPosition
 {
-	position = inPosition;
-	NSLog(@"setPosition was called with the vector %@", inPosition.description());
-	++count;
+        position = inPosition;
+        NSLog(@"setPosition was called with the vector %@", inPosition.description());
+        ++count;
 }
 @end
 
 int main (int argc, const char * argv[]) 
 {
-	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
-	Object3D *myObject = [[Object3D alloc] init];
-	
-	// Each of these looks like it should call the setPosition method.  However,
-	// if the Vector3D copy constructor is defined, this one won't.
-	myObject.position = Vector3D(1.0f, 1.0f, 1.0f);
-	NSLog(@"After assignment the position is: %@", myObject.position.description());
-
-	[myObject setPosition: Vector3D(2.0f, 2.0f, 2.0f)];
-	NSLog(@"After setPosition: the position is: %@", myObject.position.description());
-
-	typedef void (*SetPositionIMP)(id self, SEL _cmd, Vector3D position);
-	((SetPositionIMP)objc_msgSend)(myObject, @selector(setPosition:), Vector3D(3.0f, 3.0f, 3.0f));
-	NSLog(@"After objc_msgSend the position is: %@", myObject.position.description());
+        Object3D *myObject = [[Object3D alloc] init];
+        
+        // Each of these looks like it should call the setPosition method.  However,
+        // if the Vector3D copy constructor is defined, this one won't.
+        // APPLE LOCAL begin radar 7591784
+        // Workaround for bug in radar 7591784
+        Vector3D V3D(1.0f, 1.0f, 1.0f);
+        myObject.position = V3D;
+        // APPLE LOCAL end radar 7591784
+        NSLog(@"After assignment the position is: %@", myObject.position.description());
+
+        [myObject setPosition: Vector3D(2.0f, 2.0f, 2.0f)];
+        NSLog(@"After setPosition: the position is: %@", myObject.position.description());
+
+        typedef void (*SetPositionIMP)(id self, SEL _cmd, Vector3D position);
+        ((SetPositionIMP)objc_msgSend)(myObject, @selector(setPosition:), Vector3D(3.0f, 3.0f, 3.0f));
+        NSLog(@"After objc_msgSend the position is: %@", myObject.position.description());
 
-	[pool release];
+        [pool release];
         if (count != 3)
-	 abort();
+         abort();
         return 0;
 }





More information about the llvm-branch-commits mailing list