summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c
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
commit0a5b03b659d03392f43aed3003989a7a3fcbab62 (patch)
treeabc9d40cf7f5a41b7d4b4b1c8db8cc65f56e7605 /clang/include/clang-c
parent6f75e2dd48ca7ce22ca7e97684729259ce5ebe57 (diff)
downloadbcm5719-llvm-0a5b03b659d03392f43aed3003989a7a3fcbab62.tar.gz
bcm5719-llvm-0a5b03b659d03392f43aed3003989a7a3fcbab62.zip
[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 llvm-svn: 306483
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r--clang/include/clang-c/Index.h69
1 files changed, 68 insertions, 1 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index 4241e43a969..f404e6d72ec 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -171,7 +171,60 @@ typedef struct CXVersion {
*/
int Subminor;
} CXVersion;
-
+
+/**
+ * \brief Describes the exception specification of a cursor.
+ *
+ * A negative value indicates that the cursor is not a function declaration.
+ */
+enum CXCursor_ExceptionSpecificationKind {
+
+ /**
+ * \brief The cursor has no exception specification.
+ */
+ CXCursor_ExceptionSpecificationKind_None,
+
+ /**
+ * \brief The cursor has exception specification throw()
+ */
+ CXCursor_ExceptionSpecificationKind_DynamicNone,
+
+ /**
+ * \brief The cursor has exception specification throw(T1, T2)
+ */
+ CXCursor_ExceptionSpecificationKind_Dynamic,
+
+ /**
+ * \brief The cursor has exception specification throw(...).
+ */
+ CXCursor_ExceptionSpecificationKind_MSAny,
+
+ /**
+ * \brief The cursor has exception specification basic noexcept.
+ */
+ CXCursor_ExceptionSpecificationKind_BasicNoexcept,
+
+ /**
+ * \brief The cursor has exception specification computed noexcept.
+ */
+ CXCursor_ExceptionSpecificationKind_ComputedNoexcept,
+
+ /**
+ * \brief The exception specification has not yet been evaluated.
+ */
+ CXCursor_ExceptionSpecificationKind_Unevaluated,
+
+ /**
+ * \brief The exception specification has not yet been instantiated.
+ */
+ CXCursor_ExceptionSpecificationKind_Uninstantiated,
+
+ /**
+ * \brief The exception specification has not been parsed yet.
+ */
+ CXCursor_ExceptionSpecificationKind_Unparsed
+};
+
/**
* \brief Provides a shared context for creating translation units.
*
@@ -3471,6 +3524,13 @@ CINDEX_LINKAGE enum CXCallingConv clang_getFunctionTypeCallingConv(CXType T);
CINDEX_LINKAGE CXType clang_getResultType(CXType T);
/**
+ * \brief Retrieve the exception specification type associated with a function type.
+ *
+ * If a non-function type is passed in, an error code of -1 is returned.
+ */
+CINDEX_LINKAGE int clang_getExceptionSpecificationType(CXType T);
+
+/**
* \brief Retrieve the number of non-variadic parameters associated with a
* function type.
*
@@ -3499,6 +3559,13 @@ CINDEX_LINKAGE unsigned clang_isFunctionTypeVariadic(CXType T);
CINDEX_LINKAGE CXType clang_getCursorResultType(CXCursor C);
/**
+ * \brief Retrieve the exception specification type associated with a given cursor.
+ *
+ * This only returns a valid result if the cursor refers to a function or method.
+ */
+CINDEX_LINKAGE int clang_getCursorExceptionSpecificationType(CXCursor C);
+
+/**
* \brief Return 1 if the CXType is a POD (plain old data) type, and 0
* otherwise.
*/
OpenPOWER on IntegriCloud