summaryrefslogtreecommitdiffstats
path: root/tools/c-index-test
diff options
context:
space:
mode:
authorJonathan Coe <jbcoe@me.com>2016-04-27 12:48:25 +0000
committerJonathan Coe <jbcoe@me.com>2016-04-27 12:48:25 +0000
commitf376e8cf301479a7c40942d31e8e59dedac95230 (patch)
treedd606f4847062d0c32af768837c07f1e70315699 /tools/c-index-test
parent7e12e0954b5ece78dfb5d26fb404f2ecd7b99f27 (diff)
Expose cxx constructor and method properties through libclang and python bindings.
Summary: I have exposed the following function through libclang and the clang.cindex python bindings: clang_CXXConstructor_isConvertingConstructor, clang_CXXConstructor_isCopyConstructor, clang_CXXConstructor_isDefaultConstructor, clang_CXXConstructor_isMoveConstructor, clang_CXXMethod_isDefaulted I need (some of) these methods for a C++ code model I am building in Python to drive a code generator. Reviewers: compnerd, skalinichev Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15469 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267706 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test')
-rw-r--r--tools/c-index-test/c-index-test.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index b3105fb87c..d0fe84aa08 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -772,9 +772,20 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
clang_disposeString(DeprecatedMessage);
clang_disposeString(UnavailableMessage);
-
+
+ if (clang_CXXConstructor_isDefaultConstructor(Cursor))
+ printf(" (default constructor)");
+
+ if (clang_CXXConstructor_isMoveConstructor(Cursor))
+ printf(" (move constructor)");
+ if (clang_CXXConstructor_isCopyConstructor(Cursor))
+ printf(" (copy constructor)");
+ if (clang_CXXConstructor_isConvertingConstructor(Cursor))
+ printf(" (converting constructor)");
if (clang_CXXField_isMutable(Cursor))
printf(" (mutable)");
+ if (clang_CXXMethod_isDefaulted(Cursor))
+ printf(" (defaulted)");
if (clang_CXXMethod_isStatic(Cursor))
printf(" (static)");
if (clang_CXXMethod_isVirtual(Cursor))