383 Commits

Author SHA1 Message Date
theRonShark
00aede8f19
Revert "[Clang][OpenMP] Implement Loop splitting #pragma omp split directive " (#190335)
Reverts llvm/llvm-project#183261

15 new lit tests failing in openmp
2026-04-03 12:27:07 +00:00
Amit Tiwari
1972cf64fd
[Clang][OpenMP] Implement Loop splitting #pragma omp split directive (#183261)
OpenMP 6.0 Loop-splitting directive `#pragma omp split` construct with `counts`
clause
2026-04-03 10:42:31 +05:30
Thomas Applencourt
add5b811ae
[libclang/python] Renaming get_version into get_clang_version (#188515)
Rename `get_version` to `get_clang_version` to match the `libclang.so`
name[1], and be clear we doesn't return some `cindex.py` internal
versioning but the `libclang.so` one.

[1] This match was some current API are doing for example
`conf.lib.clang_getArraySize` is mapped to `get_array_size`.
2026-03-27 07:47:00 +04:00
Jannick Kremer
82eee26ccc
[libclang/python] Fix Type.get_offset annotation (#187841)
As discussed in
https://github.com/llvm/llvm-project/pull/180876#discussion_r2934372753,
`Type.get_offset` can process `bytes` arguments as well. For consistency
with other functions taking `str` arguments, its type annotation is
adapted to reflect this.
2026-03-21 23:51:56 +09:00
efferre79
656fce889c
[libclang/python] export libclang version to the bindings (#86931)
It's useful to know which clang library the python bindings are running.

---------

Co-authored-by: Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>
2026-03-21 17:25:29 +04:00
Jannick Kremer
2f076c383e
[libclang/python] Deprecate _CXUnsavedFile, introduce UnsavedFile instead (#187412)
To maintain consistency with other classes mirrored from libclang, the
`_CX` prefix should be removed.
The old name is introduced as a subclass of the renamed class, and
deprecation warnings are added on every attribute access.
2026-03-20 08:33:01 +09:00
Jannick Kremer
3a75683110
[libclang/python] Add type annotations to the TranslationUnit class (#180876)
This adds type annotations to the `TranslationUnit` class, enough to
pass a strict typecheck. This resolves 19 strict typing errors as the
next step towards https://github.com/llvm/llvm-project/issues/76664
2026-03-18 13:33:35 +09:00
Miko
0f7791e9d8 [clang][Python] Use str.format instead of string concatenations (#173861)
This PR replaces string concatenations and the older `%` string
interpolation with `str.format`. Changes along those lines were
originally a part of #173845, but they were moved to a new PR,
where it was decided that `str.format` is preferable over
f-strings.

Changes in this commit are identical to
abf1d0bea04ab5d5ed1be3708ce1cd86707d5c8f, but commit title and
description were changed to correctly reflect the changes.
2026-02-15 19:57:22 +03:00
Vlad Serebrennikov
152d811de1 Revert "[clang][Python] Use fstrings instead of string concatenations (#173861)"
This reverts commit abf1d0bea04ab5d5ed1be3708ce1cd86707d5c8f,
because its title and description are entirely wrong.
f-strings is what was initially proposed, but then it was decided
to go with `str.format`.
2026-02-15 19:50:03 +03:00
Miko
abf1d0bea0
[clang][Python] Use fstrings instead of string concatenations (#173861)
This PR replaces string concatenations and the older `%` string
interpolation with fstrings. These changes were originally part of
#173845 but have been moved to a new PR.
2026-02-15 05:23:22 +04:00
Jannick Kremer
5dbeb29bf9
[libclang/python] Type-annotate SourceLocation and SourceRange (#180193)
This adds type annotations to the `SourceLocation` and `SourceRange`
classes, enough to pass a strict typecheck. This resolves 29 strict
typing errors as the next step towards
https://github.com/llvm/llvm-project/issues/76664
2026-02-08 09:09:14 +09:00
Jannick Kremer
59f815b047
[libclang/python] Deprecate CodeCompletionResults.results (#177764)
This partially addresses point 5 from
https://github.com/llvm/llvm-project/issues/156680.
2026-02-01 23:15:38 +09:00
Jannick Kremer
09b62ed0c9
[libclang/python] Ignore our own DeprecationWarnings in tests (#178631)
Suppress `DeprecationWarnings` raised in the libclang python tests. Also
ensure that they are returned where expected.
Resolves #178203
2026-01-31 02:36:20 +09:00
Jannick Kremer
7d60fe3cbd
[libclang/python] Add deprecation warnings to CompletionChunk.isKind methods (#177854)
This adresses point 3 from
https://github.com/llvm/llvm-project/issues/156680.

---------

Co-authored-by: Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>
2026-01-26 20:13:11 +09:00
Jannick Kremer
21fdd49c24
[libclang/python] Move SPELLING_CACHE into CodeCompletion (#177586)
This adresses point 2 from
https://github.com/llvm/llvm-project/issues/156680.

Also add a dummy object that serves as an alias to `SPELLING_CACHE`,
used to replicate the old behavior and throw a `DeprecationWarning`.
2026-01-25 19:58:03 +09:00
Jannick Kremer
c3e226bd9c
[NFC][libclang/python] Move CompletionChunkKind definition before CompletionChunk (#177723)
This is a required step for the 2nd point of #156680.
It is separated into a different PR for readibility, as has been
suggested here
https://github.com/llvm/llvm-project/pull/177586#pullrequestreview-3697864205
2026-01-24 12:08:21 +09:00
Jannick Kremer
a648128194
[libclang/python] Add CompletionChunkKind enum and deprecate old CompletionChunk.Kind (#176631)
This adresses point 1 from
https://github.com/llvm/llvm-project/issues/156680.
Since step 4 is already completed, `CompletionChunk.Kind` becomes unused
in this PR, so it is removed.
2026-01-23 18:05:39 +09:00
Jannick Kremer
dc3a902abe
Use existing AvailabilityKind enum for code completion availability (#160296)
This adresses point 4 from #156680. This is a necessary step before
`CompletionChunk.Kind` can be removed.

The `ChunkCompletion.Kind` implements `__str__` and `__repr__`
differently from our other enum classes. I have adapted the `__repr__`
of `CompletionString` to stringify the availability of the chunk
differently so that it still looks the same as before.

Also introduce a temporary `AvailabilityKindCompat` to ensure that
`__str__` returns the same format, while also leaving a deprecation
warning that this will be removed in a future release.

---------

Co-authored-by: Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>
2026-01-17 23:37:51 +09:00
Thomas Applencourt
3fd31924c5
[libclang/python] Add check for reparsing (#172373)
Add error checking for `reparseTranslationUnit`.
2025-12-20 00:09:00 +04:00
Thomas Applencourt
e98a765020
[libclang/python] Remove unused exception variable (#172516)
Remove unused CompilationDatabaseError variable (fixes #172374)
2025-12-17 07:57:19 +09:00
Thomas Applencourt
385f1866ad
[libclang/python] Remove unused import in example (#172369)
Remove unused `OptionGroup` import in  some `cindex.py` example.
2025-12-16 22:29:22 +09:00
Thomas Applencourt
a0622a66c7
[libclang/python] Add LIBCLANG_LIBRARY_PATH and LIBCLANG_LIBRARY_FILE (#170201)
Close #167421 

This PR adds the environment variables ``LIBCLANG_LIBRARY_PATH`` and
``LIBCLANG_LIBRARY_FILE``, which allow users to specify the directory
path and the exact library file that should be used to locate libclang.

---------

Co-authored-by: Jannick Kremer <jannick.kremer@mailbox.org>
Co-authored-by: Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>
2025-12-16 22:15:11 +09:00
Thomas Applencourt
89658f5482
[libclang/python] Fix cindex test for cpp lang (#172368)
Fix typo in cindex.py where the C++ support test was incorrectly named
test_c instead of test_cpp
2025-12-16 08:10:11 +09:00
Ryan Mast
e6f2fbb0fa
[libclang/python] Enable packaging clang python bindings (#125806)
This adds a pyproject.toml file for packaging the clang Python bindings
as a sdist tarball and pure Python wheel packages for the clang python
bindings. It is required to move updates of the clang and libclang PyPI
packages to the LLVM monorepo. Versioning information is derived from
LLVM git tags (using hatch-vcs, which is based on setuptools_scm), so no
manual updates are needed to bump version numbers. The minimum python
version required is set to 3.10 due to cindex.py using PEP 604 union
type syntax (str | bytes | None).

The .git_archival.txt file is populated with version information needed
to get accurate version information if the bindings are installed from
an LLVM/clang source code archive. The .gitignore file is populated with
files that may get created as part of building/testing the sdist and
wheel that should not be committed to source control.

This is first step for addressing #125220, and moving publishing of the
clang and libclang PyPI packages into the LLVM monorepo.

Signed-off-by: Ryan Mast <mast.ryan@gmail.com>
2025-11-24 17:21:24 -08:00
Thomas Applencourt
a04ceb02ad
[libclang/python] Return actual C types from libclang functions instead of Python bool (#166446)
In the previous implementation, 43 libclang functions are registered in
FUNCTION_LIST with return type ctypes.c_bool. However, none of these
functions actually return a C bool type; instead, they return unsigned
or signed integers (unsigned int / int) on the C side.

Although ctypes automatically casts nonzero integers to True and zero to
False, this implicit conversion hides the "true" c-return type.

This PR updates those functions to use their proper “native” ctypes
return types (c_uint or c_int) and updates the corresponding Python
convenience wrappers to explicitly cast their results using the bool
constructor.

As a side effect, the related `# type: ignore` annotations have been
removed, as they are no longer necessary.

Some libclang functions are used directly without any intermediate
Python wrapper. These functions (`clang_equalCursors`,
`clang_equalLocations`, `clang_equalRanges`, `clang_equalTypes`,
`clang_File_isEqual`, and `clang_isFileMultipleIncludeGuarded`) are now
explicitly cast to bool at their call sites. Note that
`clang_isFileMultipleIncludeGuarded` is never called in the binding.

Thix fix #164915.
2025-11-07 13:00:54 +04:00
Thomas Applencourt
855a3e974d
[libclang/python] Add isFunctionInlined support (#162882)
`cindex.py` was missing support for
[isFunctionInlined](https://clang.llvm.org/doxygen/group__CINDEX__TYPES.html#ga963097b9aecabf5dce7554dff18b061d),
this PR add it.

---------

Co-authored-by: Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>
2025-10-31 00:26:13 +04:00
Thomas Applencourt
5f20b5a267
[clang] Fix Typo on cindex.py (#92945)
Co-authored-by: Thomas Applencourt <TApplencourt@users.noreply.github.com>
2025-10-22 08:12:45 +09:00
Jannick Kremer
38a52828fa
[libclang/python] Return None instead of null cursors from Token.cursor (#163183)
Since https://github.com/llvm/llvm-project/pull/138103 , the `Cursor`
class throws an error when any of its methods is called on a null
cursor. Simultaneously, we adapted all methods to return `None` instead
of a null cursor, so users should not encounter these. We have
overlooked one way to end up with null cursors, namely the
`Token.cursor` property, which may return null cursors under some
circumstances.

Fixes #163180
2025-10-13 13:56:54 +00:00
Walter J.T.V
cd4c5280c7
[Clang][OpenMP][LoopTransformations] Implement "#pragma omp fuse" loop transformation directive and "looprange" clause (#139293)
This change implements the fuse directive, `#pragma omp fuse`, as specified in the OpenMP 6.0, along with the `looprange` clause in clang.

This change also adds minimal stubs so flang keeps compiling (a full implementation in flang of this directive is still pending).

---------

Co-authored-by: Roger Ferrer Ibanez <roger.ferrer@bsc.es>
2025-09-29 07:48:18 +02:00
Jannick Kremer
508748dd9e
[libclang/python] Fix OpenMP and OpenACC CursorKinds name format (#160295)
Missing `CursorKind`s that were added in #143264 follow the name format
of Index.h instead of those in cindex.py. Adapt the names accordingly.
2025-09-25 14:35:58 +02:00
Jannick Kremer
4dc0513f61
[libclang/python] Sync python kinds with Index.h enums (#143264)
Add tests to ensure that all C-enum variants are defined on Python side,
and that the Python bindings do not contain variants not defined on the C side
2025-09-18 14:34:20 +02:00
Jannick Kremer
63dc07f7d5
[libclang/python] Fix numResults field type of CCRStructure (#158598)
Fix the type of the `numResults` field of `CCRStructure`, as pointed out
here:
https://github.com/llvm/llvm-project/pull/140539#discussion_r2317808734
2025-09-16 09:17:35 +02:00
Jannick Kremer
9a6c0ea161
[libclang/python] Add type annotations for code completion classes (#140539)
This fully annotates the code completion classes (CompletionChunk,
CompletionString, CodeCompletionResult, CodeCompletionResults and
CCRStructure) resolving 59 strict typing errors as the next step towards
#76664
2025-09-04 16:44:25 +02:00
David Tenty
63195d3d7a
[NFC][CMake] quote ${CMAKE_SYSTEM_NAME} consistently (#154537)
A CMake change included in CMake 4.0 makes `AIX` into a variable
(similar to `APPLE`, etc.)
ff03db6657

However, `${CMAKE_SYSTEM_NAME}` unfortunately also expands exactly to
`AIX` and `if` auto-expands variable names in CMake. That means you get
a double expansion if you write:

`if (${CMAKE_SYSTEM_NAME}  MATCHES "AIX")`
which becomes:
`if (AIX  MATCHES "AIX")`
which is as if you wrote:
`if (ON MATCHES "AIX")`

You can prevent this by quoting the expansion of "${CMAKE_SYSTEM_NAME}",
due to policy
[CMP0054](https://cmake.org/cmake/help/latest/policy/CMP0054.html#policy:CMP0054)
which is on by default in 4.0+. Most of the LLVM CMake already does
this, but this PR fixes the remaining cases where we do not.
2025-08-20 12:45:41 -04:00
Jimmy Z
e20dd94bb3
[libclang/python] Expose clang_getCursorLanguage via Cursor.language (#152897) 2025-08-11 14:50:29 +02:00
Matheus Izvekov
91cdd35008
[clang] Improve nested name specifier AST representation (#147835)
This is a major change on how we represent nested name qualifications in
the AST.

* The nested name specifier itself and how it's stored is changed. The
prefixes for types are handled within the type hierarchy, which makes
canonicalization for them super cheap, no memory allocation required.
Also translating a type into nested name specifier form becomes a no-op.
An identifier is stored as a DependentNameType. The nested name
specifier gains a lightweight handle class, to be used instead of
passing around pointers, which is similar to what is implemented for
TemplateName. There is still one free bit available, and this handle can
be used within a PointerUnion and PointerIntPair, which should keep
bit-packing aficionados happy.
* The ElaboratedType node is removed, all type nodes in which it could
previously apply to can now store the elaborated keyword and name
qualifier, tail allocating when present.
* TagTypes can now point to the exact declaration found when producing
these, as opposed to the previous situation of there only existing one
TagType per entity. This increases the amount of type sugar retained,
and can have several applications, for example in tracking module
ownership, and other tools which care about source file origins, such as
IWYU. These TagTypes are lazily allocated, in order to limit the
increase in AST size.

This patch offers a great performance benefit.

It greatly improves compilation time for
[stdexec](https://github.com/NVIDIA/stdexec). For one datapoint, for
`test_on2.cpp` in that project, which is the slowest compiling test,
this patch improves `-c` compilation time by about 7.2%, with the
`-fsyntax-only` improvement being at ~12%.

This has great results on compile-time-tracker as well:

![image](https://github.com/user-attachments/assets/700dce98-2cab-4aa8-97d1-b038c0bee831)

This patch also further enables other optimziations in the future, and
will reduce the performance impact of template specialization resugaring
when that lands.

It has some other miscelaneous drive-by fixes.

About the review: Yes the patch is huge, sorry about that. Part of the
reason is that I started by the nested name specifier part, before the
ElaboratedType part, but that had a huge performance downside, as
ElaboratedType is a big performance hog. I didn't have the steam to go
back and change the patch after the fact.

There is also a lot of internal API changes, and it made sense to remove
ElaboratedType in one go, versus removing it from one type at a time, as
that would present much more churn to the users. Also, the nested name
specifier having a different API avoids missing changes related to how
prefixes work now, which could make existing code compile but not work.

How to review: The important changes are all in
`clang/include/clang/AST` and `clang/lib/AST`, with also important
changes in `clang/lib/Sema/TreeTransform.h`.

The rest and bulk of the changes are mostly consequences of the changes
in API.

PS: TagType::getDecl is renamed to `getOriginalDecl` in this patch, just
for easier to rebasing. I plan to rename it back after this lands.

Fixes #136624
Fixes https://github.com/llvm/llvm-project/issues/43179
Fixes https://github.com/llvm/llvm-project/issues/68670
Fixes https://github.com/llvm/llvm-project/issues/92757
2025-08-09 05:06:53 -03:00
Jannick Kremer
7a9bef0166
Revert "Move python binding tests to lit framework" (#149012)
This reverts commit f8707f994af2582f6dc58190106946efeb43bf05.
2025-07-16 05:32:08 +01:00
Jannick Kremer
ec149d5ef8
[clang][python][test] Move python binding tests to lit framework (#148802)
As discussed in PR #142353, the current testsuite of the `clang` Python
bindings has several issues:

- It `libclang.so` cannot be loaded into `python` to run the testsuite,
the whole `ninja check-all` aborts.
- The result of running the testsuite isn't report like the `lit`-based
tests, rendering them almost invisible.
- The testsuite is disabled in a non-obvious way (`RUN_PYTHON_TESTS`) in
`tests/CMakeLists.txt`, which again doesn't show up in the test results.

All these issues can be avoided by integrating the Python bindings tests
with `lit`, which is what this patch does:

- The actual test lives in `clang/test/bindings/python/bindings.sh` and
is run by `lit`.
- The current `clang/bindings/python/tests` directory (minus the
now-subperfluous `CMakeLists.txt`) is moved into the same directory.
- The check if `libclang` is loadable (originally from PR #142353) is
now handled via a new `lit` feature, `libclang-loadable`.
- The various ways to disable the tests have been turned into `XFAIL`s
as appropriate. This isn't complete and not completely tested yet.

Tested on `sparc-sun-solaris2.11`, `sparcv9-sun-solaris2.11`,
`i386-pc-solaris2.11`, `amd64-pc-solaris2.11`, `i686-pc-linux-gnu`, and
`x86_64-pc-linux-gnu`.

Co-authored-by: Rainer Orth <ro@gcc.gnu.org>
2025-07-15 12:48:24 +02:00
Jannick Kremer
d66254e7fe
Revert " Move python binding tests to lit framework (#146844)" (#146931)
This reverts commit 2532bde0388980ac7e299b02bc554e6fde6c686e.
2025-07-03 19:34:19 +02:00
Jannick Kremer
2532bde038
[clang][python][test] Move python binding tests to lit framework (#146844)
As discussed in PR #142353, the current testsuite of the `clang` Python
bindings has several issues:

- It `libclang.so` cannot be loaded into `python` to run the testsuite,
the whole `ninja check-all` aborts.
- The result of running the testsuite isn't report like the `lit`-based
tests, rendering them almost invisible.
- The testsuite is disabled in a non-obvious way (`RUN_PYTHON_TESTS`) in
`tests/CMakeLists.txt`, which again doesn't show up in the test results.

All these issues can be avoided by integrating the Python bindings tests
with `lit`, which is what this patch does:

- The actual test lives in `clang/test/bindings/python/bindings.sh` and
is run by `lit`.
- The current `clang/bindings/python/tests` directory (minus the
now-subperfluous `CMakeLists.txt`) is moved into the same directory.
- The check if `libclang` is loadable (originally from PR #142353) is
now handled via a new `lit` feature, `libclang-loadable`.
- The various ways to disable the tests have been turned into `XFAIL`s
as appropriate. This isn't complete and not completely tested yet.

Tested on `sparc-sun-solaris2.11`, `sparcv9-sun-solaris2.11`,
`i386-pc-solaris2.11`, `amd64-pc-solaris2.11`, `i686-pc-linux-gnu`, and
`x86_64-pc-linux-gnu`.

Co-authored-by: Rainer Orth <ro@gcc.gnu.org>
2025-07-03 13:56:54 +02:00
Jannick Kremer
c863e0ebc2
Revert "Move python binding tests to lit framework (#146486)" (#146789)
This reverts commit a75587d2718f76dc53112065da36e08d04034eb9.
2025-07-02 23:41:01 +02:00
Jannick Kremer
a75587d271
[clang][python][test] Move python binding tests to lit framework (#146486)
As discussed in PR #142353, the current testsuite of the `clang` Python
bindings has several issues:

- It `libclang.so` cannot be loaded into `python` to run the testsuite,
the whole `ninja check-all` aborts.
- The result of running the testsuite isn't report like the `lit`-based
tests, rendering them almost invisible.
- The testsuite is disabled in a non-obvious way (`RUN_PYTHON_TESTS`) in
`tests/CMakeLists.txt`, which again doesn't show up in the test results.

All these issues can be avoided by integrating the Python bindings tests
with `lit`, which is what this patch does:

- The actual test lives in `clang/test/bindings/python/bindings.sh` and
is run by `lit`.
- The current `clang/bindings/python/tests` directory (minus the
now-subperfluous `CMakeLists.txt`) is moved into the same directory.
- The check if `libclang` is loadable (originally from PR #142353) is
now handled via a new `lit` feature, `libclang-loadable`.
- The various ways to disable the tests have been turned into `XFAIL`s
as appropriate. This isn't complete and not completely tested yet.

Tested on `sparc-sun-solaris2.11`, `sparcv9-sun-solaris2.11`,
`i386-pc-solaris2.11`, `amd64-pc-solaris2.11`, `i686-pc-linux-gnu`, and
`x86_64-pc-linux-gnu`.

Co-authored-by: Rainer Orth <ro@gcc.gnu.org>
2025-07-02 10:11:48 +02:00
dyung
b0500f56c8
Revert "[clang][python][test] Move python binding tests to lit framework" (#145951)
Reverts llvm/llvm-project#145855

The test added is XPASS-ing on a bot:
https://lab.llvm.org/buildbot/#/builders/144/builds/28623
2025-06-26 15:02:14 -04:00
Rainer Orth
90c9cc2c98
[clang][python][test] Move python binding tests to lit framework (#145855)
As discussed in PR #142353, the current testsuite of the `clang` Python
bindings has several issues:

- If `libclang.so` cannot be loaded into `python` to run the testsuite,
the whole `ninja check-all` aborts.
- The result of running the testsuite isn't report like the `lit`-based
tests, rendering them almost invisible.
- The testsuite is disabled in a non-obvious way (`RUN_PYTHON_TESTS`) in
`tests/CMakeLists.txt`, which again doesn't show up in the test results.

All these issues can be avoided by integrating the Python bindings tests
with `lit`, which is what this patch does:

- The actual test lives in `clang/test/bindings/python/bindings.sh` and
is run by `lit`.
- The current `clang/bindings/python/tests` directory (minus the
now-superfluous `CMakeLists.txt`) is moved into the same directory.
- The check if `libclang` is loadable (originally from PR #142353) is
now handled via a new `lit` feature, `libclang-loadable`.
- The various ways to disable the tests have been turned into `XFAIL`s
as appropriate.
- AArch64 doesn't `FAIL` any longer, so no `XFAIL` is necessary.
- It keeps the `check-clang-python` target for use by the Clang Python
CI.

Tested on `sparc-sun-solaris2.11`, `sparcv9-sun-solaris2.11`,
`i386-pc-solaris2.11`, `amd64-pc-solaris2.11`, `i686-pc-linux-gnu`, and
`x86_64-pc-linux-gnu`.
2025-06-26 16:34:10 +02:00
Jannick Kremer
0c359d747d
Revert "Move python binding tests to lit framework (#142948)" (#145774)
This reverts commit 7dfcced079e3e7962cbbf780ebf4a472fbf4baf3 since it
casued a buildfailure:
https://lab.llvm.org/buildbot/#/builders/46/builds/19019
2025-06-25 22:13:20 +02:00
Rainer Orth
7dfcced079
[clang][python][test] Move python binding tests to lit framework (#142948)
As discussed in PR #142353, the current testsuite of the `clang` Python
bindings has several issues:

- If `libclang.so` cannot be loaded into `python` to run the testsuite,
the whole `ninja check-all` aborts.
- The result of running the testsuite isn't report like the `lit`-based
tests, rendering them almost invisible.
- The testsuite is disabled in a non-obvious way (`RUN_PYTHON_TESTS`) in
`tests/CMakeLists.txt`, which again doesn't show up in the test results.

All these issues can be avoided by integrating the Python bindings tests
with `lit`, which is what this patch does:

- The actual test lives in `clang/test/bindings/python/bindings.sh` and
is run by `lit`.
- The current `clang/bindings/python/tests` directory (minus the
now-superfluous `CMakeLists.txt`) is moved into the same directory.
- The check if `libclang` is loadable (originally from PR #142353) is
now handled via a new `lit` feature, `libclang-loadable`.
- The various ways to disable the tests have been turned into `XFAIL`s
as appropriate. This isn't complete and not completely tested yet.
- It keeps the `check-clang-python` target for use by the Clang Python
CI.

Tested on `sparc-sun-solaris2.11`, `sparcv9-sun-solaris2.11`,
`i386-pc-solaris2.11`, `amd64-pc-solaris2.11`, `i686-pc-linux-gnu`, and
`x86_64-pc-linux-gnu`.
2025-06-25 21:37:03 +02:00
Zokre Zyl
e7cd6b48c0
[libclang/python] Add TypeKind.FLOAT16 (#142634)
Adds FLOAT16 enum for value 32

Fixes #142633
2025-06-06 11:14:57 +02:00
Jannick Kremer
adbbb9049b
[libclang/python] Simplify __eq__ operators (#140540)
This allows us to remove a few type: ignores.
2025-06-05 08:35:21 +02:00
Jannick Kremer
c5da47108a
[libclang/python] Properly report errors when test fails (#142371)
test_cdb.py's test_create_fail captures stderr to suppress output but
did not release it in case the test fails.
2025-06-02 16:14:39 +02:00
Vlad Serebrennikov
8231182fed
[libclang/python][NFC] Document how null cursors are handled (#140499)
Now that we looked at this aspect closely and fixed things, I think we
can document this.
2025-05-19 12:30:22 +04:00