diff options
-rw-r--r-- | include/clang/AST/Builtins.def | 5 | ||||
-rw-r--r-- | test/CodeGenObjC/implicit-objc_msgSend.m | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/clang/AST/Builtins.def b/include/clang/AST/Builtins.def index 766cb1143d..ca1a9d04b1 100644 --- a/include/clang/AST/Builtins.def +++ b/include/clang/AST/Builtins.def @@ -249,6 +249,11 @@ LIBBUILTIN(vfprintf, "iP*cC*a", "fP:1:", "stdio.h") 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? diff --git a/test/CodeGenObjC/implicit-objc_msgSend.m b/test/CodeGenObjC/implicit-objc_msgSend.m new file mode 100644 index 0000000000..4511cca338 --- /dev/null +++ b/test/CodeGenObjC/implicit-objc_msgSend.m @@ -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); +} |