[cfe-commits] r142236 - in /cfe/trunk: lib/Sema/SemaExprObjC.cpp test/CodeGenObjC/arc-property.m
John McCall
rjmccall at apple.com
Mon Oct 17 13:05:43 PDT 2011
Author: rjmccall
Date: Mon Oct 17 15:05:43 2011
New Revision: 142236
URL: http://llvm.org/viewvc/llvm-project?rev=142236&view=rev
Log:
Strip qualifiers off the type of an implicit property defined by
only a setter.
Added:
cfe/trunk/test/CodeGenObjC/arc-property.m
Modified:
cfe/trunk/lib/Sema/SemaExprObjC.cpp
Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=142236&r1=142235&r2=142236&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Mon Oct 17 15:05:43 2011
@@ -673,7 +673,7 @@
PType = getMessageSendResultType(QualType(OPT, 0), Getter, false, Super);
else {
ParmVarDecl *ArgDecl = *Setter->param_begin();
- PType = ArgDecl->getType();
+ PType = ArgDecl->getType().getUnqualifiedType(); // can't be an array
}
ExprValueKind VK = VK_LValue;
Added: cfe/trunk/test/CodeGenObjC/arc-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-property.m?rev=142236&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-property.m (added)
+++ cfe/trunk/test/CodeGenObjC/arc-property.m Mon Oct 17 15:05:43 2011
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-arc -emit-llvm %s -o - | FileCheck %s
+
+// rdar://problem/10290317
+ at interface Test0
+- (void) setValue: (id) x;
+ at end
+void test0(Test0 *t0, id value) {
+ t0.value = value;
+}
+// CHECK: define void @test0(
+// CHECK: call i8* @objc_retain(
+// CHECK: call i8* @objc_retain(
+// CHECK: @objc_msgSend
+// CHECK: call void @objc_release(
+// CHECK: call void @objc_release(
More information about the cfe-commits
mailing list