diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-11 17:02:10 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-11 17:02:10 +0000 |
commit | 04b6748ee90649069ee79464317ae6cd6aca317d (patch) | |
tree | b60c695cbcaf69bb02bb30c91bdfc15a1ed25167 /tools/c-index-test | |
parent | 1407bee187d7b964d5293ac8bf4f7a490c78cec6 (diff) | |
download | clang-04b6748ee90649069ee79464317ae6cd6aca317d.tar.gz clang-04b6748ee90649069ee79464317ae6cd6aca317d.tar.bz2 clang-04b6748ee90649069ee79464317ae6cd6aca317d.tar.xz |
[libclang] Have clang_getCXXAccessSpecifier() also return the access control of a C++ declaration within its parent scope.
Suggested by Stefan Seefeld.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test')
-rw-r--r-- | tools/c-index-test/c-index-test.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index e97cb30589..b77c88de58 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -934,6 +934,23 @@ enum CXChildVisitResult FilteredPrintingVisitor(CXCursor Cursor, GetCursorSource(Cursor), line, column); PrintCursor(Cursor, &Data->ValidationData); PrintCursorExtent(Cursor); + if (clang_isDeclaration(Cursor.kind)) { + enum CX_CXXAccessSpecifier access = clang_getCXXAccessSpecifier(Cursor); + const char *accessStr = 0; + + switch (access) { + case CX_CXXInvalidAccessSpecifier: break; + case CX_CXXPublic: + accessStr = "public"; break; + case CX_CXXProtected: + accessStr = "protected"; break; + case CX_CXXPrivate: + accessStr = "private"; break; + } + + if (accessStr) + printf(" [access=%s]", accessStr); + } printf("\n"); return CXChildVisit_Recurse; } |