]> granicus.if.org Git - clang/commitdiff
Add driver::types::isObjC predicate.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 17 Nov 2009 08:07:16 +0000 (08:07 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 17 Nov 2009 08:07:16 +0000 (08:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89064 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Types.h
lib/Driver/Types.cpp

index 92520a77b33bcf571659e01cbff96a3a599d9e5d..3a343b385e7a687a636551fa92f1477984961572 100644 (file)
@@ -62,6 +62,9 @@ namespace types {
   /// 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);
index c616c6a5bf4bc5a825238f1414df70b0c0206039..30893e7cc0ccd4e2295d1ea866ec005e05ecbead 100644 (file)
@@ -89,6 +89,19 @@ bool types::isAcceptedByClang(ID Id) {
   }
 }
 
+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: