[clang] [libclang/python] Refactor enum usage (PR #95608)

2024-06-22 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll are you taking a look at this, and/or should I ask other reviewers? https://github.com/llvm/llvm-project/pull/95608 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [libclang/python] Refactor enum usage (PR #95608)

2024-06-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/95608 >From 35bfcfbc69ee812c59350440b7b15c5e23ad1307 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Fri, 14 Jun 2024 22:12:09 +0100 Subject: [PATCH 1/2] [libclang/python] Refactor enum usage Use Python's bui

[clang] [libclang/python] Refactor enum usage (PR #95608)

2024-06-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/95608 >From 35bfcfbc69ee812c59350440b7b15c5e23ad1307 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Fri, 14 Jun 2024 22:12:09 +0100 Subject: [PATCH 1/2] [libclang/python] Refactor enum usage Use Python's bui

[clang] [libclang/python] Refactor enum usage (PR #95608)

2024-06-24 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll done with the TokenKind refactoring, so this is ready to go from my side. Regarding reviewers, can you recommend any others? Since I assume I'll open a couple more PRs for the Python bindings after this https://github.com/llvm/llvm-project/pull/95608 _

[clang] [libclang/python] Refactor enum usage (PR #95608)

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

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

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

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

2024-09-12 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: @Endilll tested how exactly? All tests still pass, obviously, but I just checked and there are six lines changed here, that are not currently covered by tests: `Diagnostic.format()`, `Cursor.get_definition()`, `Cursor.get_usr()`, `Type.get_result()`, `

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

2024-09-12 Thread Jannick Kremer via cfe-commits
@@ -3524,16 +3564,20 @@ def getCompileCommands(self, filename): Get an iterable object providing all the CompileCommands available to build filename. Returns None if filename is not found in the database. """ -return conf.lib.clang_CompilationDat

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-16 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-16 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-16 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: Thanks a lot for the fix! Except for the syntax error noted by the CI and my other comment, this looks good to me. https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list cfe-commits@li

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-16 Thread Jannick Kremer via cfe-commits
@@ -570,6 +570,25 @@ def test_enum_values_cpp(self): self.assertEqual(ham.kind, CursorKind.ENUM_CONSTANT_DECL) self.assertEqual(ham.enum_value, 0x100) +def test_enum_values_on_elaborated_type(self): +tu = get_tu( +"using myUType

[clang] [clang][python] Add CLANG_DISABLE_RUN_PYTHON_TESTS CMake option to disable clang python bindings tests (PR #111367)

2024-10-08 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. LGTM, but I'd like @Endilll to take a look as well, since I'm not that familiar with our build infrastructure & cmake https://github.com/llvm/llvm-project/pull/111367 ___ cfe-commits mailing

[clang] [libclang/python] Clean up tests (PR #114383)

2024-10-31 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/114383 Clean up imports via isort Remove unused imports Remove unused variables Remove Python <3.6 compatibility measures >From 25e10c362338265e07ec045b2b8bbe692ae18092 Mon Sep 17 00:00:00 2001 From: Jannick Kreme

[clang] [libclang/python] Clean up tests (PR #114383)

2024-10-31 Thread Jannick Kremer via cfe-commits
@@ -344,7 +343,7 @@ class Bar { ) self.assertEqual(len(copy_assignment_operators_cursors), 10) -self.assertTrue(len(non_copy_assignment_operators_cursors), 9) +self.assertEqual(len(non_copy_assignment_operators_cursors), 7) Dein

[clang] [libclang/python] Clean up tests (PR #114383)

2024-10-31 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: Closing since this has been split into #114395, #114397, #114399, #114409 https://github.com/llvm/llvm-project/pull/114383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [libclang/python/tests] Clean up imports (PR #114409)

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

[clang] [libclang/python] Fix incorrect assert in test (PR #114395)

2024-10-31 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/114395 This mistake was introduced in #109846 >From 5de030fa89f4dbda6d21224a3097d83b467d1575 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 31 Oct 2024 13:07:06 +0100 Subject: [PATCH] [libclang/python]

[clang] [libclang/python/tests] Remove unused variables (PR #114397)

2024-10-31 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/114397 Remove all occurrences of unused varialbes in the python bindings tests. Use `_` to ignore unused values in tuple unpacking expressions. >From 48e8bc646a7f73c1c0a762e8c1da7186f0ff2a5a Mon Sep 17 00:00:00 20

[clang] [libclang/python/tests] Remove unused variables (PR #114397)

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

[clang] [libclang/python] Fix incorrect assert in test (PR #114395)

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

[clang] [libclang/python/tests] Remove Python <3.6 workarounds (PR #114399)

2024-10-31 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/114399 This removes workarounds for Python versions before 3.6, since our minimum Python version has been bumped to 3.8 >From b3079f7a44d65c8d62fe201b7c5766b852a1 Mon Sep 17 00:00:00 2001 From: Jannick Kremer

[clang] [libclang/python/tests] Remove Python <3.6 workarounds (PR #114399)

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

[clang] [libclang/python/tests] Clean up imports (PR #114409)

2024-10-31 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/114409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python/tests] Clean up imports (PR #114409)

2024-10-31 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/114409 Sort imports using `isort`. Remove unused imports Collect multiple imports from the same module into a single import statement Unify import style >From a83338b9f4b306a81b55937e109e3065049fcfb7 Mon Sep 17 00

[clang] [libclang/python] Clean up tests (PR #114383)

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

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
@@ -279,6 +280,90 @@ def test_is_default_method(self): self.assertTrue(xc.is_default_method()) self.assertFalse(yc.is_default_method()) +def test_is_deleted_method(self): +source = "class X { X() = delete; }; class Y { Y(); };" +tu = get_tu(

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/109846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/109846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/109846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/109846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
@@ -279,6 +280,90 @@ def test_is_default_method(self): self.assertTrue(xc.is_default_method()) self.assertFalse(yc.is_default_method()) +def test_is_deleted_method(self): +source = "class X { X() = delete; }; class Y { Y(); };" +tu = get_tu(

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
@@ -46,6 +46,8 @@ def test_diagnostic_fixit(self): self.assertEqual(tu.diagnostics[0].location.column, 26) self.assertRegex(tu.diagnostics[0].spelling, "use of GNU old-style.*") self.assertEqual(len(tu.diagnostics[0].fixits), 1) +with self.assert

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
@@ -357,6 +359,50 @@ def test_is_restrict_qualified(self): self.assertTrue(i.type.is_restrict_qualified()) self.assertFalse(j.type.is_restrict_qualified()) +def test_get_result(self): +tu = get_tu("void foo(); int bar(char, short);") +foo =

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
@@ -357,6 +359,50 @@ def test_is_restrict_qualified(self): self.assertTrue(i.type.is_restrict_qualified()) self.assertFalse(j.type.is_restrict_qualified()) +def test_get_result(self): +tu = get_tu("void foo(); int bar(char, short);") +foo =

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/109846 >From 68ca7ee24712a48c1b6df6aff480fb4ff3054c57 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Tue, 24 Sep 2024 20:44:23 +0200 Subject: [PATCH 1/2] [libclang/python] Improve test coverage Achieve 100%

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/109846 Achieve 100% test coverage on classes Cursor, Diagnostic, Type. >From 68ca7ee24712a48c1b6df6aff480fb4ff3054c57 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Tue, 24 Sep 2024 20:44:23 +0200 Subject: [

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/109846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: @Endilll this adds the tests in preparation as discussed for #105490. While I was at it, I also added full test coverage for all the affected classes. https://github.com/llvm/llvm-project/pull/109846 ___ cfe-

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
@@ -308,10 +310,10 @@ def test_element_type(self): def test_invalid_element_type(self): """Ensure Type.element_type raises if type doesn't have elements.""" tu = get_tu("int i;") -i = get_cursor(tu, "i") -self.assertIsNotNone(i) -with

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
@@ -357,6 +359,50 @@ def test_is_restrict_qualified(self): self.assertTrue(i.type.is_restrict_qualified()) self.assertFalse(j.type.is_restrict_qualified()) +def test_get_result(self): +tu = get_tu("void foo(); int bar(char, short);") +foo =

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Jannick Kremer via cfe-commits
@@ -625,6 +762,25 @@ def test_result_type_objc_method_decl(self): self.assertEqual(cursor.kind, CursorKind.OBJC_INSTANCE_METHOD_DECL) self.assertEqual(result_type.kind, TypeKind.VOID) +def test_storage_class(self): +tu = get_tu( +""" +ex

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

2024-09-27 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll I rebased with the added tests from #109846 and checked with [diff-cover](https://pypi.org/project/diff-cover/) that all changed lines are covered by tests https://github.com/llvm/llvm-project/pull/105490 ___ cfe-commits

[clang] [libclang/python] Improve test coverage (PR #109846)

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

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

2024-09-27 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/105490 >From 2e4651345d1bde971be3a2c40602acf68f2c9519 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Wed, 21 Aug 2024 11:50:05 +0200 Subject: [PATCH] [libclang/python] Do not rely on ctypes' errcheck Call co

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

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

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-18 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. Rest looks good to me. Regarding releases, I'm not too familiar with the process here, but I believe backports aren't done unless it's a critical security bug or similar. @Endilll can you confirm, and do you also want to sign off on t

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-18 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-18 Thread Jannick Kremer via cfe-commits
@@ -570,6 +570,26 @@ def test_enum_values_cpp(self): self.assertEqual(ham.kind, CursorKind.ENUM_CONSTANT_DECL) self.assertEqual(ham.enum_value, 0x100) +def test_enum_values_on_elaborated_type(self): +tu = get_tu( +"using myUType

[clang] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-18 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-19 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @fursov yes, since you are a new contributor, you cannot merge this yourself. I can, but I am also still relatively new so I would like someone else to confirm that this change is good to go - so we're just waiting for him to take a look as well :) https://github.com/llvm/

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2025-01-06 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @efriedma-quic no idea, I would just rebase and hope that's it https://github.com/llvm/llvm-project/pull/120494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

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

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

2025-02-06 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: Sorry, saw this but had no time to answer. Unfortunately I'm also not familiar with Python packaging so can't be of much help here https://github.com/llvm/llvm-project/pull/125806 ___ cfe-commits mailing list

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

2025-02-06 Thread Jannick Kremer via cfe-commits
@@ -0,0 +1,36 @@ +[build-system] +requires = ["setuptools>=42", "setuptools_scm==8.1.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "clang" +description = "libclang python bindings" +readme = {file = "README.txt", content-type = "text/plain"} + +license = {text

[clang] [llvm] Expose format (attribute) info for function declarations in Clang Index API (PR #113754)

2024-12-18 Thread Jannick Kremer via cfe-commits
@@ -3109,6 +3109,29 @@ CINDEX_LINKAGE int clang_getFieldDeclBitWidth(CXCursor C); */ CINDEX_LINKAGE int clang_Cursor_getNumArguments(CXCursor C); +/** + * Retrieve FormatAttr on function declaration + */ +CINDEX_LINKAGE CXCursor clang_Cursor_getFormatAttr (CXCursor cur); -

[clang] [llvm] Expose format (attribute) info for function declarations in Clang Index API (PR #113754)

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

[clang] [llvm] Expose format (attribute) info for function declarations in Clang Index API (PR #113754)

2024-12-18 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: I'm not that familiar with the C++ side of the bindings, so I would wait for approval from others. https://github.com/llvm/llvm-project/pull/113754 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [llvm] Expose format (attribute) info for function declarations in Clang Index API (PR #113754)

2024-12-18 Thread Jannick Kremer via cfe-commits
@@ -59,6 +59,10 @@ LLVM_13 { clang_Cursor_getMangling; clang_Cursor_getModule; clang_Cursor_getNumArguments; +clang_Cursor_getFormatAttr; +clang_FormatAttr_getType; +clang_FormatAttr_getFormatIdx; +clang_FormatAttr_getFirstArg; DeinA

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

2024-12-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited 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)

2024-12-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: Hi and thanks for the PR! To keep our history readable, please this up into smaller more focused PRs with an appropriate title ("Add a few things" won't be accepted ;)). This could be split into e.g. additions to the `File` interface, additions to the

[clang] [libclang/python] Add python binding for clang_Cursor_isAnonymousRecordDecl (PR #120483)

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

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-19 Thread Jannick Kremer via cfe-commits
@@ -981,3 +983,13 @@ def test_from_result_null(self): def test_from_cursor_result_null(self): tu = get_tu("") self.assertEqual(tu.cursor.semantic_parent, None) + +def test_pretty_print(self): +tu = get_tu("struct X { int x; }; void f(bool x) { }"

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: Thanks for the PR! Two minor comments and formatting, otherwise LGTM! https://github.com/llvm/llvm-project/pull/120494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

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

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-19 Thread Jannick Kremer via cfe-commits
@@ -3685,6 +3695,71 @@ def write_main_file_to_stdout(self): conf.lib.clang_CXRewriter_writeMainFileToStdOut(self) +class PrintingPolicyProperty(BaseEnumeration): + +""" +A PrintingPolicyProperty identifies a property of a PrintingPolicy. +""" +Indentat

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2024-12-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: I'm only familiar with the Python-side of the bindings, so only reviewed those. Minor comments, otherwise LGTM! https://github.com/llvm/llvm-project/pull/120300 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2024-12-19 Thread Jannick Kremer via cfe-commits
@@ -437,6 +437,8 @@ LLVM_19 { LLVM_20 { global: clang_isBeforeInTranslationUnit; +clang_getOffsetOfBase; +clang_visitCXXBaseClasses; DeinAlptraum wrote: Not sure if this actually matters, but since all the other entries follow an alphabetic orde

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2024-12-19 Thread Jannick Kremer via cfe-commits
@@ -1,4 +1,5 @@ import os +import clang.cindex DeinAlptraum wrote: This import seems to be unused https://github.com/llvm/llvm-project/pull/120300 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

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

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2024-12-19 Thread Jannick Kremer via cfe-commits
@@ -2663,6 +2671,21 @@ def visitor(field, children): conf.lib.clang_Type_visitFields(self, fields_visit_callback(visitor), fields) return iter(fields) +def get_bases(self): +"""Return an iterator for accessing the base classes of this type.""" + +

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2024-12-19 Thread Jannick Kremer via cfe-commits
@@ -2663,6 +2671,21 @@ def visitor(field, children): conf.lib.clang_Type_visitFields(self, fields_visit_callback(visitor), fields) return iter(fields) +def get_bases(self): +"""Return an iterator for accessing the base classes of this type.""" + +

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2024-12-20 Thread Jannick Kremer via cfe-commits
@@ -2663,6 +2671,21 @@ def visitor(field, children): conf.lib.clang_Type_visitFields(self, fields_visit_callback(visitor), fields) return iter(fields) +def get_bases(self): +"""Return an iterator for accessing the base classes of this type.""" + +

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2024-12-20 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. LGTM! @Endilll did you want to take a look at this as well? https://github.com/llvm/llvm-project/pull/120494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-11 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. Re Python: LGTM! On a sidenote just fyi, there's no need to amend & forcepush when you adress review comments. I know the contributor guide says something about how you should have only a single commit when submitting a patch, but tha

[clang] [cindex] Add API to query the class methods of a type (PR #123539)

2025-01-25 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: The Python part looks mostly good to me. I'm not too familiar with the non-Python side of things though, so would like someone else to take a look as well. @Endilll do you want to take a look? https://github.com/llvm/llvm-project/pull/123539 _

[clang] [cindex] Add API to query the class methods of a type (PR #123539)

2025-01-25 Thread Jannick Kremer via cfe-commits
@@ -2052,6 +2052,19 @@ def referenced(self): return self._referenced +@property +def specialized(self): +""" +For a cursor that is instantiated from a template, returns a cursor +representing the template that it was instantiated from.

[clang] [libclang] Allow using PrintingPolicy with types (PR #122386)

2025-01-10 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. Thanks for the PR! Please also add a corresponding release note for `Type.pretty_printed` in the Python bindings section. Otherwise, LGTM! https://github.com/llvm/llvm-project/pull/122386 ___

[clang] [cindex] Add API to query the class methods of a type (PR #123539)

2025-02-15 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @Endilll can you also review the non-Python part, or do you know someone who can? https://github.com/llvm/llvm-project/pull/123539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Jannick Kremer via cfe-commits
@@ -16,3 +17,16 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(kInputsDir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-22 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/8] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-22 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: As for investigation: I wrote four tests in `test_file.py` that just assert all files as equal (the ones named `test_file_eq_failing...`) which is expected to fail, and all four of these tests fail for me locally. But in the CI, it seems that indeed all in-memory files seem

[clang] [libclang/python] Add some bindings to the `Cursor` interface (PR #132377)

2025-03-21 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/132377 Make Cursor hashable Add `Cursor.has_attr()` Add `Cursor.specialized_template` >From c433f194600d72a3902c4eed304439d6e3f2f62b Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +

[clang] [libclang/python] Change all global variables to snake case (PR #132378)

2025-03-21 Thread Jannick Kremer via cfe-commits
@@ -10,7 +10,7 @@ import sys from pathlib import Path -kInputsDir = os.path.join(os.path.dirname(__file__), "INPUTS") +k_inputs_dir = os.path.join(os.path.dirname(__file__), "INPUTS") DeinAlptraum wrote: Sounds good. I've been wondering the entire time what t

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/4] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Jannick Kremer via cfe-commits
@@ -1,12 +1,13 @@ import os -from clang.cindex import Config, File, Index +from clang.cindex import Config, File, Index, TranslationUnit if "CLANG_LIBRARY_PATH" in os.environ: Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) import unittest +kInputsDir = o

[clang] [libclang/python] Change all global variables to snake case (PR #132378)

2025-03-21 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/132378 >From 926d2f7175fa7f04eae94291742ec7c89ea18516 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Fri, 21 Mar 2025 21:03:24 +0900 Subject: [PATCH 1/2] [libclang/python] Change all global variables to snake

[clang] [libclang/python] Change all global variables to snake case (PR #132378)

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

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-22 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/7] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-24 Thread Jannick Kremer via cfe-commits
@@ -16,3 +17,76 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(inputs_dir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-19 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/130383 >From 8a206611120c15010381e1570c2b4d7548142dbd Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 1/2] [libclang/python] Add equality comparison operators fo

[clang] [libclang/python] Change all global variables to snake case (PR #132378)

2025-04-05 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/132378 None >From 926d2f7175fa7f04eae94291742ec7c89ea18516 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Fri, 21 Mar 2025 21:03:24 +0900 Subject: [PATCH] [libclang/python] Change all global variables to sna

[clang] [libclang/python] Change all global variables to CAPS (PR #132930)

2025-03-25 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/132930 None >From f12efcc1c80f35f73934b90df7d4aaff8d2b0235 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Tue, 25 Mar 2025 21:58:31 +0900 Subject: [PATCH] [libclang/python] Change all global variables to CAP

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-09 Thread Jannick Kremer via cfe-commits
@@ -16,3 +17,76 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(inputs_dir, "hello.cpp") +header_path = os.

[clang] Fileequality bugfix (PR #133253)

2025-04-08 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/133253 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 01/10] [libclang/python] Add equality comparison operators

[clang] [libclang/C++] Fix clang_File_isEqual for in-memory files (PR #135773)

2025-04-17 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: Have we documented exact requirements for this anywhere? Also not sure what the point of stability would be here: `clang_File_isEqual` returns `True` for all comparisons of in-memory file, which just makes this useless in practice. Any code that relies on this would be wrong

[clang] [cindex] Add support for calling getFullyQualifiedName to the Python binding. (PR #135420)

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

[clang] [libclang/C++] Fix clang_File_isEqual for in-memory files (PR #135773)

2025-04-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/135773 >From 62dcfb1cb9bd0918bd471fddc1ffd849c2d604ac Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Tue, 15 Apr 2025 19:17:43 +0900 Subject: [PATCH 1/2] [libclang/C++] Fix clang_File_isEqual for in-memory fi

[clang] [libclang/C++] Fix clang_File_isEqual for in-memory files (PR #135773)

2025-04-15 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @AaronBallman this is the fix PR for the bug we discussed at https://github.com/llvm/llvm-project/pull/130383#discussion_r2014205462 The first test is for completeness' sake, the second one (with in-memory files) fails without the fix https://github.com/llvm/llvm-project/p

[clang] [libclang/C++] Fix clang_File_isEqual for in-memory files (PR #135773)

2025-04-17 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: Also cc @Endilll https://github.com/llvm/llvm-project/pull/135773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   6   >