summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CXStoredDiagnostic.cpp
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/tools/libclang/CXStoredDiagnostic.cpp
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/tools/libclang/CXStoredDiagnostic.cpp')
-rw-r--r--clang/tools/libclang/CXStoredDiagnostic.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/tools/libclang/CXStoredDiagnostic.cpp b/clang/tools/libclang/CXStoredDiagnostic.cpp
index c1bcd74387a..8284dc96180 100644
--- a/clang/tools/libclang/CXStoredDiagnostic.cpp
+++ b/clang/tools/libclang/CXStoredDiagnostic.cpp
@@ -79,6 +79,11 @@ unsigned CXStoredDiagnostic::getCategory() const {
return DiagnosticIDs::getCategoryNumberForDiag(Diag.getID());
}
+CXString CXStoredDiagnostic::getCategoryText() const {
+ unsigned catID = DiagnosticIDs::getCategoryNumberForDiag(Diag.getID());
+ return createCXString(DiagnosticIDs::getCategoryNameFromID(catID));
+}
+
unsigned CXStoredDiagnostic::getNumRanges() const {
if (Diag.getLocation().isInvalid())
return 0;
OpenPOWER on IntegriCloud