diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-04-12 00:03:31 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-04-12 00:03:31 +0000 |
commit | 78d5d3bb9386a5aa31d19445eb8f81bf2652acb4 (patch) | |
tree | 5bc532482d3f9dd23f983cc62120ac4256e2b9c0 /include | |
parent | 104dbf982582f16888fb15f9342fce9748af48c5 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang-c/Index.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 18316b4d33..b297e54512 100644 --- a/include/clang-c/Index.h +++ b/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 |