Introduce new libclang API functions that determine the availability
of a cursor or code-completion result, e.g., whether that result
refers to an unavailable, deleted, or deprecated declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111858 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index ff0d92a..9615a6d 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -97,6 +97,19 @@
unsigned long Length;
};
+/// \brief Describes the availability of a particular entity, which indicates
+/// whether the use of this entity will result in a warning or error due to
+/// it being deprecated or unavailable.
+enum CXAvailabilityKind {
+ /// \brief The entity is available.
+ CXAvailability_Available,
+ /// \brief The entity is available, but has been deprecated (and its use is
+ /// not recommended).
+ CXAvailability_Deprecated,
+ /// \brief The entity is not available; any use of it will be an error.
+ CXAvailability_NotAvailable
+};
+
/**
* \defgroup CINDEX_STRING String manipulation routines
*
@@ -1199,6 +1212,16 @@
CINDEX_LINKAGE enum CXLinkageKind clang_getCursorLinkage(CXCursor cursor);
/**
+ * \brief Determine the availability of the entity that this cursor refers to.
+ *
+ * \param cursor The cursor to query.
+ *
+ * \returns The availability of the cursor.
+ */
+CINDEX_LINKAGE enum CXAvailabilityKind
+clang_getCursorAvailability(CXCursor cursor);
+
+/**
* \brief Describe the "language" of the entity referred to by a cursor.
*/
CINDEX_LINKAGE enum CXLanguageKind {
@@ -2073,6 +2096,17 @@
clang_getCompletionPriority(CXCompletionString completion_string);
/**
+ * \brief Determine the availability of the entity that this code-completion
+ * string refers to.
+ *
+ * \param completion_string The completion string to query.
+ *
+ * \returns The availability of the completion string.
+ */
+CINDEX_LINKAGE enum CXAvailabilityKind
+clang_getCompletionAvailability(CXCompletionString completion_string);
+
+/**
* \brief Contains the results of code-completion.
*
* This data structure contains the results of code completion, as
@@ -2294,7 +2328,7 @@
*/
CINDEX_LINKAGE
void clang_disposeCodeCompleteResults(CXCodeCompleteResults *Results);
-
+
/**
* \brief Determine the number of diagnostics produced prior to the
* location where code completion was performed.