diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-01-27 16:27:11 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-01-27 16:27:11 +0000 |
commit | e72fb6f40231a1e8372c7576b69f06f0a1eb28a7 (patch) | |
tree | 35cd709c463c840602b202f70d325d8644a3ffbe /tools/c-index-test | |
parent | 9319b56154cfd9e3c781e54d2ee1c10c5858efed (diff) |
Add libclang functions to determine the const/volatile/restrict
qualifiers on a CXType. Patch from Stefan Seefeld, test by me.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124377 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test')
-rw-r--r-- | tools/c-index-test/c-index-test.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index 7238f4a2d0..be3a079598 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -568,6 +568,12 @@ static enum CXChildVisitResult PrintTypeKind(CXCursor cursor, CXCursor p, CXString S = clang_getTypeKindSpelling(T.kind); PrintCursor(cursor); printf(" typekind=%s", clang_getCString(S)); + if (clang_isConstQualifiedType(T)) + printf(" const"); + if (clang_isVolatileQualifiedType(T)) + printf(" volatile"); + if (clang_isRestrictQualifiedType(T)) + printf(" restrict"); clang_disposeString(S); /* Print the canonical type if it is different. */ { |