[llvm-branch-commits] [cfe-branch] r119827 - in /cfe/branches/Apple/whitney: lib/Sema/SemaExpr.cpp test/SemaCXX/builtin_objc_msgSend.cpp
Daniel Dunbar
daniel at zuster.org
Fri Nov 19 11:49:54 PST 2010
Author: ddunbar
Date: Fri Nov 19 13:49:53 2010
New Revision: 119827
URL: http://llvm.org/viewvc/llvm-project?rev=119827&view=rev
Log:
Merge r119813:
--
Author: Fariborz Jahanian <fjahanian at apple.com>
Date: Fri Nov 19 18:16:46 2010 +0000
objc_msgSend is not a builtin type in non-objc mode.
Fixes //rdar://8686888
Added:
cfe/branches/Apple/whitney/test/SemaCXX/builtin_objc_msgSend.cpp
Modified:
cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp
Modified: cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp?rev=119827&r1=119826&r2=119827&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp Fri Nov 19 13:49:53 2010
@@ -3912,8 +3912,13 @@
if (CheckFunctionCall(FDecl, TheCall))
return ExprError();
- if (unsigned BuiltinID = FDecl->getBuiltinID())
- return CheckBuiltinFunctionCall(BuiltinID, TheCall);
+ if (unsigned BuiltinID = FDecl->getBuiltinID()) {
+ // 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 (getLangOptions().ObjC1 ||
+ Context.BuiltinInfo.GetTypeString(BuiltinID)[0] != 'G')
+ return CheckBuiltinFunctionCall(BuiltinID, TheCall);
+ }
} else if (NDecl) {
if (CheckBlockCall(NDecl, TheCall))
return ExprError();
Added: cfe/branches/Apple/whitney/test/SemaCXX/builtin_objc_msgSend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/SemaCXX/builtin_objc_msgSend.cpp?rev=119827&view=auto
==============================================================================
--- cfe/branches/Apple/whitney/test/SemaCXX/builtin_objc_msgSend.cpp (added)
+++ cfe/branches/Apple/whitney/test/SemaCXX/builtin_objc_msgSend.cpp Fri Nov 19 13:49:53 2010
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify
+// rdar://8686888
+
+typedef struct objc_selector *SEL;
+typedef struct objc_object *id;
+
+extern "C" __attribute__((visibility("default"))) id objc_msgSend(id self, SEL op, ...)
+ __attribute__((visibility("default")));
+
+inline void TCFReleaseGC(void * object)
+{
+ static SEL SEL_release;
+ objc_msgSend((id)object, SEL_release);
+}
More information about the llvm-branch-commits
mailing list