summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-04-12 00:03:31 +0000
committerTed Kremenek <kremenek@apple.com>2012-04-12 00:03:31 +0000
commit26a6d498ee5f2c3e592328128a9fb74db87531cc (patch)
tree2ecff96942e482a28bf26b771c22c258bab5b2ea /clang/include/clang-c
parent5811fd6cc45d0af6fc7eb714fa60bf8f1ef5e75f (diff)
downloadbcm5719-llvm-26a6d498ee5f2c3e592328128a9fb74db87531cc.tar.gz
bcm5719-llvm-26a6d498ee5f2c3e592328128a9fb74db87531cc.zip
Implement clang_getDiagnosticCategoryText() to provide a way for a client of libclang to accurately
get the diagnostic category name from a serialized diagnostic when the version of libclang used to read the diagnostic file is newer than the clang that emitted the diagnostic file. llvm-svn: 154567
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r--clang/include/clang-c/Index.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index 18316b4d33c..b297e545122 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -35,6 +35,16 @@ extern "C" {
#define CINDEX_LINKAGE
#endif
+#ifdef __GNUC__
+ #define CINDEX_DEPRECATED __attribute__((deprecated))
+#else
+ #ifdef _MSC_VER
+ #define CINDEX_DEPRECATED __declspec(deprecated)
+ #else
+ #define CINDEX_DEPRECATED
+ #endif
+#endif
+
/** \defgroup CINDEX libclang: C Interface to Clang
*
* The C Interface to Clang provides a relatively small API that exposes
@@ -830,14 +840,25 @@ CINDEX_LINKAGE CXString clang_getDiagnosticOption(CXDiagnostic Diag,
CINDEX_LINKAGE unsigned clang_getDiagnosticCategory(CXDiagnostic);
/**
- * \brief Retrieve the name of a particular diagnostic category.
+ * \brief Retrieve the name of a particular diagnostic category. This
+ * is now deprecated. Use clang_getDiagnosticCategoryText()
+ * instead.
*
* \param Category A diagnostic category number, as returned by
* \c clang_getDiagnosticCategory().
*
* \returns The name of the given diagnostic category.
*/
-CINDEX_LINKAGE CXString clang_getDiagnosticCategoryName(unsigned Category);
+CINDEX_DEPRECATED CINDEX_LINKAGE
+CXString clang_getDiagnosticCategoryName(unsigned Category);
+
+/**
+ * \brief Retrieve the diagnostic category text for a given diagnostic.
+ *
+ *
+ * \returns The text of the given diagnostic category.
+ */
+CINDEX_LINKAGE CXString clang_getDiagnosticCategoryText(CXDiagnostic);
/**
* \brief Determine the number of source ranges associated with the given
OpenPOWER on IntegriCloud