aboutsummaryrefslogtreecommitdiff
path: root/clang/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorIngo Müller <ingomueller@google.com>2025-02-19 08:07:49 +0100
committerGitHub <noreply@github.com>2025-02-19 08:07:49 +0100
commit6b67aac31377992465c419b5a296f9a7ba8e7984 (patch)
treeb82cc01180a77324e087b54589987181b8851655 /clang/tools/c-index-test/c-index-test.c
parent1c02c8f6fcbea1750e0c50c8a22af29b19588d72 (diff)
downloadllvm-6b67aac31377992465c419b5a296f9a7ba8e7984.zip
llvm-6b67aac31377992465c419b5a296f9a7ba8e7984.tar.gz
llvm-6b67aac31377992465c419b5a296f9a7ba8e7984.tar.bz2
[mlir:python] Improve `mlir_(attribute|type|value)_subclass` for `nanobind`s `stubgen` (#127584)
This PR makes several improvements to the stubs that are created by `mlir_(attribute|type|value)_subclass`. First, the PR sets the `__module__` attribute of the classes generated by the nanobind adaptors for attributes, types, and values (via `mlir_(attribute|type|value)_subclass`). By default, the `__module__` property is set to `importlib._bootstrap`, which isn't where we want the new class to live. The new logic sets the property to the name of the module provided as `scope` instead. This also makes nanobind's `stubgen` generate stubs for those classes properly, which ignores classes whose `__module__` does not correspond to the module it is generating stubs for. This resolves #127518. Second, the PR overwrites the function signatures generated by `stubgen` to a format that uses the desired type names (e.g., `mlir.ir.Attribute` instead of `MlirAttribute`). Finally, the PR piggy-backs some minor doc and style improvements to `PythonAdaptors.h`. --------- Signed-off-by: Ingo Müller <ingomueller@google.com>
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
0 files changed, 0 insertions, 0 deletions