summaryrefslogtreecommitdiffstats
path: root/clang/bindings/python/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* [libclang] Expose typedef and address space functionsSven van Haastregt2017-06-081-0/+17
| | | | | | | | | | | | Expose the following functions: - clang_getTypedefName - clang_getAddressSpace Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D33598 llvm-svn: 304978
* Add Python 3 support to clang.cindexJonathan Coe2017-04-201-2/+5
| | | | | | | | | | | | | | | | | | | | | Summary: Introduce an interop string to convert from unicode to c-strings where needed. Add missing conversions from _CXString to strings in function registrations. Explicitly evaluate lists where Python 3's lazy iterators would not otherwise do so. This is an improvement upon the reverted change proposed in https://reviews.llvm.org/D26082 Reviewers: compnerd, skalinichev, modocache, MathieuDuponchelle Reviewed By: compnerd Subscribers: cfe-commits Tags: #clang-c Differential Revision: https://reviews.llvm.org/D31568 llvm-svn: 300829
* Revert "Support for Python 3 in libclang python bindings"Jonathan Coe2017-01-131-6/+2
| | | | | | | | | This reverts commit 4464581bb63e9789e9ee231a8c8800be5f614743. Memory access issues on Linux were reported by Mathieu Duponchelle and discussed here: https://reviews.llvm.org/D26082. llvm-svn: 291907
* [libclang] Fix python testsSergey Kalinichev2016-12-032-2/+2
| | | | | | It was broken in r286421 llvm-svn: 288582
* Support for Python 3 in libclang python bindingsJonathan Coe2016-11-031-2/+6
| | | | | | | | | | | | | | | | | | | Summary: Python bindings tests now pass in Python 3. `map` in Python 3 is lazily evaluated so the method by which functions are registered needed updating. Strings are unicode in Python 3 not UTF-8, I've tried to create an new c_types-like class (c_string_p) to automate the conversion. String conversions made explicit where required. Reviewers: eliben, nemanjai, skalinichev, compnerd Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D26082 llvm-svn: 285909
* [libclang] Fix a failure in a test for python bindings on ↵Igor Kudrin2016-10-181-1/+2
| | | | | | | | | | CursorKind.OVERLOAD_CANDIDATE. The test fails because the value does not lay in any existing group. Differential Revision: https://reviews.llvm.org/D25470 llvm-svn: 284463
* python: add bindings for children of diagnosticsSaleem Abdulrasool2016-04-301-0/+12
| | | | | | | | | | | | | This exposes the Clang API bindings clang_getChildDiagnostics (which returns a CXDiagnosticSet) and clang_getNumDiagnosticsInSet / clang_getDiagnosticInSet (to traverse the CXDiagnosticSet), and adds a helper children property in the Python Diagnostic wrapper. Also, this adds the missing OVERLOAD_CANDIDATE (700) cursor type. Patch by Hanson Wang! llvm-svn: 268167
* Expose cxx constructor and method properties through libclang and python ↵Jonathan Coe2016-04-271-0/+82
| | | | | | | | | | | | | | | | | | | | | | | bindings. Summary: I have exposed the following function through libclang and the clang.cindex python bindings: clang_CXXConstructor_isConvertingConstructor, clang_CXXConstructor_isCopyConstructor, clang_CXXConstructor_isDefaultConstructor, clang_CXXConstructor_isMoveConstructor, clang_CXXMethod_isDefaulted I need (some of) these methods for a C++ code model I am building in Python to drive a code generator. Reviewers: compnerd, skalinichev Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15469 llvm-svn: 267706
* python binding: expose compile command filenameGuillaume Papin2016-03-071-5/+12
| | | | | | | | Reviewers: compnerd, skalinichev Differential Revision: http://reviews.llvm.org/D17278 llvm-svn: 262845
* [libclang] Visit TypeAliasTemplateDeclSergey Kalinichev2015-11-151-0/+1
| | | | | | | | This makes TypeAliasTemplateDecl accessible via LibClang and python bindings Differential Revision: http://reviews.llvm.org/D13844 llvm-svn: 253166
* Index: expose is_mutable_fieldSaleem Abdulrasool2015-10-271-0/+15
| | | | | | | | Expose isMutable via libClang and python bindings. Patch by Jonathan B Coe! llvm-svn: 251410
* bindings: add new C++ function attribute accessorsSaleem Abdulrasool2015-10-121-0/+45
| | | | | | | | | Add methods to index Cursor to see if a cxx method is pure_virtual, virtual or const methods. Patch by Jonathan B Coe! llvm-svn: 250008
* [libclang] Return deduced type for auto type, not the one written in the source.Manuel Klimek2015-09-031-2/+2
| | | | | | | | | | | | It used to work, but was accidentally broken by r179769. The issue with decayed types was fixed by r190796. So this patch partially reverts r179769, and adds more tests. This also fixes PR 18669. Patch by Sergey Kalinichev. llvm-svn: 246778
* [libclang] Add functions to get information about fields.Argyrios Kyrtzidis2015-04-131-6/+15
| | | | | | Patch by Loïc Jaquemet! llvm-svn: 234762
* This reverts commit r227432, r227438 and r227448.Rafael Espindola2015-01-291-15/+6
| | | | | | | | | | | | | | | | | | | | | | | It should bring the bots back. Original messagses: r227448: Remove unnecessary default. r227438: Fix Index/print-type.cpp test following r227432. r227432: libclang: Add three functions useful for dealing with anonymous fields: clang_Cursor_getOffsetOfField clang_Cursor_isAnonymous clang_Type_visitFields Python: Add corresponding methods for dealing with anonymous fields. Patch by Loïc Jaquemet llvm-svn: 227472
* libclang: Add three functions useful for dealing with anonymous fields:Francois Pichet2015-01-291-6/+15
| | | | | | | | | | | clang_Cursor_getOffsetOfField clang_Cursor_isAnonymous clang_Type_visitFields Python: Add corresponding methods for dealing with anonymous fields. Patch by Loïc Jaquemet llvm-svn: 227432
* Add libclang capabilities to retriete template arguments from specializations.Eli Bendersky2014-10-101-0/+44
| | | | | | | | | Includes Python bindings. Reviewed in http://reviews.llvm.org/D5621 Patch by Rob Springer llvm-svn: 219529
* Expose the name mangling C API to Python bindings.Eli Bendersky2014-08-051-0/+14
| | | | llvm-svn: 214930
* 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
* cindex/test_cursor.py: no need to skip implicit decls in testsAlp Toker2014-05-211-8/+1
| | | | | | | | | clang was fixed some time ago to always skip "builtins and other cruft" so tools no longer need hacks like this. Passes nosetests. llvm-svn: 209316
* bindings: expose C++ access specifiersSaleem Abdulrasool2014-04-251-0/+34
| | | | | | | | | | 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! llvm-svn: 207173
* [libclang/python] Use a Python standard library module to create a temporary ↵Argyrios Kyrtzidis2014-02-201-9/+2
| | | | | | | | file. Patch by Brian Gesiak! llvm-svn: 201762
* [libclang/python] Add CompilationDatabase.getAllCompileCommands to the ↵Argyrios Kyrtzidis2013-12-201-0/+21
| | | | | | | | python bindings. Patch by Laszlo Nagy! llvm-svn: 197765
* [libclang] Add some tests by Loïc Jaquemet that I forgot to add earlier.Argyrios Kyrtzidis2013-10-071-0/+40
| | | | llvm-svn: 192108
* [libclang] python: expose a few functions, patch by Loïc Jaquemet!Argyrios Kyrtzidis2013-10-031-0/+16
| | | | llvm-svn: 191907
* [libclang] Don't report a DecayedType as "unexposed", report it as the ↵Argyrios Kyrtzidis2013-09-161-0/+10
| | | | | | | | original (as written) type. Patch by Anders Waldenborg! llvm-svn: 190796
* [libclang] Expose the rest of the array types.Argyrios Kyrtzidis2013-07-231-2/+10
| | | | | | Patch by Che-Liang Chiou! llvm-svn: 186967
* [libclang/python] Add a few "cursor kinds" that were missing in the python ↵Argyrios Kyrtzidis2013-06-111-2/+9
| | | | | | | | binding for libclang. Patch by Mathieu Baudet! llvm-svn: 183760
* [libclang] Expose record layout info via new libclang functions:Argyrios Kyrtzidis2013-04-112-2/+65
| | | | | | | | | | | clang_Type_getAlignOf clang_Type_getSizeOf clang_Type_getOffsetOf clang_Cursor_isBitField Patch by Loïc Jaquemet! llvm-svn: 179251
* cindex.py: Handle NULL pointers when parsing translation unitsTobias Grosser2013-03-191-0/+17
| | | | | | | | | | | | | 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> llvm-svn: 177408
* [python bindings] Expose cursor.referenced (clang_getCursorReferenced).Argyrios Kyrtzidis2013-01-021-0/+9
| | | | | | Patch by Matthew King! llvm-svn: 171423
* [clang.py] Add Cursor.get_arguments()Gregory Szorc2012-11-011-0/+9
| | | | | | Patch provided by Matthias Kleine <matthias_kleine@gmx.de> llvm-svn: 167216
* Python bindings: Add missing availability kind.Benjamin Kramer2012-10-071-8/+48
| | | | | | Patch by Leo Liu, test case by me. llvm-svn: 165374
* Add bindings for clang_getCompletionBriefComment to cindex.py.Dmitri Gribenko2012-09-151-0/+35
| | | | llvm-svn: 163966
* [clang.py] Implement Token APIGregory Szorc2012-07-124-1/+128
| | | | llvm-svn: 160111
* [clang.py] Add TranslationUnit.get_{file,source_location,source_range}Gregory Szorc2012-07-121-0/+66
| | | | llvm-svn: 160107
* [cindex.py] Make CompileCommand.arguments usage consistent with ↵Arnaud A. de Grandmaison2012-07-101-2/+2
| | | | | | | | CompileCommand.directory and the rest of the python binding Patch by David Röthlisberger llvm-svn: 159970
* [cindex.py] fix infinite iteration of compilation database CompileCommandsArnaud A. de Grandmaison2012-07-091-0/+8
| | | | | | Patch by David Röthlisberger llvm-svn: 159926
* [cindex.py] Fix commentsArnaud A. de Grandmaison2012-06-301-1/+1
| | | | llvm-svn: 159492
* [cindex.py] add CompilationDatabase supportArnaud A. de Grandmaison2012-06-302-0/+98
| | | | llvm-svn: 159485
* [clang.py] Implement SourceLocation.from_offsetGregory Szorc2012-06-111-0/+9
| | | | llvm-svn: 158307
* [clang.py] Implement Cursor.is_static_methodGregory Szorc2012-06-091-0/+16
| | | | llvm-svn: 158277
* [clang.py] Store reference to TranslationUnit in Cursor and TypeGregory Szorc2012-05-152-0/+47
| | | | llvm-svn: 156846
* [clang.py] Implement Cursor.canonicalGregory Szorc2012-05-141-0/+12
| | | | llvm-svn: 156753
* [clang.py] Implement Cursor.result_typeGregory Szorc2012-05-141-0/+8
| | | | llvm-svn: 156752
* [clang.py] Remove trailing whitespace from recent commitsGregory Szorc2012-05-081-3/+3
| | | | llvm-svn: 156373
* [clang.py] TranslationUnit API improvementsGregory Szorc2012-05-082-20/+87
| | | | | | | | | | | | | | | | | * 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-072-0/+54
| | | | | | | | | - 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] Add testcase for annotation cursorAnders Waldenborg2012-05-021-0/+12
| | | | llvm-svn: 156022
* [python] Add Cursor.enum_value wrapping clang_getEnumConstantDeclValueAnders Waldenborg2012-05-021-0/+37
| | | | llvm-svn: 156017
OpenPOWER on IntegriCloud