diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-03-08 21:17:29 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-03-08 21:17:29 +0000 |
commit | ad6eff611a4391f89fd6c458db16993f76e7f5d0 (patch) | |
tree | 00b5e9d4d775fc3ec687dc92621984025646c9e9 | |
parent | b35baae19b906245b5c2266b47ef411abcc6b25a (diff) |
Implement clang_isUnexposed(), a predicate function to simplify filtering out
unexposed AST elements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97985 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang-c/Index.h | 6 | ||||
-rw-r--r-- | tools/CIndex/CIndex.cpp | 12 | ||||
-rw-r--r-- | tools/CIndex/CIndex.exports | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 7bc290d88f..da186f6424 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -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. */ diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 6fff183043..b52a32ed9b 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -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; } diff --git a/tools/CIndex/CIndex.exports b/tools/CIndex/CIndex.exports index e68060b27d..5b9530052b 100644 --- a/tools/CIndex/CIndex.exports +++ b/tools/CIndex/CIndex.exports @@ -67,6 +67,7 @@ _clang_isInvalid _clang_isReference _clang_isStatement _clang_isTranslationUnit +_clang_isUnexposed _clang_setUseExternalASTGeneration _clang_tokenize _clang_visitChildren |