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

2025-05-28 Thread Vlad Serebrennikov via cfe-commits
@@ -373,19 +373,21 @@ implementation of the facilities by Clang may change behavior as bugs are fixed, features get implemented, etc. The library should be ABI and API stable over time, but ABI- and API-breaking -changes can happen in the following situations: +changes can ha

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

2025-05-28 Thread Vlad Serebrennikov via cfe-commits
@@ -373,19 +373,21 @@ implementation of the facilities by Clang may change behavior as bugs are fixed, features get implemented, etc. The library should be ABI and API stable over time, but ABI- and API-breaking -changes can happen in the following situations: +changes can ha

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

2025-05-27 Thread Vlad Serebrennikov 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][NFC] Explain how null cursors are handled in docstring (PR #140499)

2025-05-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/140499 >From 445eacab8a326d3abcca95a31f07c272d0d155e7 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 19 May 2025 09:24:36 +0300 Subject: [PATCH 1/2] [libclang/python][NFC] Explain how null cursors are ha

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

2025-05-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Why does the diff show that you add `__ne__` operator, even though it's already present? What am I missing? https://github.com/llvm/llvm-project/blob/f3d36b15f6dde7ca2d080279274d5d0f4bfc8c30/clang/bindings/python/clang/cindex.py#L397-L403 https://github.com

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

2025-05-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed 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] Document how null cursors are handled (PR #140499)

2025-05-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited 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 Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/140499 Now that we looked at this aspect closely and fixed things, I think we can document this. >From 445eacab8a326d3abcca95a31f07c272d0d155e7 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 19 May 2025

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

2025-05-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/140496 ___ 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 Vlad Serebrennikov via cfe-commits
Endilll wrote: Hmm, so the reason we have `Cursor.from_source_location` is that SourceLocation doesn't hold a reference to TU. Yeah, I guess we don't need this. https://github.com/llvm/llvm-project/pull/140496 ___ cfe-commits mailing list cfe-commits@

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

2025-05-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/140496 This should complete the list of things `Cursor` can be made from. >From 2fa8240df89d195c25da9d0ee52101830ae41677 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 19 May 2025 09:20:55 +0300 Subject:

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

2025-05-18 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > LLVM Buildbot has detected a new failure on builder `clang-s390x-linux-lnt` > running on `systemz-1` while building `clang` at step 13 "setup lit". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/136/builds/3945 > Here is the relevant piece of the

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

2025-05-18 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > LLVM Buildbot has detected a new failure on builder `clang-s390x-linux-lnt` > running on `systemz-1` while building `clang` at step 13 "setup lit". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/136/builds/3945 > Here is the relevant piece of the

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

2025-05-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. 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 Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited 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 Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Our error-handling story is bad and inconsistent, but that's out of scope of this PR https://github.com/llvm/llvm-project/pull/140378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: You should put "Fixes #120388" in the description, and remove the issue number from the title, because it will be confusing after merging, when number of this PR will be added to the title. https://github.com/llvm/llvm-project/pull/140247 ___

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +void f(void) { + int_val2 = 0; // expected-error{{use of undeclared identifier}} + sin(0); // expected-error{{use of undeclared identifier 'sin'}} \ + // expected-note{{perhaps `#include ` is needed?}} + +

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -1474,6 +1474,7 @@ namespace cwg387 { // cwg387: 2.8 a = gcd(a, b); b = gcd(3, 4); // expected-error@-1 {{use of undeclared identifier 'gcd'}} + // expected-note@-2 {{perhaps `#include ` is needed?}} Endilll wrote: ```suggestion

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -26,14 +26,18 @@ void no_get_1() { auto [a0, a1] = A(); // expected-error {{decomposes into 3 elements}} auto [b0, b1] = B(); // expected-error {{decomposes into 3 elements}} } - auto [a0, a1, a2] = A(); // expected-error {{undeclared identifier 'get'}} expected-

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -1489,6 +1490,7 @@ namespace cwg387 { // cwg387: 2.8 a = gcd(a, b); b = gcd(3, 4); // expected-error@-1 {{use of undeclared identifier 'gcd'}} + // expected-note@-2 {{perhaps `#include ` is needed?}} Endilll wrote: ```suggestion

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +void f(void) { + int_val2 = 0; // expected-error{{use of undeclared identifier}} + sin(0); // expected-error{{use of undeclared identifier 'sin'}} \ + // expected-note{{perhaps `#include ` is needed?}} + +

[clang] [llvm] Revert "[clang] Add scoped enum support to `StreamingDiagnostic`" (PR #138139)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/138139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed 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] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll 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 Vlad Serebrennikov 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. Endilll wrote: ```suggestion - Al

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

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Can you swap release notes entries? They will make more sense this way when my suggestions are applied https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

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

2025-05-15 Thread Vlad Serebrennikov 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-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll 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 Vlad Serebrennikov 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 Endilll wrote: Yes, I think documentation on hover is helpful, which doesn't work withou

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

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. 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 Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,30 @@ +import os + +import clang.cindex + +if "CLANG_LIBRARY_PATH" in os.environ: +clang.cindex.Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) + +import unittest +import ast + + +class TestLib(unittest.TestCase): +def test_functions_registered(self):

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

2025-05-15 Thread Vlad Serebrennikov 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] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: PR title should mention somewhere that only used functions are registered. 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-commi

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

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/140191 The list is not that long. >From 10ebe5e6ba45e747b3bee2fe686810abf91ded18 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 16 May 2025 08:12:49 +0300 Subject: [PATCH] [libclang/python][NFC] Refactor

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

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll 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 Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Can you also add a release note? 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 library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov 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] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov 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 Vlad Serebrennikov 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 Vlad Serebrennikov 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 Vlad Serebrennikov 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] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov 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] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov 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 Endilll wrote: I think this comment should also go into high-level matters (that null cu

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

2025-05-15 Thread Vlad Serebrennikov 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 Vlad Serebrennikov 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 Vlad Serebrennikov 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 Vlad Serebrennikov via cfe-commits
https://github.com/Endilll 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 Vlad Serebrennikov via cfe-commits
https://github.com/Endilll 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 Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: I 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 Vlad Serebrennikov 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] Add typing annotations for the Cursor class (PR #138103)

2025-05-14 Thread Vlad Serebrennikov 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] d441d28 - [clang][NFC] Fix indentation in a comment

2025-05-14 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-14T11:43:21+03:00 New Revision: d441d28083e2f9de5170f5a96a8e44a38d306c62 URL: https://github.com/llvm/llvm-project/commit/d441d28083e2f9de5170f5a96a8e44a38d306c62 DIFF: https://github.com/llvm/llvm-project/commit/d441d28083e2f9de5170f5a96a8e44a38d306c62.

[clang] [clang][NFC] Regroup declarations in `Parser` (PR #138511)

2025-05-13 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/138511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Regroup declarations in `Parser` (PR #138511)

2025-05-13 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Numbers for clang-format uncleanliness of `Parser.h` with changes from this PR: `92 insertions(+), 87 deletions(-)` (all in grammar productions). https://github.com/llvm/llvm-project/pull/138511 ___ cfe-commits mailing list cfe-commits@

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

2025-05-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll 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 Vlad Serebrennikov 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] [Clang][RFC] Do not eat SFINAE diagnostics for explicit template arguments (PR #139066)

2025-05-08 Thread Vlad Serebrennikov via cfe-commits
@@ -985,7 +985,9 @@ namespace cwg354 { // cwg354: 3.1 c++11 int b1 = both<(int*)0>(); // cxx98-error@-1 {{no matching function for call to 'both'}} // cxx98-note@#cwg354-both-int-ptr {{candidate template ignored: invalid explicitly-specified argument for 1st template p

[clang] [clang][NFC] Regroup declarations in `Parser` (PR #138511)

2025-05-07 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > > > > 3. File has been formatted with clang-format, except for the grammar, > > > > because clang-format butchers it. > > > > > > > > > Yeah, this problem comes up rather frequently, I wonder if clang-format > > > can get some additional smarts to make that less of a challeng

[clang] [clang][NFC] Regroup declarations in `Parser` (PR #138511)

2025-05-07 Thread Vlad Serebrennikov via cfe-commits
@@ -59,8 +59,8 @@ Parser::Parser(Preprocessor &pp, Sema &actions, bool skipFunctionBodies) PreferredType(&actions.getASTContext(), pp.isCodeCompletionEnabled()), Actions(actions), Diags(PP.getDiagnostics()), StackHandler(Diags), GreaterThanIsOperator(true), C

[clang] [Clang] Fix the warning group of several compatibilty diagnostics (PR #138872)

2025-05-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Changes to DR tests look good https://github.com/llvm/llvm-project/pull/138872 ___ 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-07 Thread Vlad Serebrennikov 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-07 Thread Vlad Serebrennikov 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. Endilll wrote: > That said, the input to i

[clang] [clang][NFC] Regroup declarations in `Parser` (PR #138511)

2025-05-05 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > I think downstreams need some kind of notification that this large of a > change is coming; can you post something to Discourse to alert them and > encourage them to mention any major hardships on this PR? https://discourse.llvm.org/t/parser-h-reorganization-pr/86178 https://

[clang] [clang][NFC] Regroup declarations in `Parser` (PR #138511)

2025-05-05 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > > 3. File has been formatted with clang-format, except for the grammar, > > because clang-format butchers it. > > Yeah, this problem comes up rather frequently, I wonder if clang-format can > get some additional smarts to make that less of a challenge? CC > @mydeveloperday @o

[clang] Remove duplicate API (PR #132776)

2025-05-05 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I've seen this failure before, I don't think it's related to this PR. https://github.com/llvm/llvm-project/pull/132776 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cf2f13a - [clang][NFC] Convert `Sema::CCEKind` to scoped enum

2025-05-02 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T14:01:40+03:00 New Revision: cf2f13a867fb86b5c7ce33df8a569477dce71f4f URL: https://github.com/llvm/llvm-project/commit/cf2f13a867fb86b5c7ce33df8a569477dce71f4f DIFF: https://github.com/llvm/llvm-project/commit/cf2f13a867fb86b5c7ce33df8a569477dce71f4f.

[clang] 6e63b68 - [clang][NFC] Convert `Sema::OverloadKind` to scoped enum

2025-05-02 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T13:44:32+03:00 New Revision: 6e63b68389983194b5007d8d489e74d1ffcea500 URL: https://github.com/llvm/llvm-project/commit/6e63b68389983194b5007d8d489e74d1ffcea500 DIFF: https://github.com/llvm/llvm-project/commit/6e63b68389983194b5007d8d489e74d1ffcea500.

[clang] 4ba2778 - [clang][NFC] Convert `Sema::CorrectTypoKind` to scoped enum

2025-05-02 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T13:20:41+03:00 New Revision: 4ba27780d34916d4a856e6593035b15a5cace56e URL: https://github.com/llvm/llvm-project/commit/4ba27780d34916d4a856e6593035b15a5cace56e DIFF: https://github.com/llvm/llvm-project/commit/4ba27780d34916d4a856e6593035b15a5cace56e.

[clang] c0917ab - [clang][NFC] Convert `Sema::IfExistsResult` to scoped enum

2025-05-02 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T13:05:37+03:00 New Revision: c0917ab2e1cf603c3746f519fe1826869767bd8b URL: https://github.com/llvm/llvm-project/commit/c0917ab2e1cf603c3746f519fe1826869767bd8b DIFF: https://github.com/llvm/llvm-project/commit/c0917ab2e1cf603c3746f519fe1826869767bd8b.

[clang] [Clang] Implement CWG3005 Function parameters should never be name-independent (PR #138245)

2025-05-02 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I'm not going to bother you with the description of what I want to see in this file. Here you go: ```cpp // RUN: %clang_cc1 -std=c++98 -pedantic-errors -verify=expected %s // RUN: %clang_cc1 -std=c++11 -pedantic-errors -verify=expected %s // RUN:

[clang] 461255e - [clang][NFC] Convert `Sema::AllocationFunctionScope` to scoped enum

2025-05-02 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T12:38:52+03:00 New Revision: 461255e0c17265141009437ba3887f49f9838a40 URL: https://github.com/llvm/llvm-project/commit/461255e0c17265141009437ba3887f49f9838a40 DIFF: https://github.com/llvm/llvm-project/commit/461255e0c17265141009437ba3887f49f9838a40.

[clang] ff8060a - [clang][NFC] Convert `Sema::AssignConvertType` to scoped enum

2025-05-02 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T12:30:08+03:00 New Revision: ff8060a642377a17a1dfadb865634583cde4e097 URL: https://github.com/llvm/llvm-project/commit/ff8060a642377a17a1dfadb865634583cde4e097 DIFF: https://github.com/llvm/llvm-project/commit/ff8060a642377a17a1dfadb865634583cde4e097.

[clang] d0dcfd4 - [clang][NFC] Convert `Sema::VarArgKind` to scoped enum

2025-05-02 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T11:24:08+03:00 New Revision: d0dcfd4c68171c3b9b863626c08efa7f38cd0c54 URL: https://github.com/llvm/llvm-project/commit/d0dcfd4c68171c3b9b863626c08efa7f38cd0c54 DIFF: https://github.com/llvm/llvm-project/commit/d0dcfd4c68171c3b9b863626c08efa7f38cd0c54.

[clang] db247dd - [clang][NFC] Convert `Sema::ArithConvKind` to scoped enum

2025-05-02 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T11:02:01+03:00 New Revision: db247ddc9d5411ace70b478f7119eb44a43a8e5c URL: https://github.com/llvm/llvm-project/commit/db247ddc9d5411ace70b478f7119eb44a43a8e5c DIFF: https://github.com/llvm/llvm-project/commit/db247ddc9d5411ace70b478f7119eb44a43a8e5c.

[clang] 140c2b6 - [clang][NFC] Convert `Sema::AllowFoldKind` to scoped enum

2025-05-02 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T10:48:08+03:00 New Revision: 140c2b6d081b781b19f50bf1c4fbf4b17bfacdc1 URL: https://github.com/llvm/llvm-project/commit/140c2b6d081b781b19f50bf1c4fbf4b17bfacdc1 DIFF: https://github.com/llvm/llvm-project/commit/140c2b6d081b781b19f50bf1c4fbf4b17bfacdc1.

[clang] 048befe - Revert "[clang][NFC] Convert `Sema::TryCaptureKind` to scoped enum"

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T09:29:35+03:00 New Revision: 048befe9ef7edab3580a922d69664b21e2a532fa URL: https://github.com/llvm/llvm-project/commit/048befe9ef7edab3580a922d69664b21e2a532fa DIFF: https://github.com/llvm/llvm-project/commit/048befe9ef7edab3580a922d69664b21e2a532fa.

[clang] be6497f - [clang][NFC] Convert `Sema::TryCaptureKind` to scoped enum

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T09:25:58+03:00 New Revision: be6497ff7583248d76a6710dd48cfeb63dd68f27 URL: https://github.com/llvm/llvm-project/commit/be6497ff7583248d76a6710dd48cfeb63dd68f27 DIFF: https://github.com/llvm/llvm-project/commit/be6497ff7583248d76a6710dd48cfeb63dd68f27.

[clang] 630a0ff - [clang][NFC] Convert `Sema::TrivialABIHandling` to scoped enum

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T09:12:52+03:00 New Revision: 630a0ff2c25c4ced739b1c07633097ccbf182cd6 URL: https://github.com/llvm/llvm-project/commit/630a0ff2c25c4ced739b1c07633097ccbf182cd6 DIFF: https://github.com/llvm/llvm-project/commit/630a0ff2c25c4ced739b1c07633097ccbf182cd6.

[clang] 7e71db8 - [clang][NFC] Convert `Sema::AvailabilityMergeKind` to scoped enum

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T07:56:57+03:00 New Revision: 7e71db8463adfbaadbd28a6c0e8b807ff7075c3c URL: https://github.com/llvm/llvm-project/commit/7e71db8463adfbaadbd28a6c0e8b807ff7075c3c DIFF: https://github.com/llvm/llvm-project/commit/7e71db8463adfbaadbd28a6c0e8b807ff7075c3c.

[clang] ed673aa - [clang][NFC] Convert `Sema::OffsetOfKind` to scoped enum

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T07:49:47+03:00 New Revision: ed673aac7aa78896ec55aa615e37432006c2830a URL: https://github.com/llvm/llvm-project/commit/ed673aac7aa78896ec55aa615e37432006c2830a DIFF: https://github.com/llvm/llvm-project/commit/ed673aac7aa78896ec55aa615e37432006c2830a.

[clang] 8089c3d - [clang][NFC] Convert `Sema::NonTagKind` to scoped enum

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T07:45:22+03:00 New Revision: 8089c3d1edf0f880415bfbc155571f4a43fcdf17 URL: https://github.com/llvm/llvm-project/commit/8089c3d1edf0f880415bfbc155571f4a43fcdf17 DIFF: https://github.com/llvm/llvm-project/commit/8089c3d1edf0f880415bfbc155571f4a43fcdf17.

[clang] 09fb9ad - [clang][NFC] Convert `Sema::NonTrivialCUnionContext` to scoped enum

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T07:39:54+03:00 New Revision: 09fb9adbd2a432a83e451ee9156faceb9d76e9aa URL: https://github.com/llvm/llvm-project/commit/09fb9adbd2a432a83e451ee9156faceb9d76e9aa DIFF: https://github.com/llvm/llvm-project/commit/09fb9adbd2a432a83e451ee9156faceb9d76e9aa.

[clang] 68fd69a - [clang][NFC] Convert `Sema::PointerAuthDiscArgKind` to scoped enum

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-02T07:33:52+03:00 New Revision: 68fd69aca6c9d8129cd5dc27829a8abebea4cefc URL: https://github.com/llvm/llvm-project/commit/68fd69aca6c9d8129cd5dc27829a8abebea4cefc DIFF: https://github.com/llvm/llvm-project/commit/68fd69aca6c9d8129cd5dc27829a8abebea4cefc.

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

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. 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] [llvm] Revert "[clang] Add scoped enum support to `StreamingDiagnostic`" (PR #138139)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: #138134 seems to stick. I'll close this PR later if everything goes well https://github.com/llvm/llvm-project/pull/138139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ADT] Remove `is_scoped_enum_v` (PR #138134)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/138134 ___ 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 Vlad Serebrennikov via cfe-commits
@@ -16,6 +16,8 @@ from .util import get_cursor, get_tu +INPUTS_DIR = os.path.join(os.path.dirname(__file__), "INPUTS") Endilll wrote: I think our minimal requirements for Python version allow us to take advantage of `pathlib`. https://github.com/llvm/llvm-

[clang] [llvm] [ADT] Remove `is_scoped_enum_v` (PR #138134)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/138134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ADT] Remove `is_scoped_enum_v` (PR #138134)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/138134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ADT] Make `is_scoped_enum_v` SFINAE-able (PR #138134)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/138134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ADT] Make `is_scoped_enum_v` SFINAE-able (PR #138134)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/138134 >From 31a9c444b5ef6155ec1cdb35d9e659dd60b21dcc Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 1 May 2025 16:51:38 +0300 Subject: [PATCH 1/2] [ADT] Make `is_scoped_enum_v` SFINAE-able ...in old com

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

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: For the record, this was discussed in https://github.com/llvm/llvm-project/pull/138132#issuecomment-2844879381 https://github.com/llvm/llvm-project/pull/138135 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

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

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. 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] [llvm] Revert "[clang] Add scoped enum support to `StreamingDiagnostic`" (PR #138139)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/138139 Reverts llvm/llvm-project#138089 due to `std::underlying_type` being SFINAE-unfriendly in Clang and GCC before 9. Buildbot failure https://lab.llvm.org/buildbot/#/builders/134/builds/17904 >From 08f8efd49c7043

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

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > @Endilll I added the tests as discussed on #138074 . Thank you! > 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 (the > check was added 13 years ago in > [b947e82](https://github.com/l

[clang] [llvm] [clang] Add scoped enum support to `StreamingDiagnostic` (PR #138089)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
@@ -1429,6 +1429,22 @@ operator<<(const StreamingDiagnostic &DB, T *DC) { return DB; } +// Convert scope enums to their underlying type, so that we don't have +// clutter the emitting code with `llvm::to_underlying()`. +// We also need to disable implicit conversion for the

[clang] [llvm] [clang] Add scoped enum support to `StreamingDiagnostic` (PR #138089)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Apparently, my implementation of `is_scoped_enum_v` is not SFINAE-able enough. I'm working on a fix. https://github.com/llvm/llvm-project/pull/138089 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [llvm] [clang] Add scoped enum support to `StreamingDiagnostic` (PR #138089)

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/138089 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-01 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > Which parts do you mean? The `__eq__` operators for other objects? Yes, and `briefComment` function, too. https://github.com/llvm/llvm-project/pull/138074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

  1   2   3   4   5   6   7   8   9   10   >