aboutsummaryrefslogtreecommitdiff
path: root/bindings/python/clang
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-02 22:31:57 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-02 22:31:57 +0000
commitd829379ed95cdce29497118c6c6c39bd7f62f307 (patch)
tree0bb5f6064b8e9b4abb47692d67b2897d19f156d3 /bindings/python/clang
parentf5e208c06e8b7cf68be841cfad983a17e76e6846 (diff)
[python bindings] Expose cursor.referenced (clang_getCursorReferenced).
Patch by Matthew King! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/clang')
-rw-r--r--bindings/python/clang/cindex.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index adbf511e68..581f5e6fef 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -1271,6 +1271,17 @@ class Cursor(Structure):
# created.
return self._tu
+ @property
+ def referenced(self):
+ """
+ For a cursor that is a reference, returns a cursor
+ representing the entity that it references.
+ """
+ if not hasattr(self, '_referenced'):
+ self._referenced = conf.lib.clang_getCursorReferenced(self)
+
+ return self._referenced
+
def get_arguments(self):
"""Return an iterator for accessing the arguments of this cursor."""
num_args = conf.lib.clang_Cursor_getNumArguments(self)