[llvm-branch-commits] [cfe-branch] r119243 - in /cfe/branches/Apple/whitney: include/clang/Basic/Builtins.def lib/AST/ASTContext.cpp lib/Sema/SemaLookup.cpp lib/Sema/builtin_objc_msgSend.c test/CodeGenObjC/implicit-objc_msgSend.m test/SemaObjC/builtin_objc_msgSend.m
Daniel Dunbar
daniel at zuster.org
Mon Nov 15 13:45:38 PST 2010
Author: ddunbar
Date: Mon Nov 15 15:45:38 2010
New Revision: 119243
URL: http://llvm.org/viewvc/llvm-project?rev=119243&view=rev
Log:
Merge r118634:
--
Author: Fariborz Jahanian <fjahanian at apple.com>
Date: Tue Nov 9 21:38:20 2010 +0000
Restore patch reversed in r118475. Fixes
// rdar://8632525
Added:
cfe/branches/Apple/whitney/lib/Sema/builtin_objc_msgSend.c
cfe/branches/Apple/whitney/test/SemaObjC/builtin_objc_msgSend.m
Modified:
cfe/branches/Apple/whitney/include/clang/Basic/Builtins.def
cfe/branches/Apple/whitney/lib/AST/ASTContext.cpp
cfe/branches/Apple/whitney/lib/Sema/SemaLookup.cpp
cfe/branches/Apple/whitney/test/CodeGenObjC/implicit-objc_msgSend.m
Modified: cfe/branches/Apple/whitney/include/clang/Basic/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/include/clang/Basic/Builtins.def?rev=119243&r1=119242&r2=119243&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/include/clang/Basic/Builtins.def (original)
+++ cfe/branches/Apple/whitney/include/clang/Basic/Builtins.def Mon Nov 15 15:45:38 2010
@@ -29,6 +29,8 @@
// d -> double
// z -> size_t
// F -> constant CFString
+// G -> id
+// H -> SEL
// a -> __builtin_va_list
// A -> "reference" to __builtin_va_list
// V -> Vector, following num elements and a base type.
@@ -559,11 +561,8 @@
// POSIX setjmp.h
LIBBUILTIN(_longjmp, "vJi", "fr", "setjmp.h")
LIBBUILTIN(siglongjmp, "vSJi", "fr", "setjmp.h")
-
-// FIXME: This type isn't very correct, it should be
-// id objc_msgSend(id, SEL)
-// but we need new type letters for that.
-LIBBUILTIN(objc_msgSend, "v*.", "f", "objc/message.h")
+// id objc_msgSend(id, SEL, ...)
+LIBBUILTIN(objc_msgSend, "GGH.", "f", "objc/message.h")
BUILTIN(__builtin_objc_memmove_collectable, "v*v*vC*z", "nF")
// Builtin math library functions
Modified: cfe/branches/Apple/whitney/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/AST/ASTContext.cpp?rev=119243&r1=119242&r2=119243&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/AST/ASTContext.cpp (original)
+++ cfe/branches/Apple/whitney/lib/AST/ASTContext.cpp Mon Nov 15 15:45:38 2010
@@ -5372,6 +5372,12 @@
case 'F':
Type = Context.getCFConstantStringType();
break;
+ case 'G':
+ Type = Context.getObjCIdType();
+ break;
+ case 'H':
+ Type = Context.getObjCSelType();
+ break;
case 'a':
Type = Context.getBuiltinVaListType();
assert(!Type.isNull() && "builtin va list type not initialized!");
Modified: cfe/branches/Apple/whitney/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Sema/SemaLookup.cpp?rev=119243&r1=119242&r2=119243&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Sema/SemaLookup.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Sema/SemaLookup.cpp Mon Nov 15 15:45:38 2010
@@ -484,6 +484,11 @@
if (S.getLangOptions().CPlusPlus &&
S.Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID))
return false;
+ // When not in Objective-C mode, there is no builtin 'id' type.
+ // We won't have pre-defined library functions which use this type.
+ if (!S.getLangOptions().ObjC1 &&
+ S.Context.BuiltinInfo.GetTypeString(BuiltinID)[0] == 'G')
+ return false;
NamedDecl *D = S.LazilyCreateBuiltin((IdentifierInfo *)II, BuiltinID,
S.TUScope, R.isForRedeclaration(),
Added: cfe/branches/Apple/whitney/lib/Sema/builtin_objc_msgSend.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Sema/builtin_objc_msgSend.c?rev=119243&view=auto
==============================================================================
--- cfe/branches/Apple/whitney/lib/Sema/builtin_objc_msgSend.c (added)
+++ cfe/branches/Apple/whitney/lib/Sema/builtin_objc_msgSend.c Mon Nov 15 15:45:38 2010
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify
+// rdar://8632525
+
+typedef struct objc_class *Class;
+typedef struct objc_object {
+ Class isa;
+} *id;
+
+
+typedef struct objc_selector *SEL;
+extern id objc_msgSend(id self, SEL op, ...);
+
Modified: cfe/branches/Apple/whitney/test/CodeGenObjC/implicit-objc_msgSend.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/CodeGenObjC/implicit-objc_msgSend.m?rev=119243&r1=119242&r2=119243&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/test/CodeGenObjC/implicit-objc_msgSend.m (original)
+++ cfe/branches/Apple/whitney/test/CodeGenObjC/implicit-objc_msgSend.m Mon Nov 15 15:45:38 2010
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o %t %s
-// RUN: grep -F 'declare i8* @objc_msgSend(...)' %t
+// RUN: grep -F 'declare i8* @objc_msgSend(i8*, i8*, ...)' %t
typedef struct objc_selector *SEL;
id f0(id x, SEL s) {
Added: cfe/branches/Apple/whitney/test/SemaObjC/builtin_objc_msgSend.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/SemaObjC/builtin_objc_msgSend.m?rev=119243&view=auto
==============================================================================
--- cfe/branches/Apple/whitney/test/SemaObjC/builtin_objc_msgSend.m (added)
+++ cfe/branches/Apple/whitney/test/SemaObjC/builtin_objc_msgSend.m Mon Nov 15 15:45:38 2010
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify
+// rdar://8632525
+extern id objc_msgSend(id self, SEL op, ...);
More information about the llvm-branch-commits
mailing list