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

Ted Kremenek kremenek at apple.com
Tue Nov 17 11:28:59 PST 2009


Author: kremenek
Date: Tue Nov 17 13:28:59 2009
New Revision: 89131

URL: http://llvm.org/viewvc/llvm-project?rev=89131&view=rev
Log:
Add clang_getNullCursor() and clang_equalCursors() (the latter for comparing cursors).

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=89131&r1=89130&r2=89131&view=diff

==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Tue Nov 17 13:28:59 2009
@@ -294,6 +294,8 @@
  */
 CINDEX_LINKAGE CXCursor clang_getCursor(CXTranslationUnit, const char *source_name, 
                          unsigned line, unsigned column);
+                         
+CINDEX_LINKAGE CXCursor clang_getNullCursor(void);
 
 CINDEX_LINKAGE enum CXCursorKind clang_getCursorKind(CXCursor);
 CINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind);
@@ -301,6 +303,8 @@
 CINDEX_LINKAGE unsigned clang_isDefinition(enum CXCursorKind);
 CINDEX_LINKAGE unsigned clang_isInvalid(enum CXCursorKind);
 
+CINDEX_LINKAGE unsigned clang_equalCursors(CXCursor, CXCursor);
+
 CINDEX_LINKAGE unsigned clang_getCursorLine(CXCursor);
 CINDEX_LINKAGE unsigned clang_getCursorColumn(CXCursor);
 CINDEX_LINKAGE CXString clang_getCursorSpelling(CXCursor);

Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=89131&r1=89130&r2=89131&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Tue Nov 17 13:28:59 2009
@@ -875,6 +875,18 @@
   return C;
 }
 
+CXCursor clang_getNullCursor(void) {
+  CXCursor C;
+  C.kind = CXCursor_InvalidFile;
+  C.decl = NULL;
+  C.stmt = NULL;
+  return C;
+}
+
+unsigned clang_equalCursors(CXCursor X, CXCursor Y) {
+  return X.kind == Y.kind && X.decl == Y.decl && X.stmt == Y.stmt;
+}
+  
 CXCursor clang_getCursorFromDecl(CXDecl AnonDecl)
 {
   assert(AnonDecl && "Passed null CXDecl");

Modified: cfe/trunk/tools/CIndex/CIndex.exports
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.exports?rev=89131&r1=89130&r2=89131&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.exports (original)
+++ cfe/trunk/tools/CIndex/CIndex.exports Tue Nov 17 13:28:59 2009
@@ -5,6 +5,7 @@
 _clang_disposeIndex
 _clang_disposeString
 _clang_disposeTranslationUnit
+_clang_equalCursors
 _clang_getCompletionChunkCompletionString
 _clang_getCompletionChunkKind
 _clang_getCompletionChunkText
@@ -30,6 +31,7 @@
 _clang_getEntityFromDecl
 _clang_getFileName
 _clang_getFileTime
+_clang_getNullCursor
 _clang_getNumCompletionChunks
 _clang_getTranslationUnitSpelling
 _clang_getURI





More information about the cfe-commits mailing list