summaryrefslogtreecommitdiff
path: root/clang/bindings
AgeCommit message (Collapse)Author
2017-06-27[libclang] Support for querying the exception specification type through ↵Jonathan Coe
libclang Summary: This patch exposes the exception specification type (noexcept, etc.) of a C++ function through libclang and Python clang.cindex. Reviewers: rsmith, aaron.ballman Reviewed By: aaron.ballman Subscribers: jbcoe, cfe-commits Differential Revision: https://reviews.llvm.org/D34091 Patch by Andrew Bennieston
2017-06-08[libclang] Expose typedef and address space functionsSven van Haastregt
Expose the following functions: - clang_getTypedefName - clang_getAddressSpace Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D33598
2017-05-23[libclang] [OpenCL] Expose more OpenCL CIndex typesSven van Haastregt
Expose pipe, sampler_t, clk_event_t, queue_t, reserve_id_t, and all image types. Update the opencl-types.cl test RUN line such that we can test the OpenCL 2.0 types. Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D33197
2017-04-20Add Python 3 support to clang.cindexJonathan Coe
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
2017-02-10[libclang] [OpenCL] Expose half type.Joey Gouly
Expose the half type (fp16) through libclang and the python bindings. It seems CXType_LastBuiltin was not updated in b2ea6d9 ("Enable support for __float128 in Clang", 2016-04-13), so update it now. Add an Index test for OpenCL types; in the future we will add other OpenCL types such as images to this test. Patch by Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D29718
2017-01-17Fix Python 3 language issues and add an explicit check for Python version == 2.Jonathan Coe
Summary: Python bindings cannot support Python 3 without work being done to fix Unicode c-string conversion. This was attempted in https://reviews.llvm.org/D26082. That patch was reverted due to memory access issues on Linux. This revision fixes enough language compatibility issues for the clang module to be loaded and raise an error if the Python version is not 2. Reviewers: mgorny, MathieuDuponchelle, rengolin, compnerd Reviewed By: compnerd Differential Revision: https://reviews.llvm.org/D28682
2017-01-13Revert "Support for Python 3 in libclang python bindings"Jonathan Coe
This reverts commit 4464581bb63e9789e9ee231a8c8800be5f614743. Memory access issues on Linux were reported by Mathieu Duponchelle and discussed here: https://reviews.llvm.org/D26082.
2016-12-03[libclang] Fix python testsSergey Kalinichev
It was broken in r286421
2016-11-04[python bindings] Expose CXCursor_FriendDecl as CursorKind.FRIEND_DECLOlivier Goffart
CXCursor_FriendDecl was added in r285984
2016-11-03Support for Python 3 in libclang python bindingsJonathan Coe
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
2016-10-18[libclang] Add missing cursor kinds to python bindings.Igor Kudrin
Differential Revision: https://reviews.llvm.org/D25673
2016-10-18[libclang] Fix a failure in a test for python bindings on ↵Igor Kudrin
CursorKind.OVERLOAD_CANDIDATE. The test fails because the value does not lay in any existing group. Differential Revision: https://reviews.llvm.org/D25470
2016-08-11bindings: expose diagnostic formatting to PythonSaleem Abdulrasool
This makes it easier for tools using the Python libclang bindings to display diagnostics in a manner consistent with clang. Patch by Omar Sandoval!
2016-05-09Enable support for __float128 in Clang and enable it on pertinent platformsNemanja Ivanovic
This patch corresponds to reviews: http://reviews.llvm.org/D15120 http://reviews.llvm.org/D19125 It adds support for the __float128 keyword, literals and target feature to enable it. Based on the latter of the two aforementioned reviews, this feature is enabled on Linux on i386/X86 as well as SystemZ. This is also the second attempt in commiting this feature. The first attempt did not enable it on required platforms which caused failures when compiling type_traits with -std=gnu++11. If you see failures with compiling this header on your platform after this commit, it is likely that your platform needs to have this feature enabled.
2016-05-03[libclang] Expose the ElaboratedTypeSergey Kalinichev
Differential Revision: http://reviews.llvm.org/D11797
2016-04-30python: add bindings for children of diagnosticsSaleem Abdulrasool
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!
2016-04-27Expose cxx constructor and method properties through libclang and python ↵Jonathan Coe
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
2016-04-15Revert 266186 as it breaks anything that includes type_traits on some platformsNemanja Ivanovic
Since this patch provided support for the __float128 type but disabled it on all platforms by default, some platforms can't compile type_traits with -std=gnu++11 since there is a specialization with __float128. This reverts the patch until D19125 is approved (i.e. we know which platforms need this support enabled).
2016-04-13Enable support for __float128 in ClangNemanja Ivanovic
This patch corresponds to review: http://reviews.llvm.org/D15120 It adds support for the __float128 keyword, literals and a target feature to enable it. This support is disabled by default on all targets and any target that has support for this type is free to add it. Based on feedback that I've received from target maintainers, this appears to be the right thing for most targets. I have not heard from the maintainers of X86 which I believe supports this type. I will subsequently investigate the impact of enabling this on X86.
2016-03-10libclang python bindings: Fix for bug 26394Jonathan Coe
Summary: https://llvm.org/bugs/show_bug.cgi?id=26394 reports that clang's python bindings tests are failing. I can confirm that the bug exists and that the proposed fix is good. Differential Revision: http://reviews.llvm.org/D17226
2016-03-07python binding: expose compile command filenameGuillaume Papin
Reviewers: compnerd, skalinichev Differential Revision: http://reviews.llvm.org/D17278
2015-12-10libclang: expose dllexport, dllimport attributesSaleem Abdulrasool
These attributes were previously unexposed. Expose them through the libclang interfaces. Add tests that cover both the MSVC spelling and the GNU spelling.
2015-11-15[libclang] Visit TypeAliasTemplateDeclSergey Kalinichev
This makes TypeAliasTemplateDecl accessible via LibClang and python bindings Differential Revision: http://reviews.llvm.org/D13844
2015-11-15[libclang] Expose AutoTypeSergey Kalinichev
Expose the AutoType via LibClang and python bindings Differential Revision: http://reviews.llvm.org/D13000
2015-10-27Index: expose is_mutable_fieldSaleem Abdulrasool
Expose isMutable via libClang and python bindings. Patch by Jonathan B Coe!
2015-10-12bindings: add new C++ function attribute accessorsSaleem Abdulrasool
Add methods to index Cursor to see if a cxx method is pure_virtual, virtual or const methods. Patch by Jonathan B Coe!
2015-09-05Index: expose visibility attributeSaleem Abdulrasool
Expose the previously unexposed visibility attribute via the python and C bindings.
2015-09-03[libclang] Return deduced type for auto type, not the one written in the source.Manuel Klimek
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.
2015-04-13[libclang] Add functions to get information about fields.Argyrios Kyrtzidis
Patch by Loïc Jaquemet!
2015-01-29This reverts commit r227432, r227438 and r227448.Rafael Espindola
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
2015-01-29libclang: Add three functions useful for dealing with anonymous fields:Francois Pichet
clang_Cursor_getOffsetOfField clang_Cursor_isAnonymous clang_Type_visitFields Python: Add corresponding methods for dealing with anonymous fields. Patch by Loïc Jaquemet
2014-10-15[libclang] Add function to retrieve storage class in libclang.Argyrios Kyrtzidis
Patch by guibufolo!
2014-10-10Add libclang capabilities to retriete template arguments from specializations.Eli Bendersky
Includes Python bindings. Reviewed in http://reviews.llvm.org/D5621 Patch by Rob Springer
2014-08-08Expose the CUDA shared attribute to the C API.Eli Bendersky
Similar to r209767, which exposed other CUDA-related attributes. Patch by Rob Springer.
2014-08-05Expose the name mangling C API to Python bindings.Eli Bendersky
2014-07-31Reformat docstring to 80-colEli Bendersky
2014-06-22cindex.py: remove obsolete workaround and FIXMEAlp Toker
clang_getCursorSpelling() doesn't assert on non-declarations any more and the behaviour is covered by c-index tests. Passes nosetests.
2014-05-29Implement a convenience recursive walk method over a cursor and its descendants.Eli Bendersky
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).
2014-05-28Expose CUDA function attributes to the C interface.Eli Bendersky
Until now all CUDA-specific attributes were represented with CXCursor_UnexposedAttr; now they are actually implemented, including the Python bindings.
2014-05-28Trim trailing whitespace in cindex.pyEli Bendersky
2014-05-21cindex/test_cursor.py: no need to skip implicit decls in testsAlp Toker
clang was fixed some time ago to always skip "builtins and other cruft" so tools no longer need hacks like this. Passes nosetests.
2014-05-20Clean up language and grammar.Eric Christopher
Based on a patch by jfcaron3@gmail.com! PR19806
2014-05-05cindex-dump.py: fix the --show-ids description stringAlp Toker
It looks like this was botched back in r94936.
2014-05-05Fix cindex-dump.py --show-idsAlp Toker
This option flag was incorrectly expecting an argument: $ cindex-dump.py --show-ids test.cpp cindex-dump.py: error: invalid number arguments With this change the feature correctly gets enabled by --show-ids. No tests.
2014-05-01[libclang] Add attribute support for 'pure', 'const' and 'noduplicate'.Joey Gouly
This bumps CINDEX_VERSION_MINOR up (to 26).
2014-04-30Comment parsing: remove HTML attribute validationDmitri Gribenko
Since the community says that a blacklist is not good enough, and I don't have enough time now to implement a proper whitelist, let's just remove the attribute validation. But, nevertheless, we can still communicate in the generated XML if our parser found an issue with the HTML. But this bit is best-effort and is specifically called out in the schema as such.
2014-04-27Fix the method len of the CompletionString object. Patch by Christopher GreeneSylvestre Ledru
2014-04-25bindings: expose C++ access specifiersSaleem Abdulrasool
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!
2014-04-22Comment parsing: in the generated XML file, mark HTML that is safe to passDmitri Gribenko
through to the output even if the input comment comes from an untrusted source Attribute filtering is currently based on a blacklist, which right now includes all event handler attributes (they contain JavaScipt code). It should be switched to a whitelist, but going over all of the HTML5 spec requires a significant amount of time.
2014-04-20cindex.py: Avoid deprecated functionAlp Toker
Implement Diagnostic::category_name() using clang_getDiagnosticCategoryText() instead of the deprected clang_getDiagnosticCategoryName(). Preserves existing behaviour and API covered by existing tests.