diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-08-27 21:34:58 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-08-27 21:34:58 +0000 |
commit | 3064ef9e604d19a0cfd0d8e3ed3055bfd83f88fd (patch) | |
tree | 021ded705dcf7016038e6878a12755cf40647363 /tools/c-index-test/c-index-test.c | |
parent | ad72f4dad4cf0fd2b71eb8f4704d2fe7ac58fb44 (diff) |
Implement CXCursor support for walking C++ base specifiers. This includes adding the API hooks clang_isVirtualBase() and clang_getCXXAccessSpecifier() to query properties of the base specifier.
Implements <rdar://problem/8274883>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test/c-index-test.c')
-rw-r--r-- | tools/c-index-test/c-index-test.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index 67e0c7724f..cdf0cd06b5 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -204,6 +204,26 @@ static void PrintCursor(CXCursor Cursor) { printf(" [IBOutletCollection=%s]", clang_getCString(S)); clang_disposeString(S); } + + if (Cursor.kind == CXCursor_CXXBaseSpecifier) { + enum CX_CXXAccessSpecifier access = clang_getCXXAccessSpecifier(Cursor); + unsigned isVirtual = clang_isVirtualBase(Cursor); + const char *accessStr = 0; + + switch (access) { + case CX_CXXInvalidAccessSpecifier: + accessStr = "invalid"; break; + case CX_CXXPublic: + accessStr = "public"; break; + case CX_CXXProtected: + accessStr = "protected"; break; + case CX_CXXPrivate: + accessStr = "private"; break; + } + + printf(" [access=%s isVirtual=%s]", accessStr, + isVirtual ? "true" : "false"); + } } } |