From ae9e2215133d89d28a03b79ff70da85868a50129 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 27 Aug 2010 21:34:58 +0000 Subject: 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 . llvm-svn: 112296 --- clang/include/clang-c/Index.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'clang/include/clang-c') diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 064bd21909b..3f0dabf1c5d 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -1001,7 +1001,8 @@ enum CXCursorKind { * referenced by the type of size is the typedef for size_type. */ CXCursor_TypeRef = 43, - CXCursor_LastRef = 43, + CXCursor_CXXBaseSpecifier = 44, + CXCursor_LastRef = CXCursor_CXXBaseSpecifier, /* Error conditions */ CXCursor_FirstInvalid = 70, @@ -1438,6 +1439,29 @@ CINDEX_LINKAGE CXType clang_getCursorResultType(CXCursor C); */ CINDEX_LINKAGE unsigned clang_isPODType(CXType T); +/** + * \brief Returns 1 if the base class specified by the cursor with kind + * CX_CXXBaseSpecifier is virtual. + */ +CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor); + +/** + * \brief Represents the C++ access control level to a base class for a + * cursor with kind CX_CXXBaseSpecifier. + */ +enum CX_CXXAccessSpecifier { + CX_CXXInvalidAccessSpecifier, + CX_CXXPublic, + CX_CXXProtected, + CX_CXXPrivate +}; + +/** + * \brief Returns the access control level for the C++ base specifier + * represented by a cursor with kind CX_CXXBaseSpecifier. + */ +CINDEX_LINKAGE enum CX_CXXAccessSpecifier clang_getCXXAccessSpecifier(CXCursor); + /** * @} */ -- cgit v1.2.3