summaryrefslogtreecommitdiff
path: root/bindings
Commit message (Collapse)AuthorAgeFilesLines
* Improve the Python bindings for libclang in a few ways, from EliDouglas Gregor2011-07-063-12/+33
| | | | | | | | | | | | | | | | | | | Bendersky. Specifically: * Implemented a new function in libclang: clang_isAttribute * Fixing TranslationUnit.get_includes to only go through the argument * buffer when it contains something. This fixed a crash on Windows * clang_getFileName returns CXString, not char*. Made appropriate * fixes in cindex.py - now the relevant tests pass and we can see the * full locations correctly again (previously there was garbage in * place of the file name) * Exposed clang_getCursorDisplayName to the python bindings git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134460 91177308-0d34-0410-b5e6-96231b3b80d8
* python bindings: Add support for different kind of completion chunksTobias Grosser2011-02-051-6/+81
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124959 91177308-0d34-0410-b5e6-96231b3b80d8
* python bindings: Get the string representation of a CompletionChunkTobias Grosser2011-02-051-9/+84
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124958 91177308-0d34-0410-b5e6-96231b3b80d8
* python bindings: Add CodeCompletionResultsTobias Grosser2011-02-051-1/+94
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124957 91177308-0d34-0410-b5e6-96231b3b80d8
* python bindings: Add support for translationUnit.reparse().Tobias Grosser2011-02-052-6/+47
| | | | | | | | This is the first step to make the clang_complete vim plugin work with libclang. Reparsing improves parsing time from 0.8 to 0.25 secs for one of my LLVM .cpp files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124956 91177308-0d34-0410-b5e6-96231b3b80d8
* python bindings: Include local headers the right way.Tobias Grosser2011-02-051-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124955 91177308-0d34-0410-b5e6-96231b3b80d8
* python bindings: Remove unneeded instructionTobias Grosser2011-02-051-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124954 91177308-0d34-0410-b5e6-96231b3b80d8
* python bindings: fix Diagnostics.range iteratorTobias Grosser2011-02-052-0/+25
| | | | | | | The iterator did never throw an IndexError. It was therefore not possible to use it in a normal foreach loop as that loop would never stop. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124953 91177308-0d34-0410-b5e6-96231b3b80d8
* python bindings: Use python Diagnostics as function argumentsTobias Grosser2011-02-051-14/+17
| | | | | | | | | | | | This improves the readability of the code and fixes one testsuite bug. The bug happend, because we only stored the pointer to the diagnostic in the FixIt iterator, but not the python Diagnostic object. So it could happen that the FixIt iterator still exists, but the python Diagnostic object is freed. However, as the python Diagnostic is freed the pointer to the diagnostic is also freed and the FixIt iterator is referencing a freed pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124952 91177308-0d34-0410-b5e6-96231b3b80d8
* python bindings: Synchronize cursor kindsTobias Grosser2011-02-051-0/+89
| | | | | | | | clang-c/Index.h contained cursor kinds not yet available in the python bindings. Contributed-By: jmuizelaar@mozilla.com git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124951 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename 'CIndex' to 'libclang', since it has basically become our stable publicDaniel Dunbar2010-04-302-6/+5
| | | | | | (C) API, and will likely grow further in this direction in the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102779 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the new Iterator objects and raise an assertion instead of returning ↵Benjamin Kramer2010-03-061-10/+12
| | | | | | invalid objects when the key is out of range. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97881 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the python bindings for recent changes in the CIndex API.Benjamin Kramer2010-03-061-88/+88
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97880 91177308-0d34-0410-b5e6-96231b3b80d8
* CIndex: Switch CXSourceRange to proper half-open intervals.Daniel Dunbar2010-02-141-1/+1
| | | | | | - Doug, please review. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96162 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Fix cindex-{dump,includes} examples to just pass all argsDaniel Dunbar2010-02-132-11/+5
| | | | | | | | | | | | | directly to Index, instead of requiring the input file to be first. This makes the examples behave more like 'clang'. For example, ddunbar@giles:tmp$ echo '#include <string>' | python ~/llvm/tools/clang/bindings/python/examples/cindex/cindex-includes.py -- -x c++ - | wc -l 114 ddunbar@giles:tmp$ echo '#include <stdio.h>' | python ~/llvm/tools/clang/bindings/python/examples/cindex/cindex-includes.py -- -x c - | wc -l 10 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96107 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Add TranslationUnit.get_includes, patch by Andrew Sutton!Daniel Dunbar2010-02-137-0/+152
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96106 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Update for clang_getDiagnosticRange... API changes.Daniel Dunbar2010-02-131-18/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96105 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Turn off showing IDs by default, they are really slow to computeDaniel Dunbar2010-01-311-3/+20
| | | | | | | pending a hash function. Also added a --max-depth argument, handy for timing and limiting the volume of output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94936 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Add a simple example which dumps assorted information about a ↵Daniel Dunbar2010-01-301-0/+72
| | | | | | translation unit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94934 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Add full support for Diagnostic and FixIt objects, available ↵Daniel Dunbar2010-01-302-11/+228
| | | | | | | | | | via TranslationUnit.diagnostics. Several important FIXMEs remain: - We aren't getting all the notes? - There is still no way to get diagnostics for invalid inputs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94933 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Update SourceLocation and SourceRange structures to match API ↵Daniel Dunbar2010-01-301-2/+2
| | | | | | | | changes. Hurray for exposing implementation details!!! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94932 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Update Index.create for removal of displayDiagnostics.Daniel Dunbar2010-01-302-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94931 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Update to support _getInstantiationLocation's new offset value.Daniel Dunbar2010-01-291-4/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94813 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Move translation unit load functions to Index, there isn't a ↵Daniel Dunbar2010-01-251-35/+22
| | | | | | good reason to have separate static methods for this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94419 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Support file objects as unsaved_files, albeit inefficiently.Daniel Dunbar2010-01-252-2/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94418 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Add Cursor test.Daniel Dunbar2010-01-251-0/+59
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94397 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Implement support for unsaved/remapped files.Daniel Dunbar2010-01-252-3/+35
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94396 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Fix/simplify Index.parse() passing command line arguments.Daniel Dunbar2010-01-253-37/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94394 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Update comments, add module docstrings, add LLVM headers.Daniel Dunbar2010-01-252-4/+90
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94392 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Move Cursor.is_ methods to CursorKind, and add test.Daniel Dunbar2010-01-243-53/+88
| | | | | | Also, add CursorKind.get_all_kinds(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94389 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Implement explicit objects for CursorKind enumeration values.Daniel Dunbar2010-01-241-12/+183
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94388 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Fetch SourceLocation instantiation location information on ↵Daniel Dunbar2010-01-241-12/+29
| | | | | | | | lazily, it isn't free. Also, add repr() support to SourceRange. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94387 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Add Cursor.get_usr().Daniel Dunbar2010-01-241-3/+17
| | | | | | Also, change Cursor.spelling to return None for non-decls, for consistency with get_usr(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94386 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Return null cursors as None instead of exposing this notion.Daniel Dunbar2010-01-241-6/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94385 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Convert CXString objects to regular Python strings below API.Daniel Dunbar2010-01-242-18/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94384 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify.Daniel Dunbar2010-01-241-16/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94383 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Remove Cursor.file forwarding method, this doesn't really fit ↵Daniel Dunbar2010-01-241-8/+0
| | | | | | the API. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94382 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Add Cursor.get_children()Daniel Dunbar2010-01-241-3/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94359 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Remove Declaration class, this has been removed from the API.Daniel Dunbar2010-01-241-50/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94358 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Eliminate Entity class, it has been removed from CIndex.Daniel Dunbar2010-01-241-18/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94357 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify.Daniel Dunbar2010-01-241-9/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94356 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Add TranslationUnit.cursor.Daniel Dunbar2010-01-242-5/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94355 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Tweak Source{Location,Range}Daniel Dunbar2010-01-241-18/+21
| | | | | | | | | | | - Add __repr__ on SourceLocation. - Fix File object construction to use c_object_p type, and use None instead of invalid File objects. - Make SourceRange.{start,end} properties. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94354 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/Python: Make Cursor.is_... functions not properties.Daniel Dunbar2010-01-241-8/+4
| | | | | | Also, add ValueError check before calling Cursor_spelling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94353 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial checkin of CIndex Python bindings, by Andrew Sutton!Daniel Dunbar2010-01-248-0/+573
- Some tweaks by me for API changes, Darwin, and x86_64 support. Still needs substantial updating to match recent CIndex API changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94349 91177308-0d34-0410-b5e6-96231b3b80d8