Summary:
Previously the `_tu` was not propagated to the returned cursor, leading to errors when calling any
method on that cursor (e.g. `cursor.referenced`).
Reviewers: jbcoe, rsmith
Reviewed By: jbcoe
Subscribers: cfe-commits
Tags: #clang
Patch by jklaehn (Johann Klähn)
Differential Revision: https://reviews.llvm.org/D36953
llvm-svn: 313913
Introduce the 'TLS Kind' property of variable declarations through
libclang. Additionally, provide a Python accessor for it, and test that
functionality.
Patch by Masud Rahman!
llvm-svn: 313111
This commit allows checking whether an enum declaration is scoped
through libclang and clang.cindex (Python).
Patch by Johann Klähn!
Differential Revision: https://reviews.llvm.org/D35187
llvm-svn: 307771
This commit allows checking whether an enum declaration is scoped
through libclang and clang.cindex (Python).
Differential Revision: https://reviews.llvm.org/D35187
llvm-svn: 307769
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
llvm-svn: 306483
Expose the following functions:
- clang_getTypedefName
- clang_getAddressSpace
Patch by Simon Perretta.
Differential Revision: https://reviews.llvm.org/D33598
llvm-svn: 304978
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
llvm-svn: 303626
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
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
llvm-svn: 294754
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
llvm-svn: 292247
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
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
This makes it easier for tools using the Python libclang bindings to display
diagnostics in a manner consistent with clang.
Patch by Omar Sandoval!
llvm-svn: 278315
This patch corresponds to reviews:
http://reviews.llvm.org/D15120http://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.
llvm-svn: 268898
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
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
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).
llvm-svn: 266460
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.
llvm-svn: 266186
These attributes were previously unexposed. Expose them through the libclang
interfaces. Add tests that cover both the MSVC spelling and the GNU spelling.
llvm-svn: 255273
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
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
clang_getCursorSpelling() doesn't assert on non-declarations any more and the
behaviour is covered by c-index tests.
Passes nosetests.
llvm-svn: 211482
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
Until now all CUDA-specific attributes were represented with
CXCursor_UnexposedAttr; now they are actually implemented, including the Python
bindings.
llvm-svn: 209767