[libclang] Keep track of TranslationUnit instance when annotating tokens
authorJonathan Coe <jbcoe@me.com>
Thu, 21 Sep 2017 20:48:43 +0000 (20:48 +0000)
committerJonathan Coe <jbcoe@me.com>
Thu, 21 Sep 2017 20:48:43 +0000 (20:48 +0000)
commit1a28f2a0027296dfe8eb99d143bd6b5b04318f7c
tree43bb98029cb28506b87e9c3dabdcd8a2e28b8ffe
parentb63355ef7736f4169c15e720d3f2dfcd90179323
[libclang] Keep track of TranslationUnit instance when annotating tokens

Summary:
Previously the `_tu` was not propagated to the returned cursor, leading to errors when calling any
method on that cursor (e.g. `cursor.referenced`).

Reviewers: jbcoe, rsmith

Reviewed By: jbcoe

Subscribers: cfe-commits

Tags: #clang

Patch by jklaehn (Johann Klähn)

Differential Revision: https://reviews.llvm.org/D36953

llvm-svn: 313913
clang/bindings/python/clang/cindex.py
clang/bindings/python/tests/cindex/test_cursor.py