[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] [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] [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] [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)

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 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] 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-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
@@ -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
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
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/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
@@ -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/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
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 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] [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
@@ -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] [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
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] [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/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] 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 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/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] 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] 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 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] 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] 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
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] [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] 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] [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] 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] 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] 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
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
@@ -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
@@ -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 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
@@ -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
@@ -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] 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
@@ -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
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
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 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] 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] 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] 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-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] 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
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] [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] [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
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-08-21 Thread Jannick Kremer via cfe-commits
@@ -2454,7 +2480,7 @@ def element_type(self): If accessed on a type that is not an array, complex, or vector type, an exception will be raised. """ -result = conf.lib.clang_getElementType(self) +result = Type.from_result(conf.lib.clang_ge

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

2024-08-21 Thread Jannick Kremer via cfe-commits
@@ -3743,82 +3765,62 @@ def write_main_file_to_stdout(self): ("clang_equalLocations", [SourceLocation, SourceLocation], bool), ("clang_equalRanges", [SourceRange, SourceRange], bool), ("clang_equalTypes", [Type, Type], bool), -("clang_formatDiagnostic", [Diagnos

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

2024-08-21 Thread Jannick Kremer via cfe-commits
@@ -424,7 +424,7 @@ def location(self): @property def spelling(self): -return conf.lib.clang_getDiagnosticSpelling(self) # type: ignore [no-any-return] +return _CXString.from_result(conf.lib.clang_getDiagnosticSpelling(self)) DeinAlp

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

2024-08-21 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: @Endilll this removes the `errcheck` magic conversion stuff that we discussed the other day https://github.com/llvm/llvm-project/pull/105490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

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

2024-08-21 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-08-21 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/105490 Call conversion functions directly instead of using them for type conversion on library function calls via `ctypes`' `errcheck` functionality. >From 8cf94c6486b47cbe4f9ec82cc7c8a9c4948ed012 Mon Sep 17 00:0

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

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

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-15 Thread Jannick Kremer via cfe-commits
@@ -65,6 +65,9 @@ Clang Python Bindings Potentially Breaking Changes - Calling a property on the ``CompletionChunk`` or ``CompletionString`` class statically now leads to an error, instead of returning a ``CachedProperty`` object that is used internally. Properties are onl

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/101802 >From 572b1be0b204561fdbb049f0c17f065d17198ac0 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 3 Aug 2024 09:28:02 +0100 Subject: [PATCH 1/7] [libclang/python] Fix bug in SourceRange.__contains__,

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/101802 >From 572b1be0b204561fdbb049f0c17f065d17198ac0 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 3 Aug 2024 09:28:02 +0100 Subject: [PATCH 1/6] [libclang/python] Fix bug in SourceRange.__contains__,

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-15 Thread Jannick Kremer via cfe-commits
@@ -74,6 +74,16 @@ CINDEX_LINKAGE CXSourceLocation clang_getNullLocation(void); CINDEX_LINKAGE unsigned clang_equalLocations(CXSourceLocation loc1, CXSourceLocation loc2); +/** + * Determine for two source locations if they refer to

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/101802 >From 572b1be0b204561fdbb049f0c17f065d17198ac0 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 3 Aug 2024 09:28:02 +0100 Subject: [PATCH 1/6] [libclang/python] Fix bug in SourceRange.__contains__,

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/101802 >From 572b1be0b204561fdbb049f0c17f065d17198ac0 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 3 Aug 2024 09:28:02 +0100 Subject: [PATCH 1/6] [libclang/python] Fix bug in SourceRange.__contains__,

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: Implemented all your suggestions https://github.com/llvm/llvm-project/pull/101802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/101802 >From 572b1be0b204561fdbb049f0c17f065d17198ac0 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 3 Aug 2024 09:28:02 +0100 Subject: [PATCH 1/5] [libclang/python] Fix bug in SourceRange.__contains__,

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/101802 >From 572b1be0b204561fdbb049f0c17f065d17198ac0 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 3 Aug 2024 09:28:02 +0100 Subject: [PATCH 1/4] [libclang/python] Fix bug in SourceRange.__contains__,

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Jannick Kremer via cfe-commits
@@ -50,6 +50,18 @@ unsigned clang_equalLocations(CXSourceLocation loc1, CXSourceLocation loc2) { loc1.int_data == loc2.int_data); } +unsigned clang_lessThanLocations(CXSourceLocation loc1, CXSourceLocation loc2) { + const SourceLocation Loc1 = SourceLocation::get

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/101802 >From 572b1be0b204561fdbb049f0c17f065d17198ac0 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 3 Aug 2024 09:28:02 +0100 Subject: [PATCH 1/4] [libclang/python] Fix bug in SourceRange.__contains__,

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/101802 >From 572b1be0b204561fdbb049f0c17f065d17198ac0 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 3 Aug 2024 09:28:02 +0100 Subject: [PATCH 1/3] [libclang/python] Fix bug in SourceRange.__contains__,

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Jannick Kremer via cfe-commits
@@ -386,6 +386,10 @@ def __contains__(self, other): # same file, in between lines if self.start.line < other.line < self.end.line: return True +# between columns in one-liner range +elif self.start.line == other.line == self.end.line:

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/101802 >From 572b1be0b204561fdbb049f0c17f065d17198ac0 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 3 Aug 2024 09:28:02 +0100 Subject: [PATCH 1/3] [libclang/python] Fix bug in SourceRange.__contains__,

[clang] [libclang/python] Improve error reporting of `TranslationUnit` creating functions (PR #102410)

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

[clang] [libclang/python] Improve error reporting of `TranslationUnit` creating functions (PR #102410)

2024-08-11 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. LGTM. Thanks for adding better error handling! @Endilll do you also want to take a look at this before it is merged? Otherwise, this is good to go imo. https://github.com/llvm/llvm-project/pull/102410 __

[clang] [libclang/python] Improve error reporting of `TranslationUnit` creating functions (PR #102410)

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

[clang] [libclang/python] Improve error reporting of `TranslationUnit` creating functions (PR #102410)

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

[clang] [NFC][libclang/python] Fix code highlighting in release notes (PR #102807)

2024-08-11 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: Unrelated, this change only touched release notes https://github.com/llvm/llvm-project/pull/102807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][libclang/python] Fix code highlighting in release notes (PR #102807)

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

[clang] [NFC][libclang/python] Fix code highlighting in release notes (PR #102807)

2024-08-11 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/102807 This corrects a release note introduced in #98745 >From 64212e4c8afe2ad75144bf36a1212c4e417dd8c9 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sun, 11 Aug 2024 11:00:52 +0200 Subject: [PATCH] [NFC][l

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread Jannick Kremer via cfe-commits
@@ -149,8 +149,8 @@ def b(x: str | bytes) -> bytes: # this by marshalling object arguments as void**. c_object_p: TType[_Pointer[Any]] = POINTER(c_void_p) -### Exception Classes ### +### Exception Classes ### DeinAlptraum wrote: Unnecessary whitespace chang

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread Jannick Kremer via cfe-commits
@@ -161,7 +161,34 @@ class TranslationUnitLoadError(Exception): FIXME: Make libclang expose additional error information in this scenario. """ -pass +# A generic error code, no further details are available. +# +# Errors of this kind can get their own s

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread Jannick Kremer via cfe-commits
@@ -59,6 +59,9 @@ Clang Python Bindings Potentially Breaking Changes - Calling a property on the `CompletionChunk` or `CompletionString` class statically now leads to an error, instead of returning a `CachedProperty` object that is used internally. Properties are only avai

[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

2024-08-11 Thread Jannick Kremer via cfe-commits
@@ -161,7 +161,34 @@ class TranslationUnitLoadError(Exception): FIXME: Make libclang expose additional error information in this scenario. DeinAlptraum wrote: I would say your change resolves the `FIXME` here. Thanks for expanding this to the `create`/`pars

  1   2   3   >