summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-04-20 01:07:03 +0000
committerAlp Toker <alp@nuanti.com>2014-04-20 01:07:03 +0000
commit3a3ee3e3762a4fe0dbc084a6a3790377cee641e1 (patch)
treed2b9aefd013ddc8b8b9da10f68ab577274c5d548
parentd78c9576cafa6dd17aa0833bb9202549ebfc3739 (diff)
downloadbcm5719-llvm-3a3ee3e3762a4fe0dbc084a6a3790377cee641e1.tar.gz
bcm5719-llvm-3a3ee3e3762a4fe0dbc084a6a3790377cee641e1.zip
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. llvm-svn: 206712
-rw-r--r--clang/bindings/python/clang/cindex.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py
index 5078825f147..eea7d331aef 100644
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -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),
OpenPOWER on IntegriCloud