[llvm-branch-commits] [cfe-branch] r121548 - in /cfe/branches/Apple/whitney: include/clang/Basic/Builtins.def include/clang/Basic/Builtins.h test/SemaObjC/builtin_objc_getClass.m

Daniel Dunbar daniel at zuster.org
Fri Dec 10 13:37:27 PST 2010


Author: ddunbar
Date: Fri Dec 10 15:37:27 2010
New Revision: 121548

URL: http://llvm.org/viewvc/llvm-project?rev=121548&view=rev
Log:
Merge r120437:
--
Author: Fariborz Jahanian <fjahanian at apple.com>
Date:   Tue Nov 30 18:25:34 2010 +0000

    Add objc_getClass as an objc builtin function
    (// rdar://8592641). Also rename LANGUAGEID to
    LanguageID.

Added:
    cfe/branches/Apple/whitney/test/SemaObjC/builtin_objc_getClass.m
Modified:
    cfe/branches/Apple/whitney/include/clang/Basic/Builtins.def
    cfe/branches/Apple/whitney/include/clang/Basic/Builtins.h

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=121548&r1=121547&r2=121548&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/include/clang/Basic/Builtins.def (original)
+++ cfe/branches/Apple/whitney/include/clang/Basic/Builtins.def Fri Dec 10 15:37:27 2010
@@ -563,6 +563,8 @@
 LIBBUILTIN(siglongjmp, "vSJi",    "fr",    "setjmp.h", ALL_LANGUAGES)
 //   id objc_msgSend(id, SEL, ...)
 LIBBUILTIN(objc_msgSend, "GGH.",   "f",     "objc/message.h", OBJC_LANG)
+//   id objc_getClass(const char *name)
+LIBBUILTIN(objc_getClass, "GcC*",   "f",     "objc/runtime.h", OBJC_LANG)
 BUILTIN(__builtin_objc_memmove_collectable, "v*v*vC*z", "nF")
 
 // Builtin math library functions

Modified: cfe/branches/Apple/whitney/include/clang/Basic/Builtins.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/include/clang/Basic/Builtins.h?rev=121548&r1=121547&r2=121548&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/include/clang/Basic/Builtins.h (original)
+++ cfe/branches/Apple/whitney/include/clang/Basic/Builtins.h Fri Dec 10 15:37:27 2010
@@ -32,7 +32,7 @@
   class QualType;
   class LangOptions;
   
-  enum LANGUAGEID {
+  enum LanguageID {
     C_LANG = 0x1,     // builtin for c only.
     CXX_LANG = 0x2,   // builtin for cplusplus only.
     OBJC_LANG = 0x4,  // builtin for objective-c and objective-c++
@@ -49,7 +49,7 @@
 
 struct Info {
   const char *Name, *Type, *Attributes, *HeaderName;
-  LANGUAGEID builtin_lang;
+  LanguageID builtin_lang;
   bool Suppressed;
 
   bool operator==(const Info &RHS) const {

Added: cfe/branches/Apple/whitney/test/SemaObjC/builtin_objc_getClass.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/SemaObjC/builtin_objc_getClass.m?rev=121548&view=auto
==============================================================================
--- cfe/branches/Apple/whitney/test/SemaObjC/builtin_objc_getClass.m (added)
+++ cfe/branches/Apple/whitney/test/SemaObjC/builtin_objc_getClass.m Fri Dec 10 15:37:27 2010
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 %s -fsyntax-only -std=gnu99 -verify
+// rdar://8592641
+Class f0() { return objc_getClass("a"); } // expected-warning {{implicitly declaring C library function 'objc_getClass' with type 'id (const char *)'}} \
+					  // expected-note {{please include the header <objc/runtime.h> or explicitly provide a declaration for 'objc_getClass'}}





More information about the llvm-branch-commits mailing list