diff options
-rw-r--r-- | include/clang/Driver/Types.h | 3 | ||||
-rw-r--r-- | lib/Driver/Types.cpp | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/clang/Driver/Types.h b/include/clang/Driver/Types.h index 92520a77b3..3a343b385e 100644 --- a/include/clang/Driver/Types.h +++ b/include/clang/Driver/Types.h @@ -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); diff --git a/lib/Driver/Types.cpp b/lib/Driver/Types.cpp index c616c6a5bf..30893e7cc0 100644 --- a/lib/Driver/Types.cpp +++ b/lib/Driver/Types.cpp @@ -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: |