[cfe-commits] r89064 - in /cfe/trunk: include/clang/Driver/Types.h lib/Driver/Types.cpp

Daniel Dunbar daniel at zuster.org
Tue Nov 17 00:07:17 PST 2009


Author: ddunbar
Date: Tue Nov 17 02:07:16 2009
New Revision: 89064

URL: http://llvm.org/viewvc/llvm-project?rev=89064&view=rev
Log:
Add driver::types::isObjC predicate.

Modified:
    cfe/trunk/include/clang/Driver/Types.h
    cfe/trunk/lib/Driver/Types.cpp

Modified: cfe/trunk/include/clang/Driver/Types.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Types.h?rev=89064&r1=89063&r2=89064&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/Types.h (original)
+++ cfe/trunk/include/clang/Driver/Types.h Tue Nov 17 02:07:16 2009
@@ -62,6 +62,9 @@
   /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
   bool isCXX(ID Id);
 
+  /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
+  bool isObjC(ID Id);
+
   /// lookupTypeForExtension - Lookup the type to use for the file
   /// extension \arg Ext.
   ID lookupTypeForExtension(const char *Ext);

Modified: cfe/trunk/lib/Driver/Types.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Types.cpp?rev=89064&r1=89063&r2=89064&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Types.cpp (original)
+++ cfe/trunk/lib/Driver/Types.cpp Tue Nov 17 02:07:16 2009
@@ -89,6 +89,19 @@
   }
 }
 
+bool types::isObjC(ID Id) {
+  switch (Id) {
+  default:
+    return false;
+
+  case TY_ObjC: case TY_PP_ObjC:
+  case TY_ObjCXX: case TY_PP_ObjCXX:
+  case TY_ObjCHeader: case TY_PP_ObjCHeader:
+  case TY_ObjCXXHeader: case TY_PP_ObjCXXHeader:
+    return true;
+  }
+}
+
 bool types::isCXX(ID Id) {
   switch (Id) {
   default:





More information about the cfe-commits mailing list