diff options
author | Steve Naroff <snaroff@apple.com> | 2009-09-15 20:25:34 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-09-15 20:25:34 +0000 |
commit | 77128ddd3077fc045751a55bb3226802b15d5510 (patch) | |
tree | 1c3b342c0ce5cf90fba48540b61e389d83bdeede /include | |
parent | 1fdd89ba1d14ee11fda5b9e1c171db428b1acb23 (diff) |
- clang_getCursor(): Replace asserts with error codes (CXCursor_InvalidFile, CXCursor_NoDeclFound).
- Add predicate clang_isInvalid().
- Implement clang_getCursorFromDecl().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang-c/Index.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 9af3169157..030dfae985 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -37,8 +37,6 @@ typedef void *CXDecl; /* A specific declaration within a translation unit. */ /* Cursors represent declarations, definitions, and references. */ enum CXCursorKind { - CXCursor_Invalid = 0, - /* Declarations */ CXCursor_FirstDecl = 1, CXCursor_TypedefDecl = 2, @@ -76,7 +74,14 @@ enum CXCursorKind { CXCursor_ObjCMessageRef = 42, CXCursor_ObjCSelectorRef = 43, CXCursor_ObjCClassRef = 44, - CXCursor_LastRef = 44 + CXCursor_LastRef = 44, + + /* Error conditions */ + CXCursor_FirstInvalid = 70, + CXCursor_InvalidFile = 70, + CXCursor_NoDeclFound = 71, + CXCursor_NotImplemented = 72, + CXCursor_LastInvalid = 72 }; /* A cursor into the CXTranslationUnit. */ @@ -172,6 +177,7 @@ enum CXCursorKind clang_getCursorKind(CXCursor); unsigned clang_isDeclaration(enum CXCursorKind); unsigned clang_isReference(enum CXCursorKind); unsigned clang_isDefinition(enum CXCursorKind); +unsigned clang_isInvalid(enum CXCursorKind); unsigned clang_getCursorLine(CXCursor); unsigned clang_getCursorColumn(CXCursor); |