[clang] [llvm] [clang][python][test] Move python binding tests to lit framework (PR #142948)

2025-06-12 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: LGTM now. I'd just like the libclang Python CI to run, but for some reason it doesn't seem to trigger... https://github.com/llvm/llvm-project/pull/142948 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [libclang/python] Add missing enum variants (PR #143264)

2025-06-07 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/143264 >From 71a404a5bbef81fa0aba48eb14671ed17ce4d8fb Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 7 Jun 2025 21:57:17 +0900 Subject: [PATCH 1/2] [libclang/python] Add missing enum variants Add tests

[clang] [libclang/python] Add missing enum variants (PR #143264)

2025-06-07 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll this adds the missing enum variants, and also adds a test using libclang, parsing `Index.h` for all our used enums to check for missing variants. You can see what this looks like in case of failure on the first CI run for this PR. This uses only the numeric enum v

[clang] [libclang/python] Add missing enum variants (PR #143264)

2025-06-07 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/143264 >From cee0067c7a0b35d2e1f15fd3fa698ec2afd6de88 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 7 Jun 2025 21:57:17 +0900 Subject: [PATCH 1/2] [libclang/python] Add missing enum variants Add tests

[clang] [libclang/python] Add missing enum variants (PR #143264)

2025-06-07 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/143264 Add tests to ensure that all C-enum variants are defined on Python side. >From cee0067c7a0b35d2e1f15fd3fa698ec2afd6de88 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 7 Jun 2025 21:57:17 +0900 Su

[clang] [libclang/python] Derive library function types from annotations (PR #142120)

2025-06-07 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: Yup that summarizes it pretty well. So I don't see this having more than a very limited use, and for that it's not worth the various overheads and intransparencies it introduces. Shall I close this? https://github.com/llvm/llvm-project/pull/142120 __

[clang] [libclang/python] Derive library function types from annotations (PR #142120)

2025-06-06 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll I think I might not have been clear, the issue I am the most concerned about is the following. As an example, consider `clang_PrintingPolicy_getProperty`. Previously, it was defined in `FUNCTION_LIST` as ```python ("clang_PrintingPolicy_getProperty", [PrintingPolic

[clang] [clang][python][test] Move python binding tests to lit framework (PR #142948)

2025-06-06 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: > I've got no explanation why your explicit raise didn't come through (but then > I known very little Python). Strange, I'll see if I can find out why, but as long as it works also for the expected failure case for you, that's good enough for me. > am at a bit of a loss ho

[clang] Added TypeKind.FLOAT16 for 32 in cindex.py (PR #142634)

2025-06-06 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: Great, thank you! > IMHO: I guess a relevant test case is to take some huge relevant project, > maybe LLVM itself and parse all their files and walk through all the nodes of > the ast through all the members/methods recursively The problem is that this depends on the funct

[clang] Added TypeKind.FLOAT16 for 32 in cindex.py (PR #142634)

2025-06-06 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed https://github.com/llvm/llvm-project/pull/142634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-06-05 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. https://github.com/llvm/llvm-project/pull/141657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Derive library function types from annotations (PR #142120)

2025-06-05 Thread Jannick Kremer via cfe-commits
@@ -3986,256 +3987,588 @@ def set_property(self, property, value): # Now comes the plumbing to hook up the C library. # Register callback types -translation_unit_includes_callback = CFUNCTYPE( +translation_unit_includes_callback: TypeAlias = CFUNCTYPE( # type: ignore [valid-

[clang] [clang][python][test] Move python binding tests to lit framework (PR #142948)

2025-06-05 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: Thank you for the PR, imo this is a much better approach than the previous one. As I mentioned before, I'm not familiar with the testing infrastructure, but insofar as it works, this looks good to me. Do note that the libclang CI should also be adapte

[clang] [libclang/python] Derive library function types from annotations (PR #142120)

2025-06-04 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/142120 >From 4669be22f731faf9ce0985aa634166c30c7025c6 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Fri, 30 May 2025 19:54:15 +0900 Subject: [PATCH] [libclang/python] Derive library function types from anno

[clang] Added TypeKind.FLOAT16 for 32 in cindex.py (PR #142634)

2025-06-04 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: > Time to put libclang to use, and parse cindex.h? Probably, though I'll check if there are any more direct options first. I don't quite like the idea of hardcoding source file paths in the tests of a binding. https://github.com/llvm/llvm-project/pull/142634 ___

[clang] Added TypeKind.FLOAT16 for 32 in cindex.py (PR #142634)

2025-06-04 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. Thanks for the PR, LGTM I'll merge this once you've checked the private email setting as described in the bot comment. CC @Endilll : Seems like we're missing a bunch of `TypeKind`s, currently missing 33 - 39 and 179 - 181 enum variant

[clang] [clang][python][test] Check if libclang.so is loadable (PR #142353)

2025-06-03 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: I am unfortunately not at all familiar with how exactly the other tests are integrated and produce the outputs you described: > One problem with all these approaches, as I'd already mentioned, is that the > test outcome isn't properly reported, nor can one use the usual mach

[clang] [libclang/python] Properly report errors when test fails (PR #142371)

2025-06-02 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed https://github.com/llvm/llvm-project/pull/142371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Properly report errors when test fails (PR #142371)

2025-06-02 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll I was too lazy to reproduce the exact issue (installing 32bit library and rebuilding Clang etc.) but I've forced this with a different error. The symptom (`EEE%` output on testing runs) is not specific to that one issue, but occurs whenever the `get_cindex_lib

[clang] [clang][python][test] Check if libclang.so is loadable (PR #142353)

2025-06-02 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: > Besides, one could just change the wording of the warning message: trying to > load a 32-bit libclang.so into a 64-bit python is always an error, testsuite > or no. That's why you shouldn't return an exit code of 0 when this error occurs. Moreover, this seems like a worka

[clang] [clang][python][test] Check if libclang.so is loadable (PR #142353)

2025-06-02 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: > Given the fact that OSError already contains the message that indicates the > problem, I think we should explore why it's not properly emitted in the first > place, before introducing bespoke ways of delivering error messages. > @DeinAlptraum any thoughts here? This has

[clang] [libclang/python] Properly report errors when test fails (PR #142371)

2025-06-02 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: This issue has been raised in https://github.com/llvm/llvm-project/pull/142353#pullrequestreview-2887698305 https://github.com/llvm/llvm-project/pull/142371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [libclang/python] Properly report errors when test fails (PR #142371)

2025-06-02 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/142371 test_cdb.py's test_create_fail captures stderr to suppress output but did not release it in case the test fails. >From 4b16005e56a631c4459bca55fb396483eeea3ac6 Mon Sep 17 00:00:00 2001 From: Jannick Kremer

[clang] [libclang/python] Derive library function types from annotations (PR #142120)

2025-05-30 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: Hmm so on the CI it fails for some reason... locally, the tests passed as usual without me having to change anything at all, except for the one test that checks used library functions. https://github.com/llvm/llvm-project/pull/142120

[clang] [libclang/python] Derive library function types from annotations (PR #142120)

2025-05-30 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll this is an attempt at implementing what we've discussed previously: defining the library function signatures only in a single place in a way that serves both as type annotations for the library functions and registering the correct library function types on the lib

[clang] [libclang/python] Derive library function types from annotations (PR #142120)

2025-05-30 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/142120 This is a PoC for now >From 4669be22f731faf9ce0985aa634166c30c7025c6 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Fri, 30 May 2025 19:54:15 +0900 Subject: [PATCH] [libclang/python] Derive library fu

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-27 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/141657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-27 Thread Jannick Kremer via cfe-commits
@@ -358,3 +358,46 @@ Complete example code .. _Index.h: https://github.com/llvm/llvm-project/blob/main/clang/include/clang-c/Index.h + +.. _Stability: + +ABI and API Stability +- + +The C interfaces in libclang are intended to be relatively stable. This a

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-27 Thread Jannick Kremer via cfe-commits
@@ -358,3 +358,46 @@ Complete example code .. _Index.h: https://github.com/llvm/llvm-project/blob/main/clang/include/clang-c/Index.h + +.. _Stability: + +ABI and API Stability +- + +The C interfaces in libclang are intended to be relatively stable. This a

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-27 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. This looks reasonable to me, but I'm coming from the Python bindings anyway and can't comment on the details for the C/C++ side. https://github.com/llvm/llvm-project/pull/141657 ___ cfe-commi

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-27 Thread Jannick Kremer via cfe-commits
@@ -358,3 +358,46 @@ Complete example code .. _Index.h: https://github.com/llvm/llvm-project/blob/main/clang/include/clang-c/Index.h + +.. _Stability: + +ABI and API Stability +- + +The C interfaces in libclang are intended to be relatively stable. This a

[clang] [libclang/python] Simplify __eq__ operators (PR #140540)

2025-05-19 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: The `# type: ignore [no-any-return]` are added in cases where the return type cannot be inferred, usually the libclang library functions called on the `conf.lib` object, since they are added dynamically. By combining the library call with the `isinstance` check, even withou

[clang] [libclang/python] Simplify __eq__ operators (PR #140540)

2025-05-19 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll I don't see the `__ne__` operator being addded in the diff If you are referring to the "Fix formatting again, again" commit, that just readds the operator after accidentally removing it in the "Fix formatting" commit (I had some issues with my editor yesterday) htt

[clang] [libclang/python] Simplify __eq__ operators (PR #140540)

2025-05-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/140540 >From 51df5f4eb979edb7cc761276fe846626641bd6b4 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Mon, 19 May 2025 22:36:05 +0900 Subject: [PATCH 1/4] [libclang/python] Simplfy __eq__ operators This allows

[clang] [libclang/python] Simplify __eq__ operators (PR #140540)

2025-05-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/140540 >From 51df5f4eb979edb7cc761276fe846626641bd6b4 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Mon, 19 May 2025 22:36:05 +0900 Subject: [PATCH 1/3] [libclang/python] Simplfy __eq__ operators This allows

[clang] [libclang/python] Simplify __eq__ operators (PR #140540)

2025-05-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/140540 >From 51df5f4eb979edb7cc761276fe846626641bd6b4 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Mon, 19 May 2025 22:36:05 +0900 Subject: [PATCH 1/2] [libclang/python] Simplfy __eq__ operators This allows

[clang] [libclang/python] Simplify __eq__ operators (PR #140540)

2025-05-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/140540 This allows us to remove a few type: ignores. >From 51df5f4eb979edb7cc761276fe846626641bd6b4 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Mon, 19 May 2025 22:36:05 +0900 Subject: [PATCH] [libclang/p

[clang] [libclang/python] Add type annotations for code completion classes (PR #140539)

2025-05-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/140539 >From 2d899491a409ede826674d7283df7f594987c355 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Mon, 19 May 2025 22:20:00 +0900 Subject: [PATCH 1/2] [libclang/python] Add type annotations for code compl

[clang] [libclang/python] Add type annotations for code completion classes (PR #140539)

2025-05-19 Thread Jannick Kremer via cfe-commits
@@ -3051,6 +3053,7 @@ def isKindResultType(self): class CompletionString(ClangObject): class Availability: DeinAlptraum wrote: I did not annotate this class because it isn't used. I assume the `availability` property accessing `availabilityKinds` was sup

[clang] [libclang/python] Add type annotations for code completion classes (PR #140539)

2025-05-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/140539 This fully annotates the code completion classes (CompletionChunk, CompletionString, CodeCompletionResult, CodeCompletionResults and CCRStructure) resolving 59 strict typing errors as the next step towards

[clang] [libclang/python][NFC] Document how null cursors are handled (PR #140499)

2025-05-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. https://github.com/llvm/llvm-project/pull/140499 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python][NFC] Explain how null cursors are handled in docstring (PR #140499)

2025-05-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. https://github.com/llvm/llvm-project/pull/140499 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add `Cursor.from_translation_unit` (PR #140496)

2025-05-18 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. LGTM, but are you sure there is a need for this API? This just seems like a slighly less convenient version of `TranslationUnit.cursor`. > This should complete the list of things Cursor can be made from. There is also a `cursor` prope

[clang] [libclang/python] Add typing annotations for the Type class (PR #140378)

2025-05-18 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll > Our error handling story is bad and inconsistent, but that's out of scope of > this PR What sort of improvements would you like to see? Also possibly related, reminder that #102410 is still open https://github.com/llvm/llvm-project/pull/140378

[clang] [libclang/python] Add typing annotations for the Type class (PR #140378)

2025-05-18 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed https://github.com/llvm/llvm-project/pull/140378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Type class (PR #140378)

2025-05-17 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/140378 This fully annotates the Type class, resolving 75 strict typing errors as the next step towards #76664 >From 6218826401a236e3f70073de9e07c3bdefe0b048 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sa

[clang] [libclang/python] Add a few things to the python api (PR #120590)

2025-05-16 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed https://github.com/llvm/llvm-project/pull/120590 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add a few things to the python api (PR #120590)

2025-05-16 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: I am closing this PR since all changes here have been implemented in other PRs: - Additions to the `File` interface: #130383 - Additions to the `Cursor` interface: #132377 - Type annotations: #138103 https://github.com/llvm/llvm-project/pull/120590 __

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-16 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Ensure all used library functions are registered (PR #140015)

2025-05-16 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-16 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/138103 >From 65ad7a888dafc9992793baee8a1ccc27f1b79fa5 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 1 May 2025 18:37:43 +0900 Subject: [PATCH 01/10] [libclang/python] Add typing annotations for the Curs

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-16 Thread Jannick Kremer via cfe-commits
@@ -77,6 +77,8 @@ Clang Frontend Potentially Breaking Changes Clang Python Bindings Potentially Breaking Changes -- +- Calling methods on null-cursors now leads to an exception. +- ``Cursor.from_location`` now returns ``None`` in

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-16 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/138103 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,s

[clang] [libclang/python] Ensure all used library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/140015 >From c3c0adfe4a7dce3568a81594588be53d761b5980 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 15 May 2025 15:58:00 +0900 Subject: [PATCH 1/5] [libclang/python] Ensure all library functions are re

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Jannick Kremer via cfe-commits
@@ -1552,68 +1563,83 @@ class Cursor(Structure): _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)] +_tu: TranslationUnit + @staticmethod -def from_location(tu, location): +def from_location(tu: TranslationUnit, location: SourceLoc

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/138103 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,s

[clang] [libclang/python] Ensure all used library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: Adapted the title and description. https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Ensure all used library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Ensure all used library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Ensure all used library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Jannick Kremer via cfe-commits
@@ -1763,19 +1799,22 @@ def get_usr(self): another translation unit.""" return _CXString.from_result(conf.lib.clang_getCursorUSR(self)) -def get_included_file(self): +@cursor_null_guard +def get_included_file(self) -> File: """Returns the F

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Jannick Kremer via cfe-commits
@@ -1545,6 +1545,16 @@ class ExceptionSpecificationKind(BaseEnumeration): ### Cursors ### +# This guard is used to ensure that no operations are possible on null cursors DeinAlptraum wrote: I added the docstring, but are you sure this makes sense on a decora

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Jannick Kremer via cfe-commits
@@ -1552,68 +1553,85 @@ class Cursor(Structure): _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)] +_tu: TranslationUnit + +# This ensures that no operations are possible on null cursors +# by guarding all method calls with a not-null

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: Adressed all review comments and added a release note for the breaking changes. https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/138103 >From 65ad7a888dafc9992793baee8a1ccc27f1b79fa5 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 1 May 2025 18:37:43 +0900 Subject: [PATCH 1/7] [libclang/python] Add typing annotations for the Cursor

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/140015 >From c3c0adfe4a7dce3568a81594588be53d761b5980 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 15 May 2025 15:58:00 +0900 Subject: [PATCH 1/4] [libclang/python] Ensure all library functions are re

[clang] [libclang/python][NFC] Refactor wildcard import of `ctypes` (PR #140191)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. Good idea! LGTM https://github.com/llvm/llvm-project/pull/140191 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
@@ -0,0 +1,17 @@ +import os + +from clang.cindex import Config, conf, FUNCTION_LIST + +if "CLANG_LIBRARY_PATH" in os.environ: +Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) + +import unittest + + +class TestIndex(unittest.TestCase): +def test_functions_register

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
@@ -0,0 +1,17 @@ +import os + +from clang.cindex import Config, conf, FUNCTION_LIST + +if "CLANG_LIBRARY_PATH" in os.environ: +Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) + +import unittest + + +class TestIndex(unittest.TestCase): +def test_functions_register

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll This PR adds the missing functions to `FUNCTION_LIST`, as well as a test that checks for completeness, as discussed here: https://github.com/llvm/llvm-project/pull/138103#discussion_r2085977138 The test is unfortunately not 100% foolproof, since as noted `clang_get

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/140015 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,s

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/140015 Add a few library functions that were not previously registered to the `CDLL` object. The current behavior relies on the default `restype` to work. Add a test to check that all library functions are proper

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-14 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/138103 >From 65ad7a888dafc9992793baee8a1ccc27f1b79fa5 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 1 May 2025 18:37:43 +0900 Subject: [PATCH 1/5] [libclang/python] Add typing annotations for the Cursor

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-14 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-14 Thread Jannick Kremer via cfe-commits
@@ -1552,68 +1553,85 @@ class Cursor(Structure): _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)] +_tu: TranslationUnit + +# This ensures that no operations are possible on null cursors +# by guarding all method calls with a not-null

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-13 Thread Jannick Kremer via cfe-commits
@@ -1913,7 +1916,7 @@ def type(self): return self._type @property -def canonical(self): +def canonical(self) -> Cursor | None: """Return the canonical Cursor corresponding to this Cursor. DeinAlptraum wrote: That's a good idea, I

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-13 Thread Jannick Kremer via cfe-commits
@@ -1821,45 +1824,45 @@ def mangled_name(self): return self._mangled_name @property -def location(self): +def location(self) -> SourceLocation: """ Return the source location (the starting character) of the entity pointed at by th

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-13 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/138103 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,s

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-12 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/138103 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,s

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-12 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-12 Thread Jannick Kremer via cfe-commits
@@ -1913,7 +1916,7 @@ def type(self): return self._type @property -def canonical(self): +def canonical(self) -> Cursor | None: """Return the canonical Cursor corresponding to this Cursor. DeinAlptraum wrote: Okay, I did find a way

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-12 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/138103 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,s

[clang] [libclang/python] Add tests for equality operators. (PR #138132)

2025-05-01 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed https://github.com/llvm/llvm-project/pull/138132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Remove duplicate API (PR #132776)

2025-05-01 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Jugst3r are you still looking at this? Otherwise, I would still suggest merging this. https://github.com/llvm/llvm-project/pull/132776 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [libclang/python] Add tests for equality operators. (PR #138132)

2025-05-01 Thread Jannick Kremer via cfe-commits
@@ -16,6 +16,8 @@ from .util import get_cursor, get_tu +INPUTS_DIR = os.path.join(os.path.dirname(__file__), "INPUTS") DeinAlptraum wrote: Yes, I changed these to use `pathlib.Path` instead https://github.com/llvm/llvm-project/pull/138132 __

[clang] [libclang/python] Add tests for equality operators. (PR #138132)

2025-05-01 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/138132 >From 74cf17d76918c465aa24e391e15546ab030483f2 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 1 May 2025 22:42:56 +0900 Subject: [PATCH 1/2] [libclang/python] Add tests for equality operators. Ad

[clang] [libclang/python] Remove compatibility workaround for briefComment (PR #138135)

2025-05-01 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed https://github.com/llvm/llvm-project/pull/138135 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Remove compatibility workaround for briefComment (PR #138135)

2025-05-01 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/138135 None >From 257a5e923fee29df8c546b84875a64c43c994c04 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 1 May 2025 23:00:23 +0900 Subject: [PATCH] [libclang/python] Remove compatibility workaround for

[clang] [libclang/python] Add tests for equality operators. (PR #138132)

2025-05-01 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll Thank you, I put the removal of the compatibility stuff in a separate PR here: https://github.com/llvm/llvm-project/pull/138135 https://github.com/llvm/llvm-project/pull/138132 ___ cfe-commits mailing list cfe-commits@list

[clang] [libclang/python] Remove compatibility workaround for briefComment (PR #138135)

2025-05-01 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/138135 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add tests for equality operators. (PR #138132)

2025-05-01 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll I added the tests as discussed on #138074 . I'm just not sure how/if we can reasonably test the `else` path for `briefComment`: this requires a libclang.so built before LLVM 3.2. In fact, I'm not entirely sure what the point here is: being able to use the same `lib

[clang] [libclang/python] Add tests for equality operators. (PR #138132)

2025-05-01 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/138132 Adds tests for SourceRange, SourceLocation and Cursor. This is a follow-up to #138074 >From 74cf17d76918c465aa24e391e15546ab030483f2 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 1 May 2025 22:4

[clang] [libclang/python] Add some logical typing changes. (PR #138074)

2025-05-01 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: Which parts do you mean? The `__eq__` operators for other objects? https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-01 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-01 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-01 Thread Jannick Kremer via cfe-commits
@@ -1913,7 +1916,7 @@ def type(self): return self._type @property -def canonical(self): +def canonical(self) -> Cursor | None: """Return the canonical Cursor corresponding to this Cursor. DeinAlptraum wrote: This uses `Cursor.from

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-01 Thread Jannick Kremer via cfe-commits
@@ -1821,45 +1824,45 @@ def mangled_name(self): return self._mangled_name @property -def location(self): +def location(self) -> SourceLocation: """ Return the source location (the starting character) of the entity pointed at by th

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-01 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   >