[cfe-commits] r97985 - in /cfe/trunk: include/clang-c/Index.h tools/CIndex/CIndex.cpp tools/CIndex/CIndex.exports

Ted Kremenek kremenek at apple.com
Mon Mar 8 13:17:29 PST 2010


Author: kremenek
Date: Mon Mar  8 15:17:29 2010
New Revision: 97985

URL: http://llvm.org/viewvc/llvm-project?rev=97985&view=rev
Log:
Implement clang_isUnexposed(), a predicate function to simplify filtering out
unexposed AST elements.

Modified:
    cfe/trunk/include/clang-c/Index.h
    cfe/trunk/tools/CIndex/CIndex.cpp
    cfe/trunk/tools/CIndex/CIndex.exports

Modified: cfe/trunk/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=97985&r1=97984&r2=97985&view=diff
==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Mon Mar  8 15:17:29 2010
@@ -888,6 +888,12 @@
  */
 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.
  */

Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=97985&r1=97984&r2=97985&view=diff
==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Mon Mar  8 15:17:29 2010
@@ -1589,6 +1589,18 @@
   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;
 }

Modified: cfe/trunk/tools/CIndex/CIndex.exports
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.exports?rev=97985&r1=97984&r2=97985&view=diff
==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.exports (original)
+++ cfe/trunk/tools/CIndex/CIndex.exports Mon Mar  8 15:17:29 2010
@@ -67,6 +67,7 @@
 _clang_isReference
 _clang_isStatement
 _clang_isTranslationUnit
+_clang_isUnexposed
 _clang_setUseExternalASTGeneration
 _clang_tokenize
 _clang_visitChildren





More information about the cfe-commits mailing list