aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-17 08:07:16 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-17 08:07:16 +0000
commit77544fde702fdab2a6150ba812ecf04eb1e6eab6 (patch)
tree25497ec27d4f0d5403fdd6af598f72c2465adaa1
parent243fde9f549a8f5f000c4baccb572dd0b7266a41 (diff)
Add driver::types::isObjC predicate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89064 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Driver/Types.h3
-rw-r--r--lib/Driver/Types.cpp13
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: