r206712 - cindex.py: Avoid deprecated function

Alp Toker alp at nuanti.com
Sat Apr 19 18:07:03 PDT 2014


Author: alp
Date: Sat Apr 19 20:07:03 2014
New Revision: 206712

URL: http://llvm.org/viewvc/llvm-project?rev=206712&view=rev
Log:
cindex.py: Avoid deprecated function

Implement Diagnostic::category_name() using clang_getDiagnosticCategoryText()
instead of the deprected clang_getDiagnosticCategoryName().

Preserves existing behaviour and API covered by existing tests.

Modified:
    cfe/trunk/bindings/python/clang/cindex.py

Modified: cfe/trunk/bindings/python/clang/cindex.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/bindings/python/clang/cindex.py?rev=206712&r1=206711&r2=206712&view=diff
==============================================================================
--- cfe/trunk/bindings/python/clang/cindex.py (original)
+++ cfe/trunk/bindings/python/clang/cindex.py Sat Apr 19 20:07:03 2014
@@ -361,13 +361,13 @@ class Diagnostic(object):
 
     @property
     def category_number(self):
-        """The category number for this diagnostic."""
+        """The category number for this diagnostic or 0 if unavailable."""
         return conf.lib.clang_getDiagnosticCategory(self)
 
     @property
     def category_name(self):
         """The string name of the category for this diagnostic."""
-        return conf.lib.clang_getDiagnosticCategoryName(self.category_number)
+        return conf.lib.clang_getDiagnosticCategoryText(self)
 
     @property
     def option(self):
@@ -2922,8 +2922,8 @@ functionList = [
    [Diagnostic],
    c_uint),
 
-  ("clang_getDiagnosticCategoryName",
-   [c_uint],
+  ("clang_getDiagnosticCategoryText",
+   [Diagnostic],
    _CXString,
    _CXString.from_result),
 





More information about the cfe-commits mailing list