[cfe-commits] r138412 - in /cfe/trunk: include/clang/Basic/Builtins.def lib/AST/ASTContext.cpp test/SemaObjC/builtin_objc_assign_ivar.m

Fariborz Jahanian fjahanian at apple.com
Tue Aug 23 16:33:09 PDT 2011


Author: fjahanian
Date: Tue Aug 23 18:33:09 2011
New Revision: 138412

URL: http://llvm.org/viewvc/llvm-project?rev=138412&view=rev
Log:
objc - fix up the builtin type for objc_assign_ivar.
// rdar://9362887.

Added:
    cfe/trunk/test/SemaObjC/builtin_objc_assign_ivar.m
Modified:
    cfe/trunk/include/clang/Basic/Builtins.def
    cfe/trunk/lib/AST/ASTContext.cpp

Modified: cfe/trunk/include/clang/Basic/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def?rev=138412&r1=138411&r2=138412&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Builtins.def (original)
+++ cfe/trunk/include/clang/Basic/Builtins.def Tue Aug 23 18:33:09 2011
@@ -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 @@
 // 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

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=138412&r1=138411&r2=138412&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue Aug 23 18:33:09 2011
@@ -6140,7 +6140,11 @@
     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()) {

Added: cfe/trunk/test/SemaObjC/builtin_objc_assign_ivar.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/builtin_objc_assign_ivar.m?rev=138412&view=auto
==============================================================================
--- cfe/trunk/test/SemaObjC/builtin_objc_assign_ivar.m (added)
+++ cfe/trunk/test/SemaObjC/builtin_objc_assign_ivar.m Tue Aug 23 18:33:09 2011
@@ -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);
+





More information about the cfe-commits mailing list