[cfe-commits] r114209 - in /cfe/trunk: lib/Sema/SemaChecking.cpp test/SemaObjC/exprs.m
Chris Lattner
sabre at nondot.org
Fri Sep 17 14:12:38 PDT 2010
Author: lattner
Date: Fri Sep 17 16:12:38 2010
New Revision: 114209
URL: http://llvm.org/viewvc/llvm-project?rev=114209&view=rev
Log:
fix rdar://8445858 - __sync_* intrinsics erroneously reject ObjC pointers
Modified:
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/test/SemaObjC/exprs.m
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=114209&r1=114208&r2=114209&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Fri Sep 17 16:12:38 2010
@@ -427,7 +427,7 @@
QualType ValType =
FirstArg->getType()->getAs<PointerType>()->getPointeeType();
- if (!ValType->isIntegerType() && !ValType->isPointerType() &&
+ if (!ValType->isIntegerType() && !ValType->isAnyPointerType() &&
!ValType->isBlockPointerType()) {
Diag(DRE->getLocStart(), diag::err_atomic_builtin_must_be_pointer_intptr)
<< FirstArg->getType() << FirstArg->getSourceRange();
Modified: cfe/trunk/test/SemaObjC/exprs.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/exprs.m?rev=114209&r1=114208&r2=114209&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/exprs.m (original)
+++ cfe/trunk/test/SemaObjC/exprs.m Fri Sep 17 16:12:38 2010
@@ -22,3 +22,13 @@
#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
void (^foo)(int, int) = ^(int x, int y) { int z = MAX(x, y); };
+
+
+
+// rdar://8445858
+ at class Object;
+static Object *g;
+void test3(Object *o) {
+ // this is ok.
+ __sync_bool_compare_and_swap(&g, 0, o);
+}
More information about the cfe-commits
mailing list