[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/72283 As per title. A small improvement to this check, `string_view` should work out of the box. I am slowly looking into adding an option to this check to recommend C++20's API `starts_with`, and move it to `modern

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
@@ -22,6 +22,21 @@ struct basic_string { typedef basic_string string; typedef basic_string wstring; +template +class basic_string_view { +public: + basic_string_view(); + basic_string_view(const basic_string_view &); + basic_string_view(const C *); + ~basic_string_view();

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From 3abdf06b2128fbd6ccc03f804a8d3bdde6d772c9 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add string_view

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From dc890dc762a3400937a6a5d91963dead024c3569 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add string_view

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank ready_for_review https://github.com/llvm/llvm-project/pull/72283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: First time with LLVM GitHub PR workflow. Am I supposed to tag potential reviewers? @gribozavr @hokein @njames93 https://github.com/llvm/llvm-project/pull/72283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From a7361968b8a1acc48c4ef563c70f5c56f2633eac Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add string_view

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From 1761f02f54f125948b10d2321807af2154dbbc3f Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add string_view

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From 42364ebb6f3e5771947133599a1142522c511337 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add string_view

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: > Copy this check. Got it. Thanks for the pointer! > Documentation, string header. I think I covered everything, had to add a couple of skeletons to that `string` common header. https://github.com/llvm/llvm-project/pull/72283 ___ cf

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72283 >From cf4a78c252c5aac820581b90c28c6581c6e41cfb Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Tue, 14 Nov 2023 08:31:05 -0800 Subject: [PATCH] [clang-tidy][abseil-string-find-startswith] Add string_view

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Addressed feedback. I do not have commit access, can you please merge after CI is green? Assuming GitHub will properly populate information, if not you can use `Nicolas van Kempen `. https://github.com/llvm/llvm-project/pull/72283 ___

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/72385 Matchers are copied over from abseil-string-find-startswith, only the error message is different and suggests `std::{string|string_view}::starts_with` instead of the Abseil equivalent. >From 5e5a2bac0f7373e6b1

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 58e1392e140f0d5b932fce683a07fb799ef6b89f Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-string-find-startswith check

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank ready_for_review https://github.com/llvm/llvm-project/pull/72385 ___ 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 modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 2b01f9d8cb945d8332a271947492ec0fe7a6f7c0 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-string-find-startswith check

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From d9995b339e787374452b65fcffa8b3acf4aade3d Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-string-find-startswith check

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From d31148a9d99004f1a64dc6dc1bce85a58985aa0f Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-string-find-startswith check

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/72385 ___ 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 modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
@@ -0,0 +1,105 @@ +//===--- StringFindStartswithCheck.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 modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: > Detect the `str.compare("marker", 0, 6) == 0` pattern. This is actually in my notes for making this check / codemod. No performance impact so not tackling yet, maybe in the future. > Support `ends_with` in same check. Similar as above, matching for that length argument is a

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
@@ -0,0 +1,41 @@ +//===--- StringFindStartswithCheck.h - clang-tidy ---*- 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 modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: I like `XXX-use-starts-ends-with`. I would rather move it to `performance` than `readability` if not `modernize`. @PiotrZSL thoughts before I go ahead and do the renaming? Also move it somewhere else? https://github.com/llvm/llvm-project/pull/72385 _

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 35a78d8fa7d16c60f7b40b3f0b53cc38c26b58b9 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-string-find-startswith check

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 9c6123e91f6a075a6a4cc7c2aba8c76152539ae2 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-string-find-startswith check

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 5d66e404d9b6536814f004a64e1c7f0d27bd1f03 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-string-find-startswith check

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From fd3e09fddae97549c327cf224d66de144221fe83 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-string-find-startswith check

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Addressed feedback, renamed to `performance-use-starts-ends-with`, relaxed use of `auto`. https://github.com/llvm/llvm-project/pull/72385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/72385 ___ 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 performance-use-starts-ends-with check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/72385 ___ 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 performance-use-starts-ends-with check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 96e00378116ca5fbfad6edb220e86326dc4f9897 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new performance-use-starts-ends-with check

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From ddac6dc91c443bf81d4b6cc3f75686ea56801094 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new performance-use-starts-ends-with check

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Major changes: - Now matching on any class that has a `starts_with`, `startsWith`, or `startswith` function. This is done in order (prioritising functions in subclasses, but this could be changed). Experimenting on making this an option, not sure it's worth it without control

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Nicolas van Kempen via cfe-commits
@@ -12,4 +12,4 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; typedef __SIZE_TYPE__ size_t; -#endif _STDDEF_H_ +#endif // _STDDEF_H_ nicovank wrote: This was just issuing a warning in some tests. https://github.com/llvm/llvm-project/pull/72385 __

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Nicolas van Kempen via cfe-commits
@@ -0,0 +1,109 @@ +//===--- UseStartsEndsWithCheck.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 performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 7a9703f27897af0846d272ca7393bc72eff11e55 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new performance-use-starts-ends-with check

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-22 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 22caf9b39e927e61eaef0499266dd7ab8e252ba0 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new performance-use-starts-ends-with check

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-22 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From e0074d270f2b78f8202c822a61a0d723e1adb2a3 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new performance-use-starts-ends-with check

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-22 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Updates. I've been running into issues when the begin location of the entire expression is a macro. The prefix removal, which should include the macro text, is not working as I expect it to. If you know of any checks that have similar logic I can take a look and copy. I just di

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-22 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 0dc3f43049ca8558442ee2a6fbaf15da1510a9a3 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new performance-use-starts-ends-with check

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-22 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: @EugeneZelenko We've had this discussion, see here and the couple comments below: https://github.com/llvm/llvm-project/pull/72385#issuecomment-1812801402. I guess I can rename one more time if there is consensus. https://github.com/llvm/llvm-project/pull/72385 _

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-28 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Ping. @carlosgalvezp could you please weigh in? modernize / performance? Anyone else? I have no real preference either way. Now that modernize is fully integrated in Clang-Tidy, I don't think historical reasons should lead to modernize overbloat. If this check was only replaci

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-12-01 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 316b45d612c63f8eea8f847d1cd39992898516f3 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-use-starts-ends-with check

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-01 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/72385 ___ 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 modernize-use-starts-ends-with check (PR #72385)

2023-12-01 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/72385 ___ 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 modernize-use-starts-ends-with check (PR #72385)

2023-12-01 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Thank you!! Modernize wins the vote, I've renamed the check. https://github.com/llvm/llvm-project/pull/72385 ___ 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 modernize-use-starts-ends-with check (PR #72385)

2023-12-01 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 86292b1489a6e3998afb52e0625f0c38ff7657a5 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-use-starts-ends-with check

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-01 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: > Support for `ends_with`. Planning to look into it and other `starts_with` patterns. I do not have commit access, please merge for me (`Nicolas van Kempen `). https://github.com/llvm/llvm-project/pull/72385 ___ cfe-commits mailing l

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-04 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Thanks! There should be no more warning. I tried to edit my GitHub settings, great if it worked, otherwise GitHub or personal email is fine. https://github.com/llvm/llvm-project/pull/72385 ___ cfe-commits mailing list cfe-commits@list

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-04 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From c6b5aac2b5a3d90d11a8fc0d092c2e794cff5856 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-use-starts-ends-with check

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-04 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: I've made it my primary email, if it's not an option, `@fb`, `@gmail`, or the GitHub indirection is fine. https://github.com/llvm/llvm-project/assets/7906725/6ae684b4-429b-4f09-bb97-f4525422da39";> https://github.com/llvm/llvm-project/pull/72385 ___

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-04 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 2b7748352281eb1dfa85cc8e4672488dfadee277 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new modernize-use-starts-ends-with check

[clang-tools-extra] [clang-tidy] Add new modernize-use-starts-ends-with check (PR #72385)

2023-12-04 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Changed author to `@meta` in latest push, hopefully this fixes it... Didn't realise `@fb` was still default on my server. https://github.com/llvm/llvm-project/pull/72385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang-tools-extra] [clang-tidy] Avoid repeated hash lookups (NFC) (PR #107490)

2024-09-05 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank approved this pull request. Are you finding those automatically with a tool? Or just stumbled upon it? https://github.com/llvm/llvm-project/pull/107490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

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

2024-09-05 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/107521 This check will now work out of the box with other containers that have a `contains` method, such as `folly::F14` or Abseil containers. It will also work with strings, which are basically just weird containers

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

2024-09-05 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Pinging @vogelsgesang, @PiotrZSL, @5chmidti, @HerrCai0907, @carlosgalvezp for review. I applied this modified version to llvm-project root, **554 files changed**, `check-all` passes. Almost all cases are moving from `count` to `contains`. How do you suggest putting up this PR

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

2024-09-06 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/107521 >From f0f305a3deabafa9874f8b63325750bd3b1b831d Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Fri, 6 Sep 2024 10:30:22 -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-06 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/107521 >From f0f305a3deabafa9874f8b63325750bd3b1b831d Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Fri, 6 Sep 2024 10:30:22 -0400 Subject: [PATCH] [clang-tidy][readability-container-contains] Extend to any

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

2024-09-06 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/105366 >From 7e734f7c2e5e487bb3c6f9e30ff92f0ef129f409 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Fri, 6 Sep 2024 10:34:49 -0400 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 two ends_with patterns (PR #105366)

2024-09-06 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Rebase to resolve merge conflict. Ping. https://github.com/llvm/llvm-project/pull/105366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix #embed crash (PR #107764)

2024-09-08 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/107764 Fix #107724. >From a43b9b74ac253c0072498007cf56ed57d8255143 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sun, 8 Sep 2024 11:52:28 -0400 Subject: [PATCH] [clang][analyzer] Fix #embed crash Fix #10

[clang] [clang][analyzer] Fix #embed crash (PR #107764)

2024-09-08 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: PS: Should this be cherry-picked into 19? https://github.com/llvm/llvm-project/pull/107764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] remove type annotations that require python3.9 in add_new_check.py (PR #107850)

2024-09-09 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank commented: I commented in issue but I think the problem is with `re.Match` not Tuple. [Python docs](https://docs.python.org/3.5/library/typing.html#typing.Tuple) seem to show Tuple had subscripting from its introduction in 3.5. The script currently passes a strict m

[clang-tools-extra] [clang-tidy] remove type annotations that require python3.9 in add_new_check.py (PR #107850)

2024-09-09 Thread Nicolas van Kempen via cfe-commits
@@ -526,7 +526,7 @@ def process_doc(doc_file: Tuple[str, str]) -> Tuple[str, Optional[re.Match[str]] # Is it a redirect? return check_name, match -def format_link(doc_file: Tuple[str, str]) -> str: +def format_link(doc_file) -> str: ---

[clang-tools-extra] [clang-tidy] remove type annotations that require python3.9 in add_new_check.py (PR #107850)

2024-09-09 Thread Nicolas van Kempen via cfe-commits
@@ -538,7 +538,7 @@ def format_link(doc_file: Tuple[str, str]) -> str: else: return "" -def format_link_alias(doc_file: Tuple[str, str]) -> str: +def format_link_alias(doc_file) -> str: nicovank wrote: So can this. https://github.

[clang-tools-extra] [clang-tidy] remove type annotations that require python3.9 in add_new_check.py (PR #107850)

2024-09-09 Thread Nicolas van Kempen via cfe-commits
@@ -511,7 +511,7 @@ def has_auto_fix(check_name: str) -> str: return "" -def process_doc(doc_file: Tuple[str, str]) -> Tuple[str, Optional[re.Match[str]]]: +def process_doc(doc_file): nicovank wrote: Change the `re.Match[str]` to `typing.Any

[clang-tools-extra] [clang-tidy] remove type annotations that require python3.9 in add_new_check.py (PR #107850)

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

[clang-tools-extra] [clang-tidy] remove type annotations that require python3.9 in add_new_check.py (PR #107850)

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

[clang-tools-extra] [clang-tidy][NFC] fix add_new_check python3.8 incompatibility (PR #107871)

2024-09-09 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: I see `typing.Match` will be [removed in 3.13](https://docs.python.org/3/library/typing.html#typing.Match). I'm not sure if that means it won't work altogether with 3.13 or just the typecheck. ![image](https://github.com/user-attachments/assets/c3d77647-356d-43ba-b344-da8822a0d

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

2024-09-09 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: I'm going to go ahead and merge this. IMO this doesn't need backporting because 1. it only happens on abnormal exit where users probably wouldn't be surprised to see a stacktrace anyway, and 2. there is no regression really (check prior to asyncio change also had some noise aft

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

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

[clang-tools-extra] [clang-tidy][NFC] fix add_new_check python3.8 incompatibility (PR #107871)

2024-09-09 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Update: I misread the docs, `typing.re` is what's going to be removed, `typing.Match` is only deprecated but not planned for removal yet. Still think `Any` is the way to go to avoid introducing the deprecated type but either solution is actually fine. https://github.com/llvm/l

[clang-tools-extra] [clang-tidy][NFC] fix add_new_check python3.8 incompatibility (PR #107871)

2024-09-09 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Exactly, IMO the move to 3.9 minimum should be in 6-12 months to leave a bit of time after EOL. 3.9 also has subscriptable `tuple`, `list` and `dict` which is nice. https://github.com/llvm/llvm-project/pull/107871 ___ cfe-commits mai

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/104148 `hasOperands` does not always execute matchers in the order they are written. This can cause issue in code using bindings when one operand matcher is relying on a binding set by the other. With this change, th

[clang] [clang-tools-extra] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/104148 >From 6429dd6935343b343ce3082c13e772425caea15a Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 14 Aug 2024 14:47:52 -0400 Subject: [PATCH 1/2] [clang][ASTMatcher] Fix execution order of hasOperands

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/104148 >From 6429dd6935343b343ce3082c13e772425caea15a Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 14 Aug 2024 14:47:52 -0400 Subject: [PATCH] [clang][ASTMatcher] Fix execution order of hasOperands su

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/104148 >From 3ee431b27ac1d20cc6446fc6a8c663f33dd17d12 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 14 Aug 2024 14:48:57 -0400 Subject: [PATCH] [clang][ASTMatcher] Fix execution order of hasOperands su

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/104148 >From 168f812b5817ea2a9a80e0a6b52b2005e57d327c Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 14 Aug 2024 14:54:20 -0400 Subject: [PATCH] [clang][ASTMatcher] Fix execution order of hasOperands su

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/104148 >From 631dce009698938a5fc380ae0af054fbc6d741ea Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 15 Aug 2024 10:49:53 -0400 Subject: [PATCH] [clang][ASTMatcher] Fix execution order of hasOperands su

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/104148 >From 462fc6fff523496bee9ffc5516315d6622ec3ee3 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 15 Aug 2024 11:02:36 -0400 Subject: [PATCH] [clang][ASTMatcher] Fix execution order of hasOperands su

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-15 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Thanks a lot for the pointers! Added a test and a note 👍. Let me know if this is adequate. If/when CI passes if everything looks in order you can press the merge button, I don't have commit access. https://github.com/llvm/llvm-project/pull/104148 ___

[clang-tools-extra] My Commit, Second commit. (PR #96115)

2024-06-19 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/96115 My Commit, Second commit. >From 3a4de668b952c4db849f41b34c0f9e7869506c96 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 19 Jun 2024 16:40:37 -0400 Subject: [PATCH] My Commit, Second commit. ---

[clang-tools-extra] My Commit, Second commit. (PR #96115)

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

[clang-tools-extra] My Commit, Second commit. (PR #96115)

2024-06-19 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Oops, was demoing something. Closing. https://github.com/llvm/llvm-project/pull/96115 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [Ignore] (PR #96115)

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

[clang-tools-extra] [Ignore] (PR #96115)

2024-06-19 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank edited https://github.com/llvm/llvm-project/pull/96115 ___ 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-28 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-05-28 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From 33485bf2ab3c683897f1381f3f4ab8294bdb0b72 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-28 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: - Minor change to progress indicator to stay aligned. - Go back to printing command line. I'm fine with leaving this as-is. - I think I pruned some changes by accident on rebase, thanks @5chmidti! Restored runtime number and initial message. -- > More graceful shutdown wo

[clang-tools-extra] [llvm] Apply modernize-use-starts-ends-with on llvm-project (PR #89140)

2024-04-17 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/89140 Run `modernize-use-starts-ends-with` on llvm-project. Two instances are flagged, minor readability improvements, extremely minor performance improvements. ``` python3 clang-tools-extra/clang-tidy/tool/run-clan

[clang-tools-extra] [llvm] Apply modernize-use-starts-ends-with on llvm-project (PR #89140)

2024-04-17 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: `std::string::starts_with` is only available from C++20, and LLVM is limited to C++17 as far as I know. However, the two objects here are `StringRef` so this is safe. https://github.com/llvm/llvm-project/pull/89140 ___ cfe-commits mai

[clang-tools-extra] [lldb] [llvm] Apply modernize-use-starts-ends-with on llvm-project (PR #89140)

2024-04-19 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89140 >From 2c82316a0f6641b93c666143211a87f06de8feab Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 17 Apr 2024 14:27:42 -0400 Subject: [PATCH] Apply modernize-use-starts-ends-with on llvm-project ---

[clang-tools-extra] [lldb] [llvm] Apply modernize-use-starts-ends-with on llvm-project (PR #89140)

2024-04-19 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Added one missed instance due to CMake configuration options. https://github.com/llvm/llvm-project/pull/89140 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [lldb] [llvm] Apply modernize-use-starts-ends-with on llvm-project (PR #89140)

2024-04-19 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: Maybe @kazutakahirata (or anyone else) can stamp the minor `clang-doc` change? I don't have commit access, feel free to hit merge when everything is in order 👍 . https://github.com/llvm/llvm-project/pull/89140 ___ cfe-commits mailing

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

2024-04-19 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/89490 [There is work](https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-python-version/67571) to make Python 3.8 the minimum Python version for LLVM. I edited this script because I wanted some indica

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

2024-04-19 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From 8b52200a0ccfa801471e7326859276ef9b46 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] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-20 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/89530 Using `compare` is the next most common roundabout way to express `starts_with` before it was added to the standard. In this case, using `starts_with` is a readability improvement. Extend existing `modernize-us

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

2024-04-20 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89530 >From 5f20627f74103d3b2b5adf484c902b85228006dd 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-20 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89530 >From 7a2ff84f113959bc89f50b6eef7ee9762e6f5d2f 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-21 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89530 >From ff7ebb3086d5467685e54435f3eabe86c76c24b0 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

  1   2   3   4   5   >