summaryrefslogtreecommitdiffstats
path: root/clang/bindings/python/tests/cindex/util.py
Commit message (Collapse)AuthorAgeFilesLines
* [python] Support PathLike filenames and directoriesMichal Gorny2018-11-101-0/+15
| | | | | | | | | | | | | | | Python 3.6 introduced a file system path protocol (PEP 519[1]). The standard library APIs accepting file system paths now accept path objects too. It could be useful to add this here as well for convenience. [1] https://www.python.org/dev/peps/pep-0519 Authored by: jstasiak (Jakub Stasiak) Differential Revision: https://reviews.llvm.org/D54120 llvm-svn: 346586
* Implement a convenience recursive walk method over a cursor and its descendants.Eli Bendersky2014-05-291-29/+11
| | | | | | | | | | | | | Before r160106 there was a way to recursively visit all descendants of a cursor via Cursor_visit, but it was removed. Since then, every user needs to reimplement the recursive descent into get_children. Adding a walk_preorder() method to Cursor that conveniently implements recursive walking in a Pythonic way. This also greatly simplifies get_cursor and get_cursors in tests/cindex/util.py (walk_preorder is now tested through these utility functions, since they are used in many tests). llvm-svn: 209793
* [libclang] Expose record layout info via new libclang functions:Argyrios Kyrtzidis2013-04-111-2/+2
| | | | | | | | | | | clang_Type_getAlignOf clang_Type_getSizeOf clang_Type_getOffsetOf clang_Cursor_isBitField Patch by Loïc Jaquemet! llvm-svn: 179251
* [clang.py] TranslationUnit API improvementsGregory Szorc2012-05-081-5/+3
| | | | | | | | | | | | | | | | | * 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. llvm-svn: 156372
* - Adding lexical_parent and semantic_parent properties to clang.cindex.CursorManuel Klimek2012-05-071-0/+29
| | | | | | | | | - Two new tests (one for each property), require libclang built from r155858 or later to pass - New test utility function (get_cursors) that gets all the nodes with a specific spelling. Patch by Evan Pipho. llvm-svn: 156286
* [python] Run tests for c++ with std=c++11Anders Waldenborg2012-05-021-2/+3
| | | | llvm-svn: 156008
* [clang.py] Refactor get_tu and get_cursor test helper functions into util.pyGregory Szorc2012-03-101-0/+65
llvm-svn: 152510
OpenPOWER on IntegriCloud