diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-01-03 09:49:31 +0000 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-01-03 09:49:31 +0000 |
commit | 806baca8ec6ca20af972e6842a3448416a7ee91e (patch) | |
tree | e4deb2acc350677e363083600cb192ba4144e306 /include | |
parent | 2f396faf88a62d11be32479cc411172f2b26b54f (diff) |
[libclang] Support querying whether a declaration is invalid
This is useful for e.g. highlighting purposes in an IDE.
Patch by Nikolai Kosjar.
Differential Revision: https://reviews.llvm.org/D40072
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang-c/Index.h | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 587008a721..2ea801913f 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -29,13 +29,13 @@ * CINDEX_VERSION_MAJOR is intended for "major" source/ABI breaking changes. * * The policy about the libclang API was always to keep it source and ABI - * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. - */ -#define CINDEX_VERSION_MAJOR 0 -#define CINDEX_VERSION_MINOR 45 - -#define CINDEX_VERSION_ENCODE(major, minor) ( \ - ((major) * 10000) \ + * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
+ */
+#define CINDEX_VERSION_MAJOR 0
+#define CINDEX_VERSION_MINOR 46
+
+#define CINDEX_VERSION_ENCODE(major, minor) ( \
+ ((major) * 10000) \
+ ((minor) * 1)) #define CINDEX_VERSION CINDEX_VERSION_ENCODE( \ @@ -2638,12 +2638,22 @@ CINDEX_LINKAGE enum CXCursorKind clang_getCursorKind(CXCursor); /** * \brief Determine whether the given cursor kind represents a declaration. - */ -CINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind); - -/** - * \brief Determine whether the given cursor kind represents a simple - * reference. + */
+CINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind);
+
+/**
+ * \brief Determine whether the given declaration is invalid.
+ *
+ * A declaration is invalid if it could not be parsed successfully.
+ *
+ * \returns non-zero if the cursor represents a declaration and it is
+ * invalid, otherwise NULL.
+ */
+CINDEX_LINKAGE unsigned clang_isInvalidDeclaration(CXCursor);
+
+/**
+ * \brief Determine whether the given cursor kind represents a simple
+ * reference.
* * Note that other kinds of cursors (such as expressions) can also refer to * other cursors. Use clang_getCursorReferenced() to determine whether a |