summaryrefslogtreecommitdiff
path: root/bindings/python/tests/cindex
Commit message (Collapse)AuthorAge
* Implement a convenience recursive walk method over a cursor and its descendants.Eli Bendersky2014-05-29
| | | | | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209793 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex/test_cursor.py: no need to skip implicit decls in testsAlp Toker2014-05-21
| | | | | | | | | clang was fixed some time ago to always skip "builtins and other cruft" so tools no longer need hacks like this. Passes nosetests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209316 91177308-0d34-0410-b5e6-96231b3b80d8
* bindings: expose C++ access specifiersSaleem Abdulrasool2014-04-25
| | | | | | | | | | Expose the enum CX_CXXAccessSpecifier in the python bindings as a property of the cursor. If access specifier is not applicable to the node, return the INVALID specifier rather than raising an exception. Patch by Tamás Szeli! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207173 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang/python] Use a Python standard library module to create a temporary ↵Argyrios Kyrtzidis2014-02-20
| | | | | | | | file. Patch by Brian Gesiak! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201762 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang/python] Add CompilationDatabase.getAllCompileCommands to the ↵Argyrios Kyrtzidis2013-12-20
| | | | | | | | python bindings. Patch by Laszlo Nagy! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197765 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Add some tests by Loïc Jaquemet that I forgot to add earlier.Argyrios Kyrtzidis2013-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192108 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] python: expose a few functions, patch by Loïc Jaquemet!Argyrios Kyrtzidis2013-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191907 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Don't report a DecayedType as "unexposed", report it as the ↵Argyrios Kyrtzidis2013-09-16
| | | | | | | | original (as written) type. Patch by Anders Waldenborg! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190796 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Expose the rest of the array types.Argyrios Kyrtzidis2013-07-23
| | | | | | Patch by Che-Liang Chiou! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186967 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang/python] Add a few "cursor kinds" that were missing in the python ↵Argyrios Kyrtzidis2013-06-11
| | | | | | | | binding for libclang. Patch by Mathieu Baudet! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183760 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Expose record layout info via new libclang functions:Argyrios Kyrtzidis2013-04-11
| | | | | | | | | | | clang_Type_getAlignOf clang_Type_getSizeOf clang_Type_getOffsetOf clang_Cursor_isBitField Patch by Loïc Jaquemet! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179251 91177308-0d34-0410-b5e6-96231b3b80d8
* cindex.py: Handle NULL pointers when parsing translation unitsTobias Grosser2013-03-19
| | | | | | | | | | | | | | 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
* [python bindings] Expose cursor.referenced (clang_getCursorReferenced).Argyrios Kyrtzidis2013-01-02
| | | | | | Patch by Matthew King! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171423 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Add Cursor.get_arguments()Gregory Szorc2012-11-01
| | | | | | Patch provided by Matthias Kleine <matthias_kleine@gmx.de> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167216 91177308-0d34-0410-b5e6-96231b3b80d8
* Python bindings: Add missing availability kind.Benjamin Kramer2012-10-07
| | | | | | Patch by Leo Liu, test case by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165374 91177308-0d34-0410-b5e6-96231b3b80d8
* Add bindings for clang_getCompletionBriefComment to cindex.py.Dmitri Gribenko2012-09-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163966 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Token APIGregory Szorc2012-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160111 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Add TranslationUnit.get_{file,source_location,source_range}Gregory Szorc2012-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160107 91177308-0d34-0410-b5e6-96231b3b80d8
* [cindex.py] Make CompileCommand.arguments usage consistent with ↵Arnaud A. de Grandmaison2012-07-10
| | | | | | | | CompileCommand.directory and the rest of the python binding Patch by David Röthlisberger git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159970 91177308-0d34-0410-b5e6-96231b3b80d8
* [cindex.py] fix infinite iteration of compilation database CompileCommandsArnaud A. de Grandmaison2012-07-09
| | | | | | Patch by David Röthlisberger git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159926 91177308-0d34-0410-b5e6-96231b3b80d8
* [cindex.py] Fix commentsArnaud A. de Grandmaison2012-06-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159492 91177308-0d34-0410-b5e6-96231b3b80d8
* [cindex.py] add CompilationDatabase supportArnaud A. de Grandmaison2012-06-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159485 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement SourceLocation.from_offsetGregory Szorc2012-06-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158307 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Cursor.is_static_methodGregory Szorc2012-06-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158277 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Store reference to TranslationUnit in Cursor and TypeGregory Szorc2012-05-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156846 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Cursor.canonicalGregory Szorc2012-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156753 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Cursor.result_typeGregory Szorc2012-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156752 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Remove trailing whitespace from recent commitsGregory Szorc2012-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156373 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] TranslationUnit API improvementsGregory Szorc2012-05-08
| | | | | | | | | | | | | | | | | * 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
* - Adding lexical_parent and semantic_parent properties to clang.cindex.CursorManuel Klimek2012-05-07
| | | | | | | | | | | - 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156286 91177308-0d34-0410-b5e6-96231b3b80d8
* [python] Add testcase for annotation cursorAnders Waldenborg2012-05-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156022 91177308-0d34-0410-b5e6-96231b3b80d8
* [python] Add Cursor.enum_value wrapping clang_getEnumConstantDeclValueAnders Waldenborg2012-05-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156017 91177308-0d34-0410-b5e6-96231b3b80d8
* [python] Add testcase for enum with specified underlaying typeAnders Waldenborg2012-05-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156009 91177308-0d34-0410-b5e6-96231b3b80d8
* [python] Run tests for c++ with std=c++11Anders Waldenborg2012-05-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156008 91177308-0d34-0410-b5e6-96231b3b80d8
* [python] Fix warning in c-code inside testcaseAnders Waldenborg2012-05-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156007 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement TypeKind.spellingGregory Szorc2012-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154769 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Cursor.objc_type_encodingGregory Szorc2012-03-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152513 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Refactor get_tu and get_cursor test helper functions into util.pyGregory Szorc2012-03-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152510 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Test Cursor.__ne__Gregory Szorc2012-02-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151504 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Format and add documention for TypeGregory Szorc2012-02-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150972 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Add tests for Type.is_volatile_qualified and ↵Gregory Szorc2012-02-20
| | | | | | Type.is_restrict_qualified git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150971 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Type.argument_types()Gregory Szorc2012-02-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150970 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Type.__eq__ and Type.__ne__Gregory Szorc2012-02-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150969 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Type.is_function_variadicGregory Szorc2012-02-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150936 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Type.element_countGregory Szorc2012-02-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150800 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Type.element_typeGregory Szorc2012-02-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150799 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Type.is_podGregory Szorc2012-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149842 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Cursor.enum_typeTobias Grosser2012-02-05
| | | | | | Contributed by: Gregory Szorc <gregory.szorc@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149830 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Implement Cursor.underlying_typedef_typeTobias Grosser2012-02-05
| | | | | | Contributed by: Gregory Szorc <gregory.szorc@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149829 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang.py] Add CursorKind.{is_translation_unit, is_preprocessing, is_unexposed}Tobias Grosser2012-02-05
| | | | | | Contributed by: Gregory Szorc <gregory.szorc@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149827 91177308-0d34-0410-b5e6-96231b3b80d8