aboutsummaryrefslogtreecommitdiff
path: root/bindings/python/tests/cindex/test_translation_unit.py
AgeCommit message (Collapse)Author
2013-03-19cindex.py: Handle NULL pointers when parsing translation unitsTobias Grosser
The code inside cindex.py was comparing NULL pointer returned by clang_parseTranslationUnit and clang_createTranslationUnit with None. However, as illustrated by the two tests I've added, those conditions were ineffective which resulted in assert triggering later on. Instead, a pointer is now treated as a boolean value, a NULL pointer being False. Contributed-by: Xavier Deguillard <deguilx@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177408 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-12[clang.py] Implement Token APIGregory Szorc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160111 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-12[clang.py] Add TranslationUnit.get_{file,source_location,source_range}Gregory Szorc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160107 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-08[clang.py] TranslationUnit API improvementsGregory Szorc
* TranslationUnit reading and parsing now implemented as TranslationUnit.from_ast() and TranslationUnit.from_source(). * Index.parse() and Index.read() implemented through above. * Index.parse() and Index.read() now raise a TanslationUnitLoadException instead of returning None if a TranslationUnit could not be instantiated. This is backwards incompatible. * Ability to save TranslationUnits via TranslationUnit.save(). * TranslationUnit now holds onto Index instance that created. This means the Index can't be GC'd until the TranslationUnit is itself GC'd, making memory management thoughtless. * Don't use [] as a default argument value, as the initial value used is reused for the duration of the program. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156372 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06Improve the Python bindings for libclang in a few ways, from EliDouglas Gregor
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
2011-02-05python bindings: Add support for translationUnit.reparse().Tobias Grosser
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
2011-02-05python bindings: Include local headers the right way.Tobias Grosser
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13cindex/Python: Add TranslationUnit.get_includes, patch by Andrew Sutton!Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25cindex/Python: Support file objects as unsaved_files, albeit inefficiently.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25cindex/Python: Implement support for unsaved/remapped files.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25cindex/Python: Fix/simplify Index.parse() passing command line arguments.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94394 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24cindex/Python: Move Cursor.is_ methods to CursorKind, and add test.Daniel Dunbar
Also, add CursorKind.get_all_kinds(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94389 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24cindex/Python: Convert CXString objects to regular Python strings below API.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24cindex/Python: Add TranslationUnit.cursor.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94355 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24Initial checkin of CIndex Python bindings, by Andrew Sutton!Daniel Dunbar
- 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