summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-08-23 23:33:09 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-08-23 23:33:09 +0000
commit73952fc263aa60b84bcf30adc23d798464de07bc (patch)
tree34f5151e2a71255dda5ba11345f44bdcf4623ad1
parent7a98a7e681a309a7148baddfbd5508ac79b24833 (diff)
downloadbcm5719-llvm-73952fc263aa60b84bcf30adc23d798464de07bc.tar.gz
bcm5719-llvm-73952fc263aa60b84bcf30adc23d798464de07bc.zip
objc - fix up the builtin type for objc_assign_ivar.
// rdar://9362887. llvm-svn: 138412
-rw-r--r--clang/include/clang/Basic/Builtins.def4
-rw-r--r--clang/lib/AST/ASTContext.cpp6
-rw-r--r--clang/test/SemaObjC/builtin_objc_assign_ivar.m6
3 files changed, 13 insertions, 3 deletions
diff --git a/clang/include/clang/Basic/Builtins.def b/clang/include/clang/Basic/Builtins.def
index f45ca4458f6..d12a04d8f10 100644
--- a/clang/include/clang/Basic/Builtins.def
+++ b/clang/include/clang/Basic/Builtins.def
@@ -35,6 +35,7 @@
// A -> "reference" to __builtin_va_list
// V -> Vector, following num elements and a base type.
// X -> _Complex, followed by the base type.
+// Y -> ptrdiff_t
// P -> FILE
// J -> jmp_buf
// SJ -> sigjmp_buf
@@ -690,8 +691,7 @@ LIBBUILTIN(objc_read_weak, "GG*", "f", "/objc/objc-auto.h", OBJC_LANG)
// id objc_assign_weak(id value, id *location)
LIBBUILTIN(objc_assign_weak, "GGG*", "f", "/objc/objc-auto.h", OBJC_LANG)
// id objc_assign_ivar(id value, id dest, ptrdiff_t offset)
-// FIXME. Darwin has ptrdiff_t typedef'ed to int.
-LIBBUILTIN(objc_assign_ivar, "GGGi", "f", "/objc/objc-auto.h", OBJC_LANG)
+LIBBUILTIN(objc_assign_ivar, "GGGY", "f", "/objc/objc-auto.h", OBJC_LANG)
// id objc_assign_global(id val, id *dest)
LIBBUILTIN(objc_assign_global, "GGG*", "f", "/objc/objc-auto.h", OBJC_LANG)
// id objc_assign_strongCast(id val, id *dest
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 1b2c5cf4187..75a573e301b 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -6140,7 +6140,11 @@ static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context,
assert(!RequiresICE && "Can't require complex ICE");
Type = Context.getComplexType(ElementType);
break;
- }
+ }
+ case 'Y' : {
+ Type = Context.getPointerDiffType();
+ break;
+ }
case 'P':
Type = Context.getFILEType();
if (Type.isNull()) {
diff --git a/clang/test/SemaObjC/builtin_objc_assign_ivar.m b/clang/test/SemaObjC/builtin_objc_assign_ivar.m
new file mode 100644
index 00000000000..5839bf44441
--- /dev/null
+++ b/clang/test/SemaObjC/builtin_objc_assign_ivar.m
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -x objective-c %s -fsyntax-only -verify
+// rdar://9362887
+
+typedef __typeof__(((int*)0)-((int*)0)) ptrdiff_t;
+extern id objc_assign_ivar(id value, id dest, ptrdiff_t offset);
+
OpenPOWER on IntegriCloud