[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-13 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/88645 Fixes https://github.com/clangd/clangd/issues/1821 >From 42ee794d3de89241fae7314db2202cac32af469b Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 14 Apr 2024 02:41:48 -0400 Subject: [PATCH] [clang]

[clang] [clang][docs] fix whitespace in AttrDocs.td (PR #88631)

2024-04-13 Thread via cfe-commits
github-actions[bot] wrote: @chrisnc Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build,

[clang] [clang][docs] fix whitespace in AttrDocs.td (PR #88631)

2024-04-13 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/88631 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 09327ef - [clang][docs] fix whitespace in AttrDocs.td (#88631)

2024-04-13 Thread via cfe-commits
Author: Chris Copeland Date: 2024-04-14T08:37:58+02:00 New Revision: 09327efdf0f02c4f865a4536db96cac539bb1c01 URL: https://github.com/llvm/llvm-project/commit/09327efdf0f02c4f865a4536db96cac539bb1c01 DIFF: https://github.com/llvm/llvm-project/commit/09327efdf0f02c4f865a4536db96cac539bb1c01.diff

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-04-13 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: @@ -14,7 +14,7 @@ struct A { int a; A(int a) : a(a) {} virtual ~A(); }; // PartialTranslationUnit. inline A::~A() { printf("~A(%d)\n", a); } -// Create one instance with new and delete it. +// Create one instance with new

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
Sirraide wrote: > Given that a subsequent patch will add the necessary test coverage and the > above problems I think it is reasonable for explicit tests for > `LateAttrParsingExperimentalOnly` to be omitted Yeah, if it’s not used anywhere or if both prs are merged at the same time, then that

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread Dan Liew via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + +static LateAttrParseKind getLateAt

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread Dan Liew via cfe-commits
https://github.com/delcypher updated https://github.com/llvm/llvm-project/pull/88596 >From 554287a724361a510389d7f34f9b57cf434b9657 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 12 Apr 2024 17:36:19 -0700 Subject: [PATCH 1/2] [Attributes] Support Attributes being declared as only supporti

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread Dan Liew via cfe-commits
delcypher wrote: @Sirraide Thanks for the feedback. > This should also add some tests that actually use experimentally late-parsed > attributes w/ the flag explicilty enabled/disabled. The intention is for the functionality being added to be used in a subsequent PR. This is currently sketch

[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes Fixes clang-ppc64-aix bot failure after #88559 (0a6f6df5b0c3d0f2a42f013bf5cafb9b5020dcac) https://lab.llvm.org/buildbot/#/builders/214/builds/11887 --- Full diff: https://github.com/llvm/llvm-project/

[clang] [clang] Fix name conflict with `sys/mac.h` on AIX (PR #88644)

2024-04-13 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/88644 Fixes clang-ppc64-aix bot failure after #88559 (0a6f6df5b0c3d0f2a42f013bf5cafb9b5020dcac) https://lab.llvm.org/buildbot/#/builders/214/builds/11887 >From 9d46b1ed31d2acbb772f9bb4b139fa1ec36a65ab Mon Sep 17 00:0

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -2101,9 +2179,20 @@ bool PragmaClangAttributeSupport::isAttributedSupported( return SpecifiedResult; // Opt-out rules: - // An attribute requires delayed parsing (LateParsed is on) - if (Attribute.getValueAsBit("LateParsed")) + + // An attribute requires delayed pa

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + +static LateAttrParseKind getLateAt

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread Dan Liew via cfe-commits
@@ -2101,9 +2179,20 @@ bool PragmaClangAttributeSupport::isAttributedSupported( return SpecifiedResult; // Opt-out rules: - // An attribute requires delayed parsing (LateParsed is on) - if (Attribute.getValueAsBit("LateParsed")) + + // An attribute requires delayed pa

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread Dan Liew via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + +static LateAttrParseKind getLateAt

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread Dan Liew via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + +static LateAttrParseKind getLateAt

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + Sirraide wrote: I

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread Dan Liew via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + delcypher wrote:

[clang] [clang] Introduce `SemaCUDA` (PR #88559)

2024-04-13 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I think I exposed a name conflict with a system header on AIX by including `Cuda.h` in `Sema.h`. Given that this name conflict potentially affects both enum definition and its usage, how should we resolve this? https://github.com/llvm/llvm-project/pull/88559

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + +static LateAttrParseKind getLateAt

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -2885,8 +2974,23 @@ static void emitAttributes(RecordKeeper &Records, raw_ostream &OS, return; } OS << "\n : " << SuperName << "(Ctx, CommonInfo, "; - OS << "attr::" << R.getName() << ", " - << (R.getValueAsBit("LateParsed") ? "true" : "fal

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + +static LateAttrParseKind getLateAt

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -2885,8 +2974,23 @@ static void emitAttributes(RecordKeeper &Records, raw_ostream &OS, return; } OS << "\n : " << SuperName << "(Ctx, CommonInfo, "; - OS << "attr::" << R.getName() << ", " - << (R.getValueAsBit("LateParsed") ? "true" : "fal

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + +static LateAttrParseKind getLateAt

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + +static LateAttrParseKind getLateAt

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -2101,9 +2179,20 @@ bool PragmaClangAttributeSupport::isAttributedSupported( return SpecifiedResult; // Opt-out rules: - // An attribute requires delayed parsing (LateParsed is on) - if (Attribute.getValueAsBit("LateParsed")) + + // An attribute requires delayed pa

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + +static LateAttrParseKind getLateAt

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + Sirraide wrote: T

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + +static LateAttrParseKind getLateAt

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
https://github.com/Sirraide requested changes to this pull request. Not too familiar w/ the overall context of this, so I can only comment on the implementation. This should also add some tests that actually use experimentally late-parsed attributes w/ the flag explicilty enabled/disabled. ht

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
@@ -1822,28 +1822,106 @@ void WriteSemanticSpellingSwitch(const std::string &VarName, OS << " }\n"; } +enum class LateAttrParseKind { + LateAttrParsingNever = 0, + LateAttrParsingAlways = 1, + LateAttrParsingExperimentalOnly = 2 +}; + +static LateAttrParseKind getLateAt

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-13 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/88596 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #87933)

2024-04-13 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/87933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't break between string literal operands of << (PR #69871)

2024-04-13 Thread Owen Pan via cfe-commits
owenca wrote: > I wish we'd made this removal an option rather than just removing it, what we > are seeing is reasonably formatted json or xml being streamed out is now > poorly written > > ```c++ > osjson << "{\n" ><<" \"name\": \"value\",\n" ><<" \"key\": \"abc\", \n" >

[clang] [clang] Introduce `SemaOpenMP` (PR #88642)

2024-04-13 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I intentionally split formatting changes into a separate commit if reviewers want to look at changes without formatting noise. If, given the volume of changes here, there is an appetite to remove `OpenMP` and `OMP` from names inside `SemaOpenMP` right in this patch, I can do tha

[clang] [clang] Introduce `SemaOpenMP` (PR #88642)

2024-04-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-openmp Author: Vlad Serebrennikov (Endilll) Changes This patch moves OpenMP-related entities out of `Sema` to a newly created `SemaOpenMP` class. This is a part of the effort to split `Sema` up, and follows the recent example of CUDA, OpenACC, SYCL, HL

[clang] [clang] Fix high memory consumption during pack deduction (PR #88637)

2024-04-13 Thread via cfe-commits
Sirraide wrote: > I can supply the exact code that causes this issue if needed, but I would > appreciate if you frends can point me to any tools that can generate an > obfuscated minimal reproducible example. There’s `creduce` and `cvise` from what I recall, but I’m not particularly good at u

[clang] [clang] Fix high memory consumption during pack deduction (PR #88637)

2024-04-13 Thread via cfe-commits
@@ -831,7 +831,7 @@ class PackDeductionScope { if (IsPartiallyExpanded) PackElements += NumPartialPackArgs; else if (IsExpanded) - PackElements += *FixedNumExpansions; + PackElements += FixedNumExpansions.value_or(1); Sirraide wrote: Th

[clang] [clang] Fix high memory consumption during pack deduction (PR #88637)

2024-04-13 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/88637 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][DR1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #87933)

2024-04-13 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/87933 >From 9fba6da7cb1ffbc7d46b69c6ac0cfd15a89c4b56 Mon Sep 17 00:00:00 2001 From: yronglin Date: Mon, 8 Apr 2024 01:38:23 +0800 Subject: [PATCH] [Clang] Support lifetime extension of temporary created by aggregate

[clang] Fix an issue where clang++ and clangd uses enormous amounts of memory (PR #88637)

2024-04-13 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I'm not sure this is testable, but if you can think of a test, that would be nice. Can you also add a release note to `clang/ReleaseNotes.rst`? https://github.com/llvm/llvm-project/pull/88637 ___ cfe-commits mailing list cfe-commits@lis

[clang] [Clang][DR1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #87933)

2024-04-13 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/87933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce `SemaCUDA` (PR #88559)

2024-04-13 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: @fhahn Yeah, that's theoretically possible. I'll look into it today. https://github.com/llvm/llvm-project/pull/88559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix issue on requires expression with templated base class member function (PR #85198)

2024-04-13 Thread Qizhi Hu via cfe-commits
@@ -7735,7 +7735,8 @@ ExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, } if (CXXMethodDecl *Method = dyn_cast_or_null(FDecl)) -if (Method->isImplicitObjectMemberFunction()) +if (!isa(CurContext) && jcsxky wrote: And if only chec

[clang-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-13 Thread Mike Weller via cfe-commits
MikeWeller wrote: Sorry, didn't realize there are release notes I can updated in the change itself. Will do this Monday. https://github.com/llvm/llvm-project/pull/88138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] Fix an issue where clang++ and clangd uses enormous amounts of memory (PR #88637)

2024-04-13 Thread via cfe-commits
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Discourse](https://discourse.llvm.org/t/hidden-email

[clang] [clang-format] New clang-format-indent-mode for Emacs (PR #78904)

2024-04-13 Thread Amy Grinn via cfe-commits
amygrinn wrote: ping https://github.com/llvm/llvm-project/pull/78904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] check `std::string_view` and custom string-like classes in `readability-string-compare` (PR #88636)

2024-04-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Vadim D. (vvd170501) Changes This PR aims to expand the list of classes that are considered to be "strings" by `readability-string-compare` check. 1. Currently only `std::string;:compare` is checked, but `std::string_view` h

[clang-tools-extra] [clang-tidy] check `std::string_view` and custom string-like classes in `readability-string-compare` (PR #88636)

2024-04-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Vadim D. (vvd170501) Changes This PR aims to expand the list of classes that are considered to be "strings" by `readability-string-compare` check. 1. Currently only `std::string;:compare` is checked, but `std::string_view` has a si

[clang-tools-extra] [clang-tidy] check `std::string_view` and custom string-like classes in `readability-string-compare` (PR #88636)

2024-04-13 Thread Vadim D. via cfe-commits
https://github.com/vvd170501 ready_for_review https://github.com/llvm/llvm-project/pull/88636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] check `std::string_view` and custom string-like classes in `readability-string-compare` (PR #88636)

2024-04-13 Thread Vadim D. via cfe-commits
@@ -7,42 +7,70 @@ //===--===// #include "StringCompareCheck.h" -#include "../utils/FixItHintUtils.h" +#include "../utils/OptionsUtils.h" #include "clang/AST/ASTContext.h" #include "clang/ASTMatchers/ASTMatc

[clang-tools-extra] [clang-tidy] check `std::string_view` and custom string-like classes in `readability-string-compare` (PR #88636)

2024-04-13 Thread Vadim D. via cfe-commits
https://github.com/vvd170501 updated https://github.com/llvm/llvm-project/pull/88636 >From 0db24a6806e9429b5e7b9cd9d0777315b3e6d87e Mon Sep 17 00:00:00 2001 From: Vadim Dudkin Date: Sat, 13 Apr 2024 23:36:12 +0300 Subject: [PATCH] readability-string-compare: check std::string_view, allow custo

[clang-tools-extra] [clang-tidy] check `std::string_view` and custom string-like classes in `readability-string-compare` (PR #88636)

2024-04-13 Thread Vadim D. via cfe-commits
https://github.com/vvd170501 updated https://github.com/llvm/llvm-project/pull/88636 >From b63dd11ea87cd504c8972de6ed29330d6702abca Mon Sep 17 00:00:00 2001 From: Vadim Dudkin Date: Sat, 13 Apr 2024 23:36:12 +0300 Subject: [PATCH] readability-string-compare: check std::string_view, allow custo

[clang-tools-extra] [clang-tidy] check `std::string_view` and custom string-like classes in `readability-string-compare` (PR #88636)

2024-04-13 Thread Vadim D. via cfe-commits
https://github.com/vvd170501 updated https://github.com/llvm/llvm-project/pull/88636 >From 91eccdd291fa4f0753aa8e9970fa146516823e22 Mon Sep 17 00:00:00 2001 From: Vadim Dudkin Date: Sat, 13 Apr 2024 23:36:12 +0300 Subject: [PATCH] readability-string-compare: check std::string_view, allow custo

[clang] Fix an issue where clang++ and clangd uses enormous amounts of memory (PR #88637)

2024-04-13 Thread via cfe-commits
https://github.com/term-est edited https://github.com/llvm/llvm-project/pull/88637 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add ``ignoringParenImpCasts`` in ``hasAnyArgument`` fix#75754 (PR #87268)

2024-04-13 Thread via cfe-commits
https://github.com/komalverma04 updated https://github.com/llvm/llvm-project/pull/87268 >From 9b5781108081565e4009c3809eab623387655f1c Mon Sep 17 00:00:00 2001 From: komalverma04 Date: Mon, 1 Apr 2024 22:43:10 +0530 Subject: [PATCH 1/7] [clang-tidy] Add ignoringParenImpCasts in hasAnyArgument

[clang] Fix an issue where clang++ and clangd uses enormous amounts of memory (PR #88637)

2024-04-13 Thread via cfe-commits
https://github.com/term-est edited https://github.com/llvm/llvm-project/pull/88637 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix an issue where clang++ and clang uses enormous amounts of memory (PR #88637)

2024-04-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (term-est) Changes Henlo frens! 🍓 We folks at Armelsan Defense has been using LLVM for quite some time. Recently we encountered an issue with clangd where it tries to allocate 137 gigs of memory in one of our template heavy codebas

[clang] Fix an issue where clang++ and clang uses enormous amounts of memory (PR #88637)

2024-04-13 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] Fix an issue where clang++ and clang uses enormous amounts of memory (PR #88637)

2024-04-13 Thread via cfe-commits
https://github.com/term-est created https://github.com/llvm/llvm-project/pull/88637 Henlo frens! 🍓 We folks at Armelsan Defense has been using LLVM for quite some time. Recently we encountered an issue with clangd where it tries to allocate 137 gigs of memory in one of our template heavy cod

[clang-tools-extra] [clang-tidy] check `std::string_view` and custom string-like classes in `readability-string-compare` (PR #88636)

2024-04-13 Thread Vadim D. via cfe-commits
https://github.com/vvd170501 edited https://github.com/llvm/llvm-project/pull/88636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] check `std::string_view` and custom string-like classes in `readability-string-compare` (PR #88636)

2024-04-13 Thread Vadim D. via cfe-commits
https://github.com/vvd170501 created https://github.com/llvm/llvm-project/pull/88636 This PR aims to expand the list of classes that are considered to be "strings" by `readability-string-compare` check. 1. Currently `readability-string-compare` only checks `std::string;:compare`, but `std::s

[clang] [clang][docs] fix whitespace in AttrDocs.td (PR #88631)

2024-04-13 Thread Chris Copeland via cfe-commits
chrisnc wrote: Ready to merge, but I'm not able to myself. https://github.com/llvm/llvm-project/pull/88631 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-13 Thread Björn Schäpers via cfe-commits
@@ -5598,11 +5598,45 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, // FIXME: Breaking after newlines seems useful in general. Turn this into an // option and recognize more cases like endl etc, and break independent of // what comes after operator le

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-13 Thread Björn Schäpers via cfe-commits
@@ -2193,6 +2193,41 @@ struct FormatStyle { /// \version 3.7 bool BreakBeforeTernaryOperators; + /// Different ways to Break Between Chevrons. + enum BreakChevronOperatorStyle : int8_t { +/// Break using ColumnLimit rules. +/// \code +/// os << "a" << "

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-13 Thread Björn Schäpers via cfe-commits
@@ -5598,10 +5598,34 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, // FIXME: Breaking after newlines seems useful in general. Turn this into an // option and recognize more cases like endl etc, and break independent of // what comes after operator le

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-04-13 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/84758 >From f28fc3aa917b24063707f99dd6545512630f48e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= Date: Sun, 10 Mar 2024 18:17:48 +0100 Subj

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-13 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: @sopyb Check is for modernize, not performance, so: - Add entry in documentation that due to need of copy object into initialization list check may cause performance degradation, add entry that using std::ref, std::cref is recommended in such case: `b = std::max({std::ref(i), s

[clang] [Clang Format] Fixing erroneous statements in tests; nsc (PR #88628)

2024-04-13 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/88628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce `SemaCUDA` (PR #88559)

2024-04-13 Thread Florian Hahn via cfe-commits
fhahn wrote: Is it possible that this broke this bot failing with the error below? ``` usr/local/clang-17.0.2/bin/clang++ -DGTEST_HAS_RTTI=0 -D_CINDEX_LIB_ -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LARGE_FILE_API -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/powerllvm/

[clang] [clang-tools-extra] [clang analysis] ExprMutationAnalyzer avoid infinite recursion for recursive forwarding reference (PR #87954)

2024-04-13 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/87954 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang analysis] ExprMutationAnalyzer avoid infinite recursion for recursive forwarding reference (PR #87954)

2024-04-13 Thread Piotr Zegar via cfe-commits
@@ -22,8 +21,15 @@ class FunctionParmMutationAnalyzer; /// a given statement. class ExprMutationAnalyzer { public: + friend class FunctionParmMutationAnalyzer; + struct Cache { +llvm::DenseMaphttps://github.com/llvm/llvm-project/pull/87954

[clang] [clang-tools-extra] [clang analysis] ExprMutationAnalyzer avoid infinite recursion for recursive forwarding reference (PR #87954)

2024-04-13 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/87954 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. https://github.com/llvm/llvm-project/pull/87521 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_analyze_cc1 %s \ steakhal wrote: I think you should put this test without the RUN lines into the `clang/test/Analysis/invalidated-iterator.cpp` to have them at one place. https://github.com/llvm/llvm-project/pull/87521 _

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
@@ -57,10 +57,14 @@ ProgramStateRef SimpleConstraintManager::assumeAux(ProgramStateRef State, // We cannot reason about SymSymExprs, and can only reason about some // SymIntExprs. if (!canReasonAbout(Cond)) { -// Just add the constraint to the expression without tryi

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
@@ -2836,6 +2836,10 @@ bool RangeConstraintManager::canReasonAbout(SVal X) const { return false; } + // Non-integer types are not supported. + if (X.getAs()) +return false; + steakhal wrote: My problem with this is that I think LCVs shouldn't eve

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_analyze_cc1 %s \ +// RUN: -analyzer-checker=alpha.cplusplus.InvalidatedIterator \ +// RUN: -analyzer-config aggressive-binary-operation-simplification=true \ +// RUN: 2>&1 + +struct node {}; +struct prop : node {}; +struct bitvec : node { +

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/87521 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-13 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Missing release notes entry, except that looks fine. https://github.com/llvm/llvm-project/pull/88138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [clang][docs] fix whitespace in AttrDocs.td (PR #88631)

2024-04-13 Thread Steven Wu via cfe-commits
https://github.com/cachemeifyoucan approved this pull request. LGTM. Thanks for fixing. https://github.com/llvm/llvm-project/pull/88631 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Export fixes from check_clang_tidy.py (PR #88186)

2024-04-13 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/88186 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] fad3752 - [clang-tidy] Export fixes from check_clang_tidy.py (#88186)

2024-04-13 Thread via cfe-commits
Author: Edwin Vane Date: 2024-04-13T21:01:06+02:00 New Revision: fad37526a3ea7d669af621342968029085862281 URL: https://github.com/llvm/llvm-project/commit/fad37526a3ea7d669af621342968029085862281 DIFF: https://github.com/llvm/llvm-project/commit/fad37526a3ea7d669af621342968029085862281.diff LO

[clang] [clang][docs] fix whitespace in AttrDocs.td (PR #88631)

2024-04-13 Thread Chris Copeland via cfe-commits
chrisnc wrote: @cachemeifyoucan @cyndyishida for review? https://github.com/llvm/llvm-project/pull/88631 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][docs] fix whitespace in AttrDocs.td (PR #88631)

2024-04-13 Thread Chris Copeland via cfe-commits
https://github.com/chrisnc updated https://github.com/llvm/llvm-project/pull/88631 >From d3e993c34e9d05f149b2670502794eaf93dee89a Mon Sep 17 00:00:00 2001 From: Chris Copeland Date: Fri, 12 Apr 2024 23:42:32 -0700 Subject: [PATCH] [clang][docs] fix whitespace in AttrDocs.td --- clang/include/

[clang] [clang][docs] fix whitespace in AttrDocs.td (PR #88631)

2024-04-13 Thread Chris Copeland via cfe-commits
https://github.com/chrisnc edited https://github.com/llvm/llvm-project/pull/88631 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][docs] fix whitespace in AttrDocs.td (PR #88631)

2024-04-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Chris Copeland (chrisnc) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/88631.diff 1 Files Affected: - (modified) clang/include/clang/Basic/AttrDocs.td (+16-16) ``diff diff --git a/clang/include/clang/Basic

[clang] [clang][docs] fix whitespace in AttrDocs.td (PR #88631)

2024-04-13 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [clang][docs] fix whitespace in AttrDocs.td (PR #88631)

2024-04-13 Thread Chris Copeland via cfe-commits
https://github.com/chrisnc created https://github.com/llvm/llvm-project/pull/88631 None >From 40d774ab8c598f0dfb76dcd087f1af17c7fdd01d Mon Sep 17 00:00:00 2001 From: Chris Copeland Date: Fri, 12 Apr 2024 23:42:32 -0700 Subject: [PATCH] [clang][docs] fix whitespace in AttrDocs.td --- clang/in

[clang] [analyzer] Harden security.cert.env.InvalidPtr checker fn matching (PR #88536)

2024-04-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/88536 >From 915ab37028067fb38ffa69ae5c9726bb8c971436 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Fri, 12 Apr 2024 19:07:49 +0200 Subject: [PATCH 1/2] [analyzer] Harden security.cert.env.InvalidPtr checker fn m

[clang] [clang-repl] Support wasm execution (PR #86402)

2024-04-13 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/86402 >From 4434ceeef152b95998ebd0a3b09a56d105490c4d Mon Sep 17 00:00:00 2001 From: Anubhab Ghosh Date: Sat, 23 Mar 2024 15:13:57 + Subject: [PATCH 1/2] [clang-repl] Support wasm execution. This commit introduc

[clang] [clang-scan-deps] Fix contention when updating `TrackingStatistic`s in hot code paths in `FileManager`. (PR #88427)

2024-04-13 Thread Alexandre Ganea via cfe-commits
aganea wrote: I think in the short term @jansvoboda11's suggestion should be good enough. Bit if we want `Statistics` to be always cheap, we should make them `thread_local` instead, not atomic. `getValue()` could do the "collection" of data over all active, or past threads. It would also need

[clang] [Clang] Reduce the size of Decl and classes derived from it (PR #87361)

2024-04-13 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/87361 >From b8a626116b0719c1acf75e9e7300df8e2bf82f99 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 2 Apr 2024 18:00:05 +0200 Subject: [PATCH 1/3] [Clang] Reduce the size of Decl and classes derived from

[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

2024-04-13 Thread Kim Gräsman via cfe-commits
kimgr wrote: > I am wondering if that'd be interesting and if so, maybe we can share it > between both projects via upstreaming to Clang... That sounds fantastic, but mostly because I don't have anything to offer, and everything to benefit :) I was just thinking about adding a `.ForwardDeclar

[clang] [Clang Format] Fixing erroneous statements in tests; nsc (PR #88628)

2024-04-13 Thread Edward Bottom via cfe-commits
https://github.com/edwardbottom edited https://github.com/llvm/llvm-project/pull/88628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Update FormatTest.cpp (PR #88628)

2024-04-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Edward Bottom (edwardbottom) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/88628.diff 1 Files Affected: - (modified) clang/unittests/Format/FormatTest.cpp (+4-4) ``diff diff --git a/clang/unittests/

[clang] Update FormatTest.cpp (PR #88628)

2024-04-13 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] Update FormatTest.cpp (PR #88628)

2024-04-13 Thread Edward Bottom via cfe-commits
https://github.com/edwardbottom created https://github.com/llvm/llvm-project/pull/88628 None >From 22ae52878602dfc79ab90bbc6e9dea508c3762e2 Mon Sep 17 00:00:00 2001 From: Edward Bottom <31777866+edwardbot...@users.noreply.github.com> Date: Sat, 13 Apr 2024 08:49:47 -0700 Subject: [PATCH] Update

[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

2024-04-13 Thread Kim Gräsman via cfe-commits
kimgr wrote: Current PR passes all my tests, both Clang (`ninja ASTTests`), Clangd (`ninja ClangdTests`) and IWYU end-to-end tests -- thanks! https://github.com/llvm/llvm-project/pull/88600 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

2024-04-13 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > * IWYU uses `PolishForDeclaration` to get a valid _declaration_, and then > does [some very hacky heuristic > post-processing](https://github.com/include-what-you-use/include-what-you-use/blob/125341c412ceee9233ece8973848b49e770a9b82/iwyu_output.cc#L469) > to turn it into a

  1   2   >