summaryrefslogtreecommitdiff
path: root/bindings/python/clang
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-01 13:24:05 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-01 13:24:05 +0000
commitcf1b401909b5e54edfd80656b1a18eaa31f9f6f1 (patch)
treeedb0ffff2a43d84ba9b4c862b394cfeeebb36ddc /bindings/python/clang
parentef915aab0ac566c55bfb0d7a9f6635bb5d94d4af (diff)
Notes
Diffstat (limited to 'bindings/python/clang')
-rw-r--r--bindings/python/clang/cindex.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index 8440b0aabe08..5e70bde770f8 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -1367,6 +1367,30 @@ TemplateArgumentKind.DECLARATION = TemplateArgumentKind(2)
TemplateArgumentKind.NULLPTR = TemplateArgumentKind(3)
TemplateArgumentKind.INTEGRAL = TemplateArgumentKind(4)
+### Exception Specification Kinds ###
+class ExceptionSpecificationKind(BaseEnumeration):
+ """
+ An ExceptionSpecificationKind describes the kind of exception specification
+ that a function has.
+ """
+
+ # The required BaseEnumeration declarations.
+ _kinds = []
+ _name_map = None
+
+ def __repr__(self):
+ return 'ExceptionSpecificationKind.{}'.format(self.name)
+
+ExceptionSpecificationKind.NONE = ExceptionSpecificationKind(0)
+ExceptionSpecificationKind.DYNAMIC_NONE = ExceptionSpecificationKind(1)
+ExceptionSpecificationKind.DYNAMIC = ExceptionSpecificationKind(2)
+ExceptionSpecificationKind.MS_ANY = ExceptionSpecificationKind(3)
+ExceptionSpecificationKind.BASIC_NOEXCEPT = ExceptionSpecificationKind(4)
+ExceptionSpecificationKind.COMPUTED_NOEXCEPT = ExceptionSpecificationKind(5)
+ExceptionSpecificationKind.UNEVALUATED = ExceptionSpecificationKind(6)
+ExceptionSpecificationKind.UNINSTANTIATED = ExceptionSpecificationKind(7)
+ExceptionSpecificationKind.UNPARSED = ExceptionSpecificationKind(8)
+
### Cursors ###
class Cursor(Structure):
@@ -1587,6 +1611,18 @@ class Cursor(Structure):
return self._result_type
@property
+ def exception_specification_kind(self):
+ '''
+ Retrieve the exception specification kind, which is one of the values
+ from the ExceptionSpecificationKind enumeration.
+ '''
+ if not hasattr(self, '_exception_specification_kind'):
+ exc_kind = conf.lib.clang_getCursorExceptionSpecificationType(self)
+ self._exception_specification_kind = ExceptionSpecificationKind.from_id(exc_kind)
+
+ return self._exception_specification_kind
+
+ @property
def underlying_typedef_type(self):
"""Return the underlying type of a typedef declaration.
@@ -2254,6 +2290,14 @@ class Type(Structure):
callbacks['fields_visit'](visitor), fields)
return iter(fields)
+ def get_exception_specification_kind(self):
+ """
+ Return the kind of the exception specification; a value from
+ the ExceptionSpecificationKind enumeration.
+ """
+ return ExceptionSpecificationKind.from_id(
+ conf.lib.clang.getExceptionSpecificationType(self))
+
@property
def spelling(self):
"""Retrieve the spelling of this Type."""