summaryrefslogtreecommitdiffstats
path: root/tools/c-index-test
diff options
context:
space:
mode:
authorJonathan Coe <jbcoe@me.com>2017-06-27 22:54:56 +0000
committerJonathan Coe <jbcoe@me.com>2017-06-27 22:54:56 +0000
commit34efc84dff3e2cb91e6afdf460a7893a4a886029 (patch)
tree8e9b74edbd34bfca8650e42434927043d872044d /tools/c-index-test
parent563c0ec65e052e93085d4e3b7fede21da5ea768f (diff)
[libclang] Support for querying the exception specification type through libclang
Summary: This patch exposes the exception specification type (noexcept, etc.) of a C++ function through libclang and Python clang.cindex. Reviewers: rsmith, aaron.ballman Reviewed By: aaron.ballman Subscribers: jbcoe, cfe-commits Differential Revision: https://reviews.llvm.org/D34091 Patch by Andrew Bennieston git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306483 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test')
-rw-r--r--tools/c-index-test/c-index-test.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index d25ae117a6..1e925569dd 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -809,6 +809,37 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
if (clang_Cursor_isObjCOptional(Cursor))
printf(" (@optional)");
+ switch (clang_getCursorExceptionSpecificationType(Cursor))
+ {
+ case CXCursor_ExceptionSpecificationKind_None:
+ break;
+
+ case CXCursor_ExceptionSpecificationKind_DynamicNone:
+ printf(" (noexcept dynamic none)");
+ break;
+
+ case CXCursor_ExceptionSpecificationKind_Dynamic:
+ printf(" (noexcept dynamic)");
+ break;
+
+ case CXCursor_ExceptionSpecificationKind_MSAny:
+ printf(" (noexcept dynamic any)");
+ break;
+
+ case CXCursor_ExceptionSpecificationKind_BasicNoexcept:
+ printf(" (noexcept)");
+ break;
+
+ case CXCursor_ExceptionSpecificationKind_ComputedNoexcept:
+ printf(" (computed-noexcept)");
+ break;
+
+ case CXCursor_ExceptionSpecificationKind_Unevaluated:
+ case CXCursor_ExceptionSpecificationKind_Uninstantiated:
+ case CXCursor_ExceptionSpecificationKind_Unparsed:
+ break;
+ }
+
{
CXString language;
CXString definedIn;