[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-21 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Update following feedback. I rewrote `hasStringAndLengthArguments` to only build the matchers once (`static`), with necessary information being saved in variable bindings. @PiotrZSL This should be better, right? https://github.com/llvm/llvm-project/pull/89530 _

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-22 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89530 >From 98af89a36d4f112c3b31e450a5e6df8b6593aed4 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sun, 21 Apr 2024 05:17:19 + Subject: [PATCH] [clang-tidy][modernize-use-starts-ends-with] Add support fo

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-22 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Got it, thanks! I'm somewhat familiar using InnerMatchers but didn't think that solution fit quite right here. This new version I think is much better. Kept matcher construction in `registerMatchers`, added a little bit of logic in `check` to make sure some sizes match. https

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-22 Thread Nicolas van Kempen via cfe-commits
@@ -3,15 +3,16 @@ modernize-use-starts-ends-with == -Checks whether a ``find`` or ``rfind`` result is compared with 0 and suggests -replacing with ``starts_with`` when the method exists in the class. Notably, +Checks for common roundabout ways to ex

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-22 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89530 >From c6706922f31d4a7eedecb483346f99bffef67539 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sun, 21 Apr 2024 05:17:19 + Subject: [PATCH] [clang-tidy][modernize-use-starts-ends-with] Add support fo

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-18 Thread Nicolas van Kempen via cfe-commits
@@ -501,70 +506,72 @@ def main(): # Build up a big regexy filter from all command line arguments. file_name_re = re.compile("|".join(args.files)) +files = {f for f in files if file_name_re.search(f)} -return_code = 0 +returncode = 0 try: -# S

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-18 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Thanks for the ping, I had a version for 3.7+ working, and it seems hard to retrofit to 3.6. I think having the 3.7 version is fine. It's on my home machine, will update this PR later today 👍 https://github.com/llvm/llvm-project/pull/89490 _

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-21 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From d736bf96f5342752f17f7cb7c8e0f2a68ed3d996 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 20 Apr 2024 02:58:25 + Subject: [PATCH] [run-clang-tidy.py] Refactor, add progress indicator, add

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-21 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From 89f05df307dc839cef0037495e2f233eacb10b22 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 20 Apr 2024 02:58:25 + Subject: [PATCH] [run-clang-tidy.py] Refactor, add progress indicator, add

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-21 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From c0de68b59850f873a21ad5944b74b53fc3a1c4a8 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 20 Apr 2024 02:58:25 + Subject: [PATCH] [run-clang-tidy.py] Refactor, add progress indicator, add

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-21 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From ba200d4376cd0e9086220cc08de939c40489cd04 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 20 Apr 2024 02:58:25 + Subject: [PATCH] [run-clang-tidy.py] Refactor, add progress indicator, add

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-21 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Update: shutdown is now graceful on my machine. Please test on others if possible. 3.7+ is now required, which I think is fine given we want to make 3.8 the minimum across LLVM. Rebased on top of the `allow-no-checks` commit. https://github.com/llvm/llvm-project/pull/89490 ___

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-07-21 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Just double checked and tested again, seems good to me. Please merge on my behalf, I do not have commit access. I'll keep an eye out if anything breaks. https://github.com/llvm/llvm-project/pull/89490 ___ cfe-commits mailing list cfe-c

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-04-25 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: @PiotrZSL @carlosgalvezp Any thoughts on this change? https://github.com/llvm/llvm-project/pull/89490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-04-25 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: > Does it work with Python 3.6? Actually, it can with one single change. `asyncio,run` was introduced in 3.7, and can be replaced. I'll just add this change and a comment. It worked on my 3.6 setup. Let me know if you run into any issues. https://github.com/llvm/llvm-project/p

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-04-25 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From e27931b8a77c49f1c4cd47ca076addbe0ed19d87 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 20 Apr 2024 02:58:25 + Subject: [PATCH] [run-clang-tidy.py] Refactor, add progress indicator, add

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-04-27 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From 85700b3488ceb65adc73469c82137c1c3429b3f4 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 20 Apr 2024 02:58:25 + Subject: [PATCH] [run-clang-tidy.py] Refactor, add progress indicator, add

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-04-27 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Reproduced the buffering issue on my setup, but flushing didn't fix the problem. I could also reproduce with the current version of this script, which does also flush after writing. Python defaults input/output streams to buffered mode when it detects a pipe, and I don't think f

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-04-27 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From 129187f336bf6351dae4604d690809f4095a2e7e Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 20 Apr 2024 02:58:25 + Subject: [PATCH] [run-clang-tidy.py] Refactor, add progress indicator, add

[clang] [clang][Sema] Fix particular operator overload crash (PR #105976)

2024-08-26 Thread Nicolas van Kempen via cfe-commits
@@ -7425,6 +7425,13 @@ void Sema::AddMethodCandidate(DeclAccessPair FoundDecl, QualType ObjectType, /*ExplicitArgs*/ nullptr, ObjectType, ObjectClassification, Args, CandidateSet, Supp

[clang-tools-extra] [clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-27 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/106061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-27 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank commented: Add check and alias entries to [clang-tools-extra/docs/clang-tidy/checks/list.rst](https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/docs/clang-tidy/checks/list.rst). Check name: this is not only sizeof. Maybe `bugprone-suspicious-pointer-s

[clang-tools-extra] [clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-27 Thread Nicolas van Kempen via cfe-commits
@@ -0,0 +1,50 @@ +.. title:: clang-tidy - bugprone-suspicious-pointer-arithmetics-using-sizeof + +bugprone-suspicious-pointer-arithmetics-using-sizeof + + +Finds suspicious pointer arithmetic calculations where the pointer is off

[clang-tools-extra] [clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-27 Thread Nicolas van Kempen via cfe-commits
@@ -0,0 +1,31 @@ +//===--- SuspiciousPointerArithmeticsUsingSizeofCheck.h ---*- C++ -*---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-27 Thread Nicolas van Kempen via cfe-commits
@@ -0,0 +1,108 @@ +//===--- SuspiciousPointerArithmeticsUsingSizeofCheck.cpp - clang-tidy ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-27 Thread Nicolas van Kempen via cfe-commits
@@ -0,0 +1,108 @@ +//===--- SuspiciousPointerArithmeticsUsingSizeofCheck.cpp - clang-tidy ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Extend `bugprone-sizeof-expression` with matching `P +- sizeof(T)` and `P +- N * sizeof(T)` cases, add `cert-arr39-c` alias (PR #106061)

2024-08-28 Thread Nicolas van Kempen via cfe-commits
@@ -285,6 +288,50 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) { hasRHS(ignoringParenImpCasts(SizeOfExpr.bind("sizeof-ptr-div-expr" .bind("sizeof-in-ptr-arithmetic-div"), this); + + // SEI CERT ARR39-C. Do not add or subt

[clang-tools-extra] [clang-tidy] Extend `bugprone-sizeof-expression` with matching `P +- sizeof(T)` and `P +- N * sizeof(T)` cases, add `cert-arr39-c` alias (PR #106061)

2024-08-28 Thread Nicolas van Kempen via cfe-commits
@@ -285,6 +288,50 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) { hasRHS(ignoringParenImpCasts(SizeOfExpr.bind("sizeof-ptr-div-expr" .bind("sizeof-in-ptr-arithmetic-div"), this); + + // SEI CERT ARR39-C. Do not add or subt

[clang-tools-extra] [clang-tidy] Extend `bugprone-sizeof-expression` with matching `P +- sizeof(T)` and `P +- N * sizeof(T)` cases, add `cert-arr39-c` alias (PR #106061)

2024-08-28 Thread Nicolas van Kempen via cfe-commits
@@ -285,6 +288,50 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) { hasRHS(ignoringParenImpCasts(SizeOfExpr.bind("sizeof-ptr-div-expr" .bind("sizeof-in-ptr-arithmetic-div"), this); + + // SEI CERT ARR39-C. Do not add or subt

[clang] [clang-tools-extra] [lldb] [llvm] [NFC] Prefer subprocess.DEVNULL over os.devnull (PR #106500)

2024-08-28 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/106500 There is no need to support Python 2.7 anymore, Python 3.3+ has `subprocess.DEVNULL`. This is good practice and also prevents file handles from staying open unnecessarily. Also remove a couple unused or unne

[clang] [clang-tools-extra] [lldb] [llvm] [NFC] Prefer subprocess.DEVNULL over os.devnull (PR #106500)

2024-08-28 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/106500 >From b86b6ca2a14d5e26bd00b5e72c194ee5fbe23f5d Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 29 Aug 2024 02:47:58 -0400 Subject: [PATCH] [NFC] Prefer subprocess.DEVNULL over os.devnull There is

[clang] [clang-tools-extra] [lldb] [llvm] [NFC] Prefer subprocess.DEVNULL over os.devnull (PR #106500)

2024-08-28 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/106500 >From b86b6ca2a14d5e26bd00b5e72c194ee5fbe23f5d Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 29 Aug 2024 02:47:58 -0400 Subject: [PATCH] [NFC] Prefer subprocess.DEVNULL over os.devnull There is

[clang-tools-extra] [clang-tidy] Extend `bugprone-sizeof-expression` with matching `P +- sizeof(T)` and `P +- N */ sizeof(T)` cases, add `cert-arr39-c` alias (PR #106061)

2024-08-29 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank approved this pull request. Looks good to me 👍 https://github.com/llvm/llvm-project/pull/106061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] [llvm] [NFC] Prefer subprocess.DEVNULL over os.devnull (PR #106500)

2024-08-29 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Thanks! I have no commit access, please click the merge button :) https://github.com/llvm/llvm-project/pull/106500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC][clang-tidy] Add type annotations to add_new_check.py (PR #106801)

2024-08-30 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/106801 ``` python3 -m mypy --strict clang-tools-extra/clang-tidy/add_new_check.py Success: no issues found in 1 source file ``` >From 0213feed46b0cb7ba38410c26eba4d1d7226bd5b Mon Sep 17 00:00:00 2001 From: Nicolas v

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-30 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/106801 >From 6d4241a1858a0c46ceedf3034191a606af2e3941 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Fri, 30 Aug 2024 23:18:37 -0400 Subject: [PATCH] [clang-tidy] Add type annotations to add_new_check.py, fix

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-31 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Thanks for review! Addressed comments. I have no commit access, if/when this looks good to go you can go ahead and click merge. https://github.com/llvm/llvm-project/pull/106801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-31 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/106801 >From 3945829650ac41f587c161cd6fb505225efba379 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 31 Aug 2024 13:40:14 -0400 Subject: [PATCH] [clang-tidy] Add type annotations to add_new_check.py, fix

[clang-tools-extra] [NFC][clang-tidy] fix tests of deleted functions for missing-std-forward (PR #106861)

2024-08-31 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank approved this pull request. https://github.com/llvm/llvm-project/pull/106861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-30 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/106801 >From 6d4241a1858a0c46ceedf3034191a606af2e3941 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Fri, 30 Aug 2024 23:18:37 -0400 Subject: [PATCH] [clang-tidy] Add type annotations to add_new_check.py, fix

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-31 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/106801 >From 17f4b4a4320ded64b4d6ea673508e3d2f470d0aa Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 31 Aug 2024 13:46:52 -0400 Subject: [PATCH] [clang-tidy] Add type annotations to add_new_check.py, fix

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-30 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/106801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-30 Thread Nicolas van Kempen via cfe-commits
@@ -324,9 +329,14 @@ def add_release_notes(module_path, module, check_name, description): # Adds a test for the check. -def write_test(module_path, module, check_name, test_extension, test_standard): -if test_standard: -test_standard = f"-std={test_standard}-or-l

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-31 Thread Nicolas van Kempen via cfe-commits
@@ -754,7 +765,7 @@ def main(): language_restrict = ( f"%(lang)s.{cpp_language_to_requirements.get(args.standard, 'CPlusPlus')}" ) -elif language in ["objc", "objc++"]: +else: # "objc" or "objc++" language_restrict = "%(lang)s.ObjC

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-31 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/106801 >From 17f4b4a4320ded64b4d6ea673508e3d2f470d0aa Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 31 Aug 2024 13:46:52 -0400 Subject: [PATCH] [clang-tidy] Add type annotations to add_new_check.py, fix

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-31 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/106801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

2024-08-31 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/106801 >From 3945829650ac41f587c161cd6fb505225efba379 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 31 Aug 2024 13:40:14 -0400 Subject: [PATCH] [clang-tidy] Add type annotations to add_new_check.py, fix

[clang] [clang][Sema] Fix particular operator overload crash (PR #105976)

2024-09-02 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/105976 >From 465eadc6e5f83470764a14071f62f272c3cd7921 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 3 Sep 2024 00:43:30 -0400 Subject: [PATCH] [clang] Keep using declarations at head of list in addOrRe

[clang] [clang][Sema] Fix particular operator overload crash (PR #105976)

2024-09-02 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: The reason for the break in 0cb7e7ca0c864e052bf49978f3bcd667c9e16930 is that prior to this commit, using declarations were always kept at the front of the `NamedDecl` list. This behavior was changed in that commit. See a comment here: https://github.com/llvm/llvm-project/blob/3

[clang] [clang] Keep using declarations at head of list in addOrReplaceDecl (PR #105976)

2024-09-02 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/105976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-05-16 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From da3ec0033706609c79216fd2e5360c49304223f4 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 20 Apr 2024 02:58:25 + Subject: [PATCH] [run-clang-tidy.py] Refactor, add progress indicator, add

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-05-16 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Rebased on top of cc54129b983799e1aaea77aa0ff3040dc30cbc8c. Ping @PiotrZSL, what to do here? I can keep the current flush and separate stdout/stderr behavior in this PR, it can be changed later. But I don't think flushing fixes that issue of mis-ordered output lines, IMO either

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for two ends_with patterns (PR #105366)

2024-08-20 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/105366 Add support for the following two patterns which are found occasionally, that can be replaced with `ends_with`. ```cpp haystack.compare(haystack.length() - needle.length(), needle.length(), needle) == 0; hayst

[clang-tools-extra] [clang-tidy][run-clang-tidy] Fix minor shutdown noise (PR #105724)

2024-08-22 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/105724 On my new machine, the script outputs some shutdown noise: ``` Ctrl-C detected, goodbye. Traceback (most recent call last): File "/home/nvankempen/llvm-project/./clang-tools-extra/clang-tidy/tool/run-clang-ti

[clang-tools-extra] [clang-tidy][run-clang-tidy] Fix minor shutdown noise (PR #105724)

2024-08-24 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/105724 >From 84535cd4386a7afee32353e07c020e59420e36ef Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 24 Aug 2024 12:59:13 -0400 Subject: [PATCH] [clang-tidy][run-clang-tidy] Fix minor shutdown noise On

[clang-tools-extra] [clang-tidy][run-clang-tidy] Fix minor shutdown noise (PR #105724)

2024-08-24 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Added release note, rebased to trigger CI again. FWIW I don't remember this happening on any of the ~3 machines I tested on previously, and it only happens on interrupt, not normal execution. If you think this should be backported, let me know if there is anything I can help w

[clang] [clang][Sema] Fix particular operator overload crash (PR #105976)

2024-08-24 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/105976 Fix #104883. Fix #104800. Thanks @Endilll for the reduced reproducer. Bisection points to 0cb7e7ca0c864e052bf49978f3bcd667c9e16930 as the faulty commit, but nothing there seems to indicate what the problem is

[clang] [clang][Sema] Fix particular operator overload crash (PR #105976)

2024-08-24 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/105976 >From 033d4003154440fb00c62c0e85fe3dac4af10d22 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sun, 25 Aug 2024 02:57:55 -0400 Subject: [PATCH] [clang][Sema] Fix particular operator overload crash Fix

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-11 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/107521 >From 2033e5b44787b89244ccd76ac9422162bcfe8680 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 12 Sep 2024 00:54:39 -0400 Subject: [PATCH] [clang-tidy][readability-container-contains] Extend to any

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-11 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/107521 >From 2033e5b44787b89244ccd76ac9422162bcfe8680 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 12 Sep 2024 00:54:39 -0400 Subject: [PATCH] [clang-tidy][readability-container-contains] Extend to any

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-11 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: > ... and is sufficiently visible. I added `isPublic`, I think the false negatives where we are in another private method would be exceedingly rare so I don't think handling that case is necessary. > check if the type of the parameter from the called method and that of the >

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-11 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/107521 >From 6d49d5696f22642beecf3d95effbbba79c143306 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 12 Sep 2024 01:07:24 -0400 Subject: [PATCH] [clang-tidy][readability-container-contains] Extend to any

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-11 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/107521 >From 6d49d5696f22642beecf3d95effbbba79c143306 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 12 Sep 2024 01:07:24 -0400 Subject: [PATCH] [clang-tidy][readability-container-contains] Extend to any

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-11 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/107521 >From 6fae5b43f1e9227ccd41f67dde66233de1b0ed7b Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 12 Sep 2024 01:48:02 -0400 Subject: [PATCH] [clang-tidy][readability-container-contains] Extend to any

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-11 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/107521 >From 6fae5b43f1e9227ccd41f67dde66233de1b0ed7b Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 12 Sep 2024 01:48:02 -0400 Subject: [PATCH] [clang-tidy][readability-container-contains] Extend to any

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-11 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Update, now getting the same hits on llvm-project with/without type checking (553/553), a good indication no true positives are missed. https://github.com/llvm/llvm-project/pull/107521 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/108324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
@@ -19,20 +19,35 @@ Example: .. code-block:: c++ struct Base { -virtual void ~Base(); +virtual ~Base(); +int i; }; - + nicovank wrote: Nit here and below, no whitespace on blank lines for consistency. https://github.com/llvm/llvm-project/p

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
@@ -19,20 +19,35 @@ Example: .. code-block:: c++ struct Base { -virtual void ~Base(); +virtual ~Base(); +int i; }; - + struct Derived : public Base {}; - - void foo() { -Base *b = new Derived[10]; - + + // Function that takes a pointer and perform

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
@@ -50,14 +65,19 @@ Options void bar() { Base *b = new Base[10]; b += 1; // warning, as Base declares a virtual destructor - + delete[] b; - + Derived *d = new Derived[10]; // Derived overrides the destructor, and

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
@@ -50,14 +65,19 @@ Options void bar() { Base *b = new Base[10]; nicovank wrote: Also pass `b` and `d` as parameters instead of `new`/`delete`. https://github.com/llvm/llvm-project/pull/108324 ___ cfe-commi

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
@@ -19,20 +19,35 @@ Example: .. code-block:: c++ struct Base { -virtual void ~Base(); +virtual ~Base(); +int i; }; - + struct Derived : public Base {}; - - void foo() { -Base *b = new Derived[10]; - + + // Function that takes a pointer and perform

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank commented: Thanks! Some whitespace and comment nits. https://github.com/llvm/llvm-project/pull/108324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
@@ -19,20 +19,35 @@ Example: .. code-block:: c++ struct Base { -virtual void ~Base(); +virtual ~Base(); +int i; }; - + struct Derived : public Base {}; - - void foo() { -Base *b = new Derived[10]; - + + // Function that takes a pointer and perform

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
@@ -19,20 +19,23 @@ Example: .. code-block:: c++ struct Base { -virtual void ~Base(); +virtual ~Base(); +int i; }; - nicovank wrote: Sorry I wasn't clear, I meant to keep the spacing here between structs/functions, but when there is a blank

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank approved this pull request. https://github.com/llvm/llvm-project/pull/108324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
@@ -19,20 +19,23 @@ Example: .. code-block:: c++ struct Base { -virtual void ~Base(); +virtual ~Base(); +int i; }; - nicovank wrote: Yes LGTM. My nit was to not have any whitespace on blank lines, but I don't care that much. https://github.

[clang-tools-extra] [NFC][clang-tidy] Add type annotations to rename_check.py (PR #108443)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/108443 None >From 0127c0ecc7cbc8dc8a4b67d142487f29dbce93a6 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 12 Sep 2024 15:27:11 -0400 Subject: [PATCH] [NFC][clang-tidy] Add type annotations to rename_che

[clang-tools-extra] [NFC][clang-tidy] Add type annotations to rename_check.py (PR #108443)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
@@ -311,7 +315,7 @@ def main(): "Check name '%s' not found in %s. Exiting." % (check_name_camel, cmake_lists) ) -return 1 +sys.exit(1) nicovank wrote: Technically, this is a functional change.

[clang-tools-extra] [NFC][clang-tidy] Add type annotations to rename_check.py (PR #108443)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/108443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC][clang-tidy] Add type annotations to rename_check.py (PR #108443)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/108443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
@@ -19,20 +19,23 @@ Example: .. code-block:: c++ struct Base { -virtual void ~Base(); +virtual ~Base(); +int i; }; - nicovank wrote: Yes, I like the blank lines between functions/structs like in your screenshot above. Current PR version has

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
@@ -19,20 +19,23 @@ Example: .. code-block:: c++ struct Base { -virtual void ~Base(); +virtual ~Base(); +int i; }; - nicovank wrote: LGTM! Sorry for confusion. Do you need me to click the merge button? https://github.com/llvm/llvm-project/pu

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank approved this pull request. https://github.com/llvm/llvm-project/pull/108324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: ![image](https://github.com/user-attachments/assets/a40849e3-435c-4812-8aa0-3fa9ba5b6c5d) Looks like you have the "private email" setting enabled on GitHub, [I believe LLVM policy is to discourage it](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-a

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank closed https://github.com/llvm/llvm-project/pull/108324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve documentation of bugprone-pointer-arithmetic-on-polymorphic-object (PR #108324)

2024-09-12 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Worked. Thanks! https://github.com/llvm/llvm-project/pull/108324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] fix nullptr dereference in bugprone-forwarding-reference (PR #106856)

2024-09-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/106856 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [docs][clang-tidy] Correct StrictMode example in modernize-use-std-print (PR #108805)

2024-09-16 Thread Nicolas van Kempen via cfe-commits
@@ -109,7 +109,7 @@ Options .. code-block:: c++ -std::print("{} {}\n", static_cast(i), static_cast(u)); +std::print("{} {}\n", static_cast(u), static_cast(i)); nicovank wrote: The arguments shouldn't be swapped, I think the initial code block above

[clang-tools-extra] [docs][clang-tidy] Correct StrictMode example in modernize-use-std-print (PR #108805)

2024-09-16 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank commented: I think the example should be: ```cpp printf("%u %d\n", i, u); // Change here. // transforms to: std::println("{} {}", static_cast(i), static_cast(u)); // No change here. ``` https://github.com/llvm/llvm-project/pull/108805

[clang-tools-extra] [docs][clang-tidy] Correct StrictMode example in modernize-use-std-print (PR #108805)

2024-09-16 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/108805 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [docs][clang-tidy] Correct StrictMode example in modernize-use-std-print (PR #108805)

2024-09-16 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: cc @mikecrowe https://github.com/llvm/llvm-project/pull/108805 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] fix nullptr dereference in bugprone-forwarding-reference (PR #106856)

2024-09-16 Thread Nicolas van Kempen via cfe-commits
@@ -119,7 +123,6 @@ Changes in existing checks ` check to avoid false positive when member initialization depends on a structured binging variable. - nicovank wrote: Probably unwanted deleted line here. https://github.com/llvm/llvm-project/pull/106856

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-16 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/107521 >From 72db8b6b30b844bc6cf7502289945c4e34a837fa Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Mon, 16 Sep 2024 23:26:05 -0400 Subject: [PATCH] [clang-tidy][readability-container-contains] Extend to any

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-16 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/107521 >From 72db8b6b30b844bc6cf7502289945c4e34a837fa Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Mon, 16 Sep 2024 23:26:05 -0400 Subject: [PATCH] [clang-tidy][readability-container-contains] Extend to any

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-16 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: I was over-complicating the task. Instead of trying to match the type of the parameter with the type of the argument, I can just match the types of both parameters. Since on "normal" containers methods will have the same signature minus name, this shouldn't remove any true posi

[clang-tools-extra] [clang-tidy][readability-container-contains] Extend to any class with contains (PR #107521)

2024-09-16 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/107521 >From 6a12d3c9018361eb99eb7192d06517011aff7dde Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 17 Sep 2024 00:32:40 -0400 Subject: [PATCH] [clang-tidy][readability-container-contains] Extend to any

[clang-tools-extra] [clang-tidy][performance-move-const-arg] Fix crash when argument type has no definition (PR #111472)

2024-10-08 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/111472 >From 05519fa9c4a15c60759063e7a750b61a48abf956 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 8 Oct 2024 18:19:37 -0400 Subject: [PATCH] [clang-tidy][performance-move-const-arg] Fix crash when ar

[clang-tools-extra] [clang-tidy][performance-move-const-arg] Fix crash when argument type has no definition (PR #111472)

2024-10-08 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/111472 >From 05519fa9c4a15c60759063e7a750b61a48abf956 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 8 Oct 2024 18:19:37 -0400 Subject: [PATCH] [clang-tidy][performance-move-const-arg] Fix crash when ar

[clang-tools-extra] [clang-tidy] rewrite matchers in modernize-use-starts-ends-with (PR #112101)

2024-10-12 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank approved this pull request. Very nice improvement, LGTM, thanks!!! https://github.com/llvm/llvm-project/pull/112101 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

<    1   2   3   4   5   >