[cfe-commits] r69874 - in /cfe/trunk: include/clang/AST/Builtins.def test/CodeGenObjC/implicit-objc_msgSend.m
Daniel Dunbar
daniel at zuster.org
Thu Apr 23 00:00:11 PDT 2009
Author: ddunbar
Date: Thu Apr 23 02:00:09 2009
New Revision: 69874
URL: http://llvm.org/viewvc/llvm-project?rev=69874&view=rev
Log:
Add implicit definition of objc_msgSend.
- As with malloc and friends, this is important where the return type
on a 64-bit platform would otherwise end up discarding the upper
32-bits.
Added:
cfe/trunk/test/CodeGenObjC/implicit-objc_msgSend.m
Modified:
cfe/trunk/include/clang/AST/Builtins.def
Modified: cfe/trunk/include/clang/AST/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Builtins.def?rev=69874&r1=69873&r2=69874&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Builtins.def (original)
+++ cfe/trunk/include/clang/AST/Builtins.def Thu Apr 23 02:00:09 2009
@@ -249,6 +249,11 @@
LIBBUILTIN(vsnprintf, "ic*zcC*a", "fP:2:", "stdio.h")
LIBBUILTIN(vsprintf, "ic*cC*a", "fP:1:", "stdio.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")
+
// FIXME: asprintf and vasprintf aren't C99 functions. Should they be
// target-specific builtins, perhaps?
Added: cfe/trunk/test/CodeGenObjC/implicit-objc_msgSend.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/implicit-objc_msgSend.m?rev=69874&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/implicit-objc_msgSend.m (added)
+++ cfe/trunk/test/CodeGenObjC/implicit-objc_msgSend.m Thu Apr 23 02:00:09 2009
@@ -0,0 +1,7 @@
+// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s &&
+// RUN: grep -F 'declare i8* @objc_msgSend(...)' %t
+
+typedef struct objc_selector *SEL;
+id f0(id x, SEL s) {
+ return objc_msgSend(x, s);
+}
More information about the cfe-commits
mailing list