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 | 26a6d498ee5f2c3e592328128a9fb74db87531cc (patch) | |
tree | 2ecff96942e482a28bf26b771c22c258bab5b2ea /clang/tools/c-index-test/c-index-test.c | |
parent | 5811fd6cc45d0af6fc7eb714fa60bf8f1ef5e75f (diff) | |
download | bcm5719-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/c-index-test/c-index-test.c')
-rw-r--r-- | clang/tools/c-index-test/c-index-test.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c index a81de2717f7..04e7a506e23 100644 --- a/clang/tools/c-index-test/c-index-test.c +++ b/clang/tools/c-index-test/c-index-test.c @@ -2586,9 +2586,9 @@ static void printDiagnosticSet(CXDiagnosticSet Diags, unsigned indent) { CXSourceLocation DiagLoc; CXDiagnostic D; CXFile File; - CXString FileName, DiagSpelling, DiagOption; + CXString FileName, DiagSpelling, DiagOption, DiagCat; unsigned line, column, offset; - const char *DiagOptionStr = 0; + const char *DiagOptionStr = 0, *DiagCatStr = 0; D = clang_getDiagnosticInSet(Diags, i); DiagLoc = clang_getDiagnosticLocation(D); @@ -2611,6 +2611,12 @@ static void printDiagnosticSet(CXDiagnosticSet Diags, unsigned indent) { fprintf(stderr, " [%s]", DiagOptionStr); } + DiagCat = clang_getDiagnosticCategoryText(D); + DiagCatStr = clang_getCString(DiagCat); + if (DiagCatStr) { + fprintf(stderr, " [%s]", DiagCatStr); + } + fprintf(stderr, "\n"); printRanges(D, indent); |