]> granicus.if.org Git - clang/commitdiff
Implement clang_isUnexposed(), a predicate function to simplify filtering out
authorTed Kremenek <kremenek@apple.com>
Mon, 8 Mar 2010 21:17:29 +0000 (21:17 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 8 Mar 2010 21:17:29 +0000 (21:17 +0000)
unexposed AST elements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97985 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang-c/Index.h
tools/CIndex/CIndex.cpp
tools/CIndex/CIndex.exports

index 7bc290d88f4ef8194bf9314d55d069d2df39faee..da186f6424de95c115193474fb32ed0352393046 100644 (file)
@@ -888,6 +888,12 @@ CINDEX_LINKAGE unsigned clang_isInvalid(enum CXCursorKind);
  */
 CINDEX_LINKAGE unsigned clang_isTranslationUnit(enum CXCursorKind);
 
+/***
+ * \brief Determine whether the given cursor represents a currently
+ *  unexposed piece of the AST (e.g., CXCursor_UnexposedStmt).
+ */
+CINDEX_LINKAGE unsigned clang_isUnexposed(enum CXCursorKind);
+
 /**
  * \brief Describe the linkage of the entity referred to by a cursor.
  */
index 6fff18304386397f2566525c9856106592fb23ce..b52a32ed9b5183c84c555d19a3123170665e0a9e 100644 (file)
@@ -1589,6 +1589,18 @@ unsigned clang_isTranslationUnit(enum CXCursorKind K) {
   return K == CXCursor_TranslationUnit;
 }
 
+unsigned clang_isUnexposed(enum CXCursorKind K) {
+  switch (K) {
+    case CXCursor_UnexposedDecl:
+    case CXCursor_UnexposedExpr:
+    case CXCursor_UnexposedStmt:
+    case CXCursor_UnexposedAttr:
+      return true;
+    default:
+      return false;
+  }
+}
+
 CXCursorKind clang_getCursorKind(CXCursor C) {
   return C.kind;
 }
index e68060b27de23084fdbcb4e8da1d0d13d6cc89a3..5b9530052b512bc501794af22a4341e61f8be7fc 100644 (file)
@@ -67,6 +67,7 @@ _clang_isInvalid
 _clang_isReference
 _clang_isStatement
 _clang_isTranslationUnit
+_clang_isUnexposed
 _clang_setUseExternalASTGeneration
 _clang_tokenize
 _clang_visitChildren