[clang-tools-extra] [clang-tidy] Add fix-its to `avoid-return-with-void-value` check (PR #81420)

2024-04-07 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: @@ -0,0 +1,168 @@ +//===--- BracesAroundStatement.cpp - clang-tidy --===// +// +// Part of the LLVM Project, under the Apache

[clang-tools-extra] [clang-tidy] Add fix-its to `avoid-return-with-void-value` check (PR #81420)

2024-04-07 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= Message-ID: In-Reply-To: https://github.com/PiotrZSL approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/81420

[clang-tools-extra] [clang-tidy] Add fix-its to `avoid-return-with-void-value` check (PR #81420)

2024-04-07 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/81420 ___ cfe-commits mailing list cfe-commits

[clang-tools-extra] [clang-tidy] Ignore non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?M=C3=B6sch?= Message-ID: In-Reply-To: https://github.com/PiotrZSL commented: Current code is fine, wound be good ignore also unused. https://github.com/llvm/llvm-project/pull/87832 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang-tools-extra] [clang-tidy] Ignore non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/87832 ___ 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 non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: @@ -125,12 +127,13 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder *Finder) { hasAncestor(expr(hasUnevaluatedContext()); Finder->addMatcher( - parmVarDecl(parmVarDecl().bind("param"

[clang-tools-extra] [clang-tidy] Ignore non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: @@ -79,6 +79,8 @@ AST_MATCHER_P(LambdaExpr, hasCaptureDefaultKind, LambdaCaptureDefault, Kind) { return Node.getCaptureDefault() == Kind; } +AST_MATCHER(ParmVarDecl, hasAnyName) { return !Node.getName().empty(); }

[clang-tools-extra] [clang-tidy] rename designated initializers (PR #86976)

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

[clang] [X86_64] fix arg pass error in struct. (PR #86902)

2024-04-07 Thread Longsheng Mou via cfe-commits
https://github.com/CoTinker updated https://github.com/llvm/llvm-project/pull/86902 >From eb425dbaed73a58b5f8e05e425a1972aa1288fa9 Mon Sep 17 00:00:00 2001 From: Longsheng Mou Date: Fri, 15 Mar 2024 20:50:54 +0800 Subject: [PATCH] [X86_64] fix arg pass error in struct. In some struct like s67,

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/87909 This patch covers [CWG393](https://cplusplus.github.io/CWG/issues/393.html) "Pointer to array of unknown bound in template argument list in parameter" [CWG528](https://cplusplus.github.io/CWG/issues/528.html) "Wh

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes This patch covers [CWG393](https://cplusplus.github.io/CWG/issues/393.html) "Pointer to array of unknown bound in template argument list in parameter" [CWG528](https://cplusplus.github.io/CWG/issues/528

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

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

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/87912 This patch introduces `SemaHLSL` class, and moves some HLSL-related functions there. No functional changes intended. This is a part of the effort to split `Sema` into smaller manageable parts, and follows the e

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Vlad Serebrennikov (Endilll) Changes This patch introduces `SemaHLSL` class, and moves some HLSL-related functions there. No functional changes intended. This is a part of the effort to split `Sema` into smaller manageable parts, and foll

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff da5a86b53e7d6e7ff7407b16c2c869894493ee99 4a60eb0da7d74ca002040aede6ffc9220314ca33 --

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: clang-format 18.1.1 that we use in the workflow is complaining, because it's missing #82097. https://github.com/llvm/llvm-project/pull/87912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [Clang][Sema] Skip checking anonymous enum in using enum declaration (PR #87144)

2024-04-07 Thread Richard Smith via cfe-commits
@@ -1537,6 +1537,10 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S, bool AddToContext) { cast(D)->isFunctionTemplateSpecialization()) return; + if (isa(D) && D->getDeclName().isEmpty()) { zygoloid wrote: Are those useful checks? It seems s

[clang] [clang][NFC] Remove "Sema" prefix from Sema-related functions (PR #87914)

2024-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes @AaronBallman once noted that this prefix is a historical accident, and shouldn't be there. I agree. --- Patch is 124.11 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-

[clang-tools-extra] 7a4e897 - [clang-tidy] Add fix-its to `readability-avoid-return-with-void-value` check (#81420)

2024-04-07 Thread via cfe-commits
Author: Danny Mösch Date: 2024-04-07T13:28:29+02:00 New Revision: 7a4e89761a13bfad27a2614ecea5e8698f50336c URL: https://github.com/llvm/llvm-project/commit/7a4e89761a13bfad27a2614ecea5e8698f50336c DIFF: https://github.com/llvm/llvm-project/commit/7a4e89761a13bfad27a2614ecea5e8698f50336c.diff L

[clang-tools-extra] [clang-tidy] Add fix-its to `avoid-return-with-void-value` check (PR #81420)

2024-04-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny closed https://github.com/llvm/llvm-project/pull/81420 ___ 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 fix-its to `readability-avoid-return-with-void-value` check (PR #81420)

2024-04-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/81420 ___ 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 non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/87832 From 2c4dd9281b1bf6bb02ff7efb6421f22bd35e27b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 5 Apr 2024 23:41:50 +0200 Subject: [PATCH 1/4] [clang-tidy] Ignore non-forwarded argument

[clang-tools-extra] [clangd] Add support for textDocument/rangesFormatting (LSP 3.18) (PR #80180)

2024-04-07 Thread Tom Praschan via cfe-commits
https://github.com/tom-anders updated https://github.com/llvm/llvm-project/pull/80180 >From 19ae86fb821c908fbd29515f36282c3aa0745048 Mon Sep 17 00:00:00 2001 From: tom-anders <13141438+tom-and...@users.noreply.github.com> Date: Thu, 18 May 2023 12:05:01 +0200 Subject: [PATCH] [clangd] Add suppor

[clang-tools-extra] [clang-tidy] Ignore non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Danny Mösch via cfe-commits
@@ -125,12 +127,13 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder *Finder) { hasAncestor(expr(hasUnevaluatedContext()); Finder->addMatcher( - parmVarDecl(parmVarDecl().bind("param"), isTemplateTypeParameter(), - has

[clang-tools-extra] [clangd] Add support for textDocument/rangesFormatting (LSP 3.18) (PR #80180)

2024-04-07 Thread Tom Praschan via cfe-commits
tom-anders wrote: Rebased to fixed merge conflict, extend lit test with test for new `rangesFormatting` request @sam-mccall @HighCommander4 ping https://github.com/llvm/llvm-project/pull/80180 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [Clang][Sema] Skip checking anonymous enum in using enum declaration (PR #87144)

2024-04-07 Thread Qizhi Hu via cfe-commits
@@ -1537,6 +1537,10 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S, bool AddToContext) { cast(D)->isFunctionTemplateSpecialization()) return; + if (isa(D) && D->getDeclName().isEmpty()) { jcsxky wrote: These checks include name conflict an

[clang] [clang][NFC] Remove "Sema" prefix from Sema-related functions (PR #87914)

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

[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-07 Thread Hirofumi Nakamura via cfe-commits
https://github.com/hnakamura5 created https://github.com/llvm/llvm-project/pull/87924 The test I mentioned here https://github.com/llvm/llvm-project/pull/87450 . This is a regression test to detect the case block type is not calculated due to the paste `#` operator misunderstood as preprocessor

[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Hirofumi Nakamura (hnakamura5) Changes The test I mentioned here https://github.com/llvm/llvm-project/pull/87450 . This is a regression test to detect the case block type is not calculated due to the paste `#` operator misunderstood

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/87912 >From 4a60eb0da7d74ca002040aede6ffc9220314ca33 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 7 Apr 2024 12:35:07 +0300 Subject: [PATCH] [clang] Introduce `SemaHLSL` --- clang/include/clang/Sema/S

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

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

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/87912 >From 4a60eb0da7d74ca002040aede6ffc9220314ca33 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 7 Apr 2024 12:35:07 +0300 Subject: [PATCH 1/2] [clang] Introduce `SemaHLSL` --- clang/include/clang/Se

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-07 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/86960 >From e5f2bfb1652118be0112b8242263942063b75b89 Mon Sep 17 00:00:00 2001 From: yronglin Date: Tue, 2 Apr 2024 23:47:33 +0800 Subject: [PATCH 1/2] [Clang] Extend lifetime of temporaries in mem-default-init for P2

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-07 Thread via cfe-commits
@@ -311,9 +311,9 @@ pushTemporaryCleanup(CodeGenFunction &CGF, const MaterializeTemporaryExpr *M, CleanupKind CleanupKind; if (Lifetime == Qualifiers::OCL_Strong) { const ValueDecl *VD = M->getExtendingDecl(); - bool Precise = -

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-07 Thread via cfe-commits
@@ -1230,11 +1230,26 @@ CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S, JumpDest LoopExit = getJumpDestInCurrentScope("for.end"); LexicalScope ForScope(*this, S.getSourceRange()); + const DeclStmt *RangeDS = cast(S.getRangeStmt()); + const VarDecl *RangeV

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

2024-04-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/87768 >From bcebf176cd078c59bca9a2301931f0ec072b66c7 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 5 Apr 2024 19:12:28 +0800 Subject: [PATCH] [Clang][Sema] Avoid guessing unexpanded packs' size in getFullyPac

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

2024-04-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/87768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

2024-04-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/87768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Skip checking anonymous enum in using enum declaration (PR #87144)

2024-04-07 Thread Richard Smith via cfe-commits
@@ -1537,6 +1537,10 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S, bool AddToContext) { cast(D)->isFunctionTemplateSpecialization()) return; + if (isa(D) && D->getDeclName().isEmpty()) { zygoloid wrote: For what name? The `using enum` dec

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

2024-04-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 ready_for_review https://github.com/llvm/llvm-project/pull/87768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (PR #87768)

2024-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Younan Zhang (zyn0217) Changes There has been an optimization for `SizeOfPackExprs` since c5452ed9, in which we overlooked a case where the template arguments were not yet formed into a `PackExpansionType` at the token annotation stage. Thi

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-07 Thread via cfe-commits
yronglin wrote: This PR does so many things that I will split it into multiple smaller PRs to make it easier to review. https://github.com/llvm/llvm-project/pull/86960 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

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

[clang] [Clang] Refactor implementation of "Lifetime extension in range-based for loops" (PR #87930)

2024-04-07 Thread via cfe-commits
https://github.com/yronglin created https://github.com/llvm/llvm-project/pull/87930 This PR remove `InMaterializeTemporaryObjectContext` , because it's redundant, materialize non-cv void prvalue temporaries in discarded expressions can only appear under lifetime-extension context. >From c8ed2

[clang] [Clang] Refactor implementation of "Lifetime extension in range-based for loops" (PR #87930)

2024-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (yronglin) Changes This PR remove `InMaterializeTemporaryObjectContext` , because it's redundant, materialize non-cv void prvalue temporaries in discarded expressions can only appear under lifetime-extension context. --- Full diff:

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

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

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

2024-04-07 Thread via cfe-commits
@@ -897,7 +897,20 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst &Trunc) { } } - return nullptr; + bool Changed = false; + if (!Trunc.hasNoSignedWrap() && + ComputeMaxSignificantBits(Src, /*Depth=*/0, &Trunc) <= DestWidth) { +Trunc.setHasNoSignedWrap

[clang-tools-extra] [clang-tidy] Ignore non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny edited https://github.com/llvm/llvm-project/pull/87832 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-07 Thread via cfe-commits
https://github.com/yronglin created https://github.com/llvm/llvm-project/pull/87933 This PR complete [DR1815](https://wg21.link/CWG1815) under the guidance of `FIXME` comments. And reuse `CXXDefaultInitExpr` rewrite machinery to clone the initializer expression on each use that would lifetime

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

2024-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (yronglin) Changes This PR complete [DR1815](https://wg21.link/CWG1815) under the guidance of `FIXME` comments. And reuse `CXXDefaultInitExpr` rewrite machinery to clone the initializer expression on each use that would lifetime exte

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-07 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/86960 ___ 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 non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/87832 From 2c4dd9281b1bf6bb02ff7efb6421f22bd35e27b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 5 Apr 2024 23:41:50 +0200 Subject: [PATCH 1/5] [clang-tidy] Ignore non-forwarded argument

[clang-tools-extra] [clang-tidy] Ignore non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/87832 From 2c4dd9281b1bf6bb02ff7efb6421f22bd35e27b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 5 Apr 2024 23:41:50 +0200 Subject: [PATCH 1/5] [clang-tidy] Ignore non-forwarded argument

[clang] [Clang][Sema] Skip checking anonymous enum in using enum declaration (PR #87144)

2024-04-07 Thread Richard Smith via cfe-commits
@@ -1537,6 +1537,10 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S, bool AddToContext) { cast(D)->isFunctionTemplateSpecialization()) return; + if (isa(D) && D->getDeclName().isEmpty()) { zygoloid wrote: The reserved identifier check appea

[clang] [clang-format][NFC] Add getNextNonComment() to FormatTokenSource (PR #87868)

2024-04-07 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/87868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-07 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/87924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

2024-04-07 Thread via cfe-commits
goldsteinn wrote: Not an issue now but I think we should look into updating `computeKnownBitsFromContext` to look use `trunc nsw/nuw` uses of `X`. If the use is dominating / noundef, we can infer bits about `X`. Not really an issue if we only use `KnownBits` to infer `nuw`/`nsw`, but once we a

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

2024-04-07 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/4] [clang-tidy] Add ignoringParenImpCasts in hasAnyArgument

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

2024-04-07 Thread via cfe-commits
goldsteinn wrote: LGTM. https://github.com/llvm/llvm-project/pull/87910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM64EC] Add support for parsing __vectorcall (PR #87725)

2024-04-07 Thread Max Winkler via cfe-commits
MaxEW707 wrote: LGTM. >From memory, its been a while since I've had to ship on ARM64EC, all instances >of `__vectorcall` are supposed to be rejected by msvc. That also aligns with >the `__vectorcall` docs on MSDN. I am not sure what clang's policy is with potentially allowing code that "shoul

[clang] [ARM64EC] Add support for parsing __vectorcall (PR #87725)

2024-04-07 Thread Max Winkler via cfe-commits
https://github.com/MaxEW707 approved this pull request. https://github.com/llvm/llvm-project/pull/87725 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][FMV] Pass the '+fmv' target-feature when FMV is enabled. (PR #87942)

2024-04-07 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/87942 This will allow the backend to enable the corresponding subtarget feature (FeatureFMV), which in turn can be queried for llvm codegen decisions. See #87939 for example. >From 38eea2eca0a852965f6b3d2037c5c0f290

[clang] [clang][FMV] Pass the '+fmv' target-feature when FMV is enabled. (PR #87942)

2024-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Alexandros Lamprineas (labrinea) Changes This will allow the backend to enable the corresponding subtarget feature (FeatureFMV), which in turn can be queried for llvm codegen decisions. See #87939 for example. --- Full diff: https

[clang] 943db67 - [clang-format][NFC] Add getNextNonComment() to FormatTokenSource (#87868)

2024-04-07 Thread via cfe-commits
Author: Owen Pan Date: 2024-04-07T13:58:49-07:00 New Revision: 943db678dadd6088629d08ec3e582bea0595f2d2 URL: https://github.com/llvm/llvm-project/commit/943db678dadd6088629d08ec3e582bea0595f2d2 DIFF: https://github.com/llvm/llvm-project/commit/943db678dadd6088629d08ec3e582bea0595f2d2.diff LOG:

[clang] [clang-format][NFC] Add getNextNonComment() to FormatTokenSource (PR #87868)

2024-04-07 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/87868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-07 Thread Owen Pan via cfe-commits
@@ -290,6 +290,16 @@ TEST_F(FormatTestTableGen, MultiClass) { "}\n"); } +TEST_F(FormatTestTableGen, MultiClassesWithPasteOperator) { + // This is a sensitive example for the handling of the paste operators in + // brace type calculation. + verifyFormat("multi

[clang] [clang][FMV] Pass the '+fmv' target-feature when FMV is enabled. (PR #87942)

2024-04-07 Thread Jon Roelofs via cfe-commits
https://github.com/jroelofs approved this pull request. https://github.com/llvm/llvm-project/pull/87942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-07 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/87953 Also fix unit tests and reformat polly. Fixes #86550. >From 6d0c7e5602a227b1b7310be46553aa689e6a93e7 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 7 Apr 2024 17:27:21 -0700 Subject: [PATCH] [clang-format] C

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Also fix unit tests and reformat polly. Fixes #86550. --- Full diff: https://github.com/llvm/llvm-project/pull/87953.diff 4 Files Affected: - (modified) clang/lib/Format/UnwrappedLineParser.cpp (+10-10)

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-07 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 943db678dadd6088629d08ec3e582bea0595f2d2 6d0c7e5602a227b1b7310be46553aa689e6a93e7 --

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-07 Thread Owen Pan via cfe-commits
@@ -538,16 +538,6 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { if (Style.Language == FormatStyle::LK_Proto) { ProbablyBracedList = NextTok->isOneOf(tok::comma, tok::r_square); } else { - // Skip NextTok over prepro

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-07 Thread Owen Pan via cfe-commits
owenca wrote: The polly formatting failure should be ignored as CI is using clang-format 18.1.1 instead of the version built from this patch. https://github.com/llvm/llvm-project/pull/87953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-07 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/87953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][modules] Do not resolve `HeaderFileInfo` externally in `ASTWriter` (PR #87848)

2024-04-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/87848 >From ee56548604be9473f33cd809c901886f37a3d8e9 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 5 Apr 2024 15:12:39 -0700 Subject: [PATCH 1/2] [clang][modules] Do not resolve `HeaderFileInfo` externall

[clang] [clang analysis] ExprMutationAnalyzer support recursive forwarding reference (PR #87954)

2024-04-07 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/87954 Partialy fixes: #60895 >From 19f66851204547232d586288fba79d8770837350 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 8 Apr 2024 09:20:58 +0800 Subject: [PATCH] [clang analysis] ExprMutationAnalyzer

[clang] [clang analysis] ExprMutationAnalyzer support recursive forwarding reference (PR #87954)

2024-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Congcong Cai (HerrCai0907) Changes Partialy fixes: #60895 --- Full diff: https://github.com/llvm/llvm-project/pull/87954.diff 3 Files Affected: - (modified) clang/include/clang/Analysis/Analyses/ExprMutationAnalyzer.h (+33-7) - (modi

[clang] [Clang][Sema] Skip checking anonymous enum in using enum declaration (PR #87144)

2024-04-07 Thread Qizhi Hu via cfe-commits
@@ -1537,6 +1537,10 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S, bool AddToContext) { cast(D)->isFunctionTemplateSpecialization()) return; + if (isa(D) && D->getDeclName().isEmpty()) { jcsxky wrote: Ah, I see. I skip those checking when

[clang] [libclc] [libcxx] [lld] [llvm] [openmp] llvm encode decode (PR #87187)

2024-04-07 Thread Yingchi Long via cfe-commits
https://github.com/inclyc converted_to_draft https://github.com/llvm/llvm-project/pull/87187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV][FMV] Support target_clones (PR #85786)

2024-04-07 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/85786 >From 239b404203c66ab5336ffdfb45969a50c439a1c0 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 19 Mar 2024 06:22:17 -0700 Subject: [PATCH 1/6] [RISCV][FMV] Support target_clones --- clang/include/clang/Basic/T

[clang] [clang-tools-extra] [clang analysis] ExprMutationAnalyzer support recursive forwarding reference (PR #87954)

2024-04-07 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/87954 >From 19f66851204547232d586288fba79d8770837350 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 8 Apr 2024 09:20:58 +0800 Subject: [PATCH 1/2] [clang analysis] ExprMutationAnalyzer support recursive fo

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

2024-04-07 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 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-tools-extra] [clang-tidy] Ignore non-forwarded arguments if they are unnamed (PR #87832)

2024-04-07 Thread Congcong Cai via cfe-commits
Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= , Danny =?utf-8?q?M=C3=B6sch?= Message-ID: In-Reply-To: https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/87832 ___

[clang] [RISCV] Disallow target attribute use in multiversioning (PR #85899)

2024-04-07 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/85899 >From 0bbffb92e7f36957c042cab9a67a483571d9b3f9 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Mon, 18 Mar 2024 05:07:14 -0700 Subject: [PATCH 1/3] [RISCV] Disallow target attribute use in multiversioning --- clang

[clang] Fix/interp init list unnamed bitfields (PR #87799)

2024-04-07 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,114 @@ +// UNSUPPORTED: asserts +// REQUIRES: asserts +// ^ this attempts to say "don't actually run this test", because it's broken tbaederr wrote: In this case, I would fix the other bug first. https://github.com/llvm/llvm-project/pull/87799 ___

[clang] Fix/interp init list unnamed bitfields (PR #87799)

2024-04-07 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,114 @@ +// UNSUPPORTED: asserts +// REQUIRES: asserts +// ^ this attempts to say "don't actually run this test", because it's broken +// +// The point of this test is to demonstrate something that ExprConstant accepts, +// but Interp rejects. I had hoped to express tha

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

2024-04-07 Thread Nikita Popov via cfe-commits
@@ -897,7 +897,20 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst &Trunc) { } } - return nullptr; + bool Changed = false; + if (!Trunc.hasNoSignedWrap() && + ComputeMaxSignificantBits(Src, /*Depth=*/0, &Trunc) <= DestWidth) { +Trunc.setHasNoSignedWrap

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread via cfe-commits
@@ -1967,6 +1973,11 @@ class Sema final : public SemaBase { bool CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall, const FunctionProtoType *Proto); + bool BuiltinVectorMath(CallExpr *TheCall, QualType &Res); + bool BuiltinVectorToScalarMath

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread via cfe-commits
cor3ntin wrote: Should these be moved? ```cpp void ActOnHLSLTopLevelFunction(FunctionDecl *FD); void CheckHLSLEntryPoint(FunctionDecl *FD); void CheckHLSLSemanticAnnotation(FunctionDecl *EntryPoint, const Decl *Param, const HLSLAnnotationAttr *AnnotationAt

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
@@ -1967,6 +1973,11 @@ class Sema final : public SemaBase { bool CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall, const FunctionProtoType *Proto); + bool BuiltinVectorMath(CallExpr *TheCall, QualType &Res); + bool BuiltinVectorToScalarMath

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > Should these be moved? Given their names, they are clearly on the list. However, I'm keeping the scope of this patch limited. I'd like to focus on getting HLSL contributors on board first. https://github.com/llvm/llvm-project/pull/87912 ___

[clang] eaa063f - [RISCV] Remove duplicated --target

2024-04-07 Thread Wang Pengcheng via cfe-commits
Author: Wang Pengcheng Date: 2024-04-08T14:59:17+08:00 New Revision: eaa063f0c6d51a3b561bc2007fe95420949f42d1 URL: https://github.com/llvm/llvm-project/commit/eaa063f0c6d51a3b561bc2007fe95420949f42d1 DIFF: https://github.com/llvm/llvm-project/commit/eaa063f0c6d51a3b561bc2007fe95420949f42d1.diff