[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/89497 >From 91915f68902ade86c0bf8eba643428017ae8bb3c Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 20 Apr 2024 17:58:19 +0800 Subject: [PATCH 1/4] [tidy] add new check

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/89497 >From 91915f68902ade86c0bf8eba643428017ae8bb3c Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 20 Apr 2024 17:58:19 +0800 Subject: [PATCH 1/4] [tidy] add new check

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thank you! I have a few questions: 1) Do we want an RFC in discourse for the changes in `DeclPrinter`? 2) Do you think we should also add some test cases to `DeclPrinterTest.cpp`? https://github.com/llvm/llvm-project/pull/89557

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Younan Zhang via cfe-commits
@@ -474,6 +477,17 @@ void DeclPrinter::VisitDeclContext(DeclContext *DC, bool Indent) { for (DeclContext::decl_iterator D = DC->decls_begin(), DEnd = DC->decls_end(); D != DEnd; ++D) { +// Print enum members and public struct fields when +//

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Younan Zhang via cfe-commits
@@ -474,6 +477,17 @@ void DeclPrinter::VisitDeclContext(DeclContext *DC, bool Indent) { for (DeclContext::decl_iterator D = DC->decls_begin(), DEnd = DC->decls_end(); D != DEnd; ++D) { +// Print enum members and public struct fields when +//

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

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

[clang] [AIX][TLS][clang] Add -maix-small-local-dynamic-tls clang option (PR #88829)

2024-04-21 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 approved this pull request. LGTM with one nit. Thanks for adding this support. https://github.com/llvm/llvm-project/pull/88829 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [AIX][TLS][clang] Add -maix-small-local-dynamic-tls clang option (PR #88829)

2024-04-21 Thread Chen Zheng via cfe-commits
@@ -6,6 +6,9 @@ // RUN: %clang -target powerpc64-unknown-aix -maix-small-local-exec-tls -S -emit-llvm \ // RUN:%s -o - | FileCheck %s --check-prefix=CHECK-AIX_SMALL_LOCALEXEC_TLS +// RUN: %clang -target powerpc64-unknown-aix -maix-small-local-dynamic-tls -S -emit-llvm \

[clang] [AIX][TLS][clang] Add -maix-small-local-dynamic-tls clang option (PR #88829)

2024-04-21 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/88829 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: A few things I would appreciate feedback on: 1. I know a [previous comment on the bug](https://github.com/clangd/clangd/issues/959#issuecomment-998927030) stated "We don't show bodies of classes/enums/functions etc by policy", but can we consider changing this policy

[clang] [Clang] Fix a crash introduced in PR#88666 (PR #89567)

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

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangd Author: Nathan Ridge (HighCommander4) Changes Fixes https://github.com/clangd/clangd/issues/959 --- Full diff: https://github.com/llvm/llvm-project/pull/89557.diff 4 Files Affected: - (modified) clang-tools-extra/clangd/Hover.cpp (+2) -

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 ready_for_review https://github.com/llvm/llvm-project/pull/89557 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix a crash introduced in PR#88666 (PR #89567)

2024-04-21 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/89567 >From 041574d22c2debb5299926b58aed529919905902 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 22 Apr 2024 01:09:47 -0400 Subject: [PATCH] [Clang] Fix a crash introduced in PR#88666 The unroll value can

[clang] [Clang] Fix a crash introduced in PR#88666 (PR #89567)

2024-04-21 Thread via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -x c++ -verify %s +// expected-no-diagnostics + +template void foo() { + #pragma unroll Unroll + for (int i = 0; i < Unroll; ++i); +} yronglin wrote: I'd like to add a test for '#pragma GCC unroll N', WDYT?

[clang] [Clang] Fix a crash introduced in PR#88666 (PR #89567)

2024-04-21 Thread via cfe-commits
https://github.com/yronglin approved this pull request. Thakns for your fix, LGTM! https://github.com/llvm/llvm-project/pull/89567 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Allow the value of unroll count to be zero in `#pragma GCC unroll` and `#pragma unroll` (PR #88666)

2024-04-21 Thread via cfe-commits
yronglin wrote: Thank you report this issue! @ronlieb Could you please provide a simple reproducer, we can use it to strengthen clang's test. https://github.com/llvm/llvm-project/pull/88666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Fix a crash introduced in PR#88666 (PR #89567)

2024-04-21 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/89567 >From 3503f2bfd28af5be8e87835c47207d770659db3c Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 22 Apr 2024 00:06:31 -0400 Subject: [PATCH] [Clang] Fix a crash introduced in PR#88666 The unroll value can

[clang] [Clang] Allow the value of unroll count to be zero in `#pragma GCC unroll` and `#pragma unroll` (PR #88666)

2024-04-21 Thread Shilei Tian via cfe-commits
shiltian wrote: @alexfh @ronlieb @Endilll fix in https://github.com/llvm/llvm-project/pull/89567. https://github.com/llvm/llvm-project/pull/88666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Fix a crash introduced in PR#88666 (PR #89567)

2024-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Shilei Tian (shiltian) Changes The unroll value can be a template variable such that we need to check it before we verify if it is constant value. --- Full diff: https://github.com/llvm/llvm-project/pull/89567.diff 2 Files Affected: -

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-21 Thread Connor Sughrue via cfe-commits
@@ -0,0 +1,25 @@ +// Check that a clang invocation can spawn and handshake with a module build daemon + +// RUN: %kill-process "-cc1modbuildd mbd-handshake" +// RUN: rm -rf mbd-handshake %t +// RUN: split-file %s %t + +//--- main.c +int main() {return 0;} + +// RUN: %clang

[clang] [Clang] Fix a crash introduced in PR#88666 (PR #89567)

2024-04-21 Thread Shilei Tian via cfe-commits
https://github.com/shiltian created https://github.com/llvm/llvm-project/pull/89567 The unroll value can be a template variable such that we need to check it before we verify if it is constant value. >From 8f14bcc2ea3d4badb63b953dc23b27b49b0a6521 Mon Sep 17 00:00:00 2001 From: Shilei Tian

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-21 Thread Connor Sughrue via cfe-commits
@@ -264,6 +264,26 @@ def err_test_module_file_extension_version : Error< "test module file extension '%0' has different version (%1.%2) than expected " "(%3.%4)">; +// Module Build Daemon cpsughrue wrote: I don't think that's a bad idea. There are

[clang] [clang][CoverageMapping] do not emit gap when either end is an `ImplicitValueInitExpr` (PR #89564)

2024-04-21 Thread Wentao Zhang via cfe-commits
https://github.com/whentojump updated https://github.com/llvm/llvm-project/pull/89564 >From abbdb318d62bb2e5ab6f07e7d0fe11f4a06b5a11 Mon Sep 17 00:00:00 2001 From: Wentao Zhang Date: Sun, 21 Apr 2024 21:27:01 -0500 Subject: [PATCH] [clang][CoverageMapping] do not emit gap when either end is

[clang] Don't wrap immediate invocations in ConstantExprs within constexpr initializers (PR #89565)

2024-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Daniel M. Katz (katzdm) Changes The following program produces a diagnostic in Clang and EDG, but compiles correctly in GCC and MSVC: ```cpp #include vector consteval std::vectorint fn() { return {1,2,3}; } constexpr int a = fn()[1]; ```

[clang] Don't wrap immediate invocations in ConstantExprs within constexpr initializers (PR #89565)

2024-04-21 Thread Daniel M. Katz via cfe-commits
https://github.com/katzdm created https://github.com/llvm/llvm-project/pull/89565 The following program produces a diagnostic in Clang and EDG, but compiles correctly in GCC and MSVC: ```cpp #include consteval std::vector fn() { return {1,2,3}; } constexpr int a = fn()[1]; ``` Clang's

[clang] [clang][CoverageMapping] do not emit gap when either end is an `ImplicitValueInitExpr` (PR #89564)

2024-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Wentao Zhang (whentojump) Changes Fixes #86998 Two compiler explorer examples:

[clang] [clang][CoverageMapping] do not emit gap when either end is an `ImplicitValueInitExpr` (PR #89564)

2024-04-21 Thread Wentao Zhang via cfe-commits
https://github.com/whentojump created https://github.com/llvm/llvm-project/pull/89564 Fixes #86998 Two compiler explorer examples:

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/89557 Fixes https://github.com/clangd/clangd/issues/959 >From d98c95bf213f0c6e81a46a9e37d376b855bb4867 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 21 Apr 2024 20:30:16 -0400 Subject: [PATCH]

[clang] [llvm] [ARM] Armv8-R does not require fp64 or neon. (PR #88287)

2024-04-21 Thread Chris Copeland via cfe-commits
https://github.com/chrisnc updated https://github.com/llvm/llvm-project/pull/88287 >From 46803a6da62b8348f3eb8759c74ec6abf8693c92 Mon Sep 17 00:00:00 2001 From: Chris Copeland Date: Fri, 5 Apr 2024 22:40:46 -0700 Subject: [PATCH] [ARM] Armv8-R does not require fp64 or neon. Specifying

[clang] [llvm] [ARM] Armv8-R does not require fp64 or neon. (PR #88287)

2024-04-21 Thread Chris Copeland via cfe-commits
chrisnc wrote: Added an item to the release notes and fixed another place where fp64+neon was being added (the target parser); now I see the expected results when using just armv8r-none-eabi (sans -mcpu=cortex-r52). https://github.com/llvm/llvm-project/pull/88287

[clang] [llvm] [ARM] Armv8-R does not require fp64 or neon. (PR #88287)

2024-04-21 Thread Chris Copeland via cfe-commits
https://github.com/chrisnc updated https://github.com/llvm/llvm-project/pull/88287 >From 575128cc6b494fed2065cae07754477426cb1c24 Mon Sep 17 00:00:00 2001 From: Chris Copeland Date: Fri, 5 Apr 2024 22:40:46 -0700 Subject: [PATCH] [ARM] Armv8-R does not require fp64 or neon. Specifying

[clang] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-04-21 Thread via cfe-commits
https://github.com/komalverma04 updated https://github.com/llvm/llvm-project/pull/89553 >From 4a56db71e8bf2b6414cd305515d9d4434be8efc0 Mon Sep 17 00:00:00 2001 From: komalverma04 Date: Mon, 22 Apr 2024 02:37:25 +0530 Subject: [PATCH 1/2] remove IgnoreParenImpCasts() from hasArgument matcher

[clang] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (komalverma04) Changes # Maintaining Consistency in `hasAnyArgument()` and `hasArgument()` Matchers in Clang AST Matchers The correct behavior is to not ignore implicit AST nodes in hasArgument. We have the

[clang] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

2024-04-21 Thread via cfe-commits
https://github.com/komalverma04 created https://github.com/llvm/llvm-project/pull/89553 # Maintaining Consistency in `hasAnyArgument()` and `hasArgument()` Matchers in Clang AST Matchers The correct behavior is to not ignore implicit AST nodes in hasArgument. We have the

[clang] Re-apply "Emit missing cleanups for stmt-expr" and other commits (PR #89154)

2024-04-21 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/89154 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Re-apply "Emit missing cleanups for stmt-expr" and other commits (PR #89154)

2024-04-21 Thread Utkarsh Saxena via cfe-commits
usx95 wrote: (addressed one more problem with conditional lifetime extension.) > What, if anything, about the scenario you're describing is specific to > "normal" cleanups? We do not see this with `EHCleanup`s because `EmitBranchThroughCleanup` does not consider `EHCleanup`. It branches

[clang] Re-apply "Emit missing cleanups for stmt-expr" and other commits (PR #89154)

2024-04-21 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/89154 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -16,6 +16,75 @@ using namespace clang::ast_matchers; namespace clang::tidy::modernize { +namespace { +// Given two argument indices X and Y, matches when a call expression has a +// string at index X with an expression representing that string's length at +// index Y. The

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

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

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

2024-04-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

[clang] [C++17] Support __GCC_[CON|DE]STRUCTIVE_SIZE (PR #89446)

2024-04-21 Thread Ulrich Weigand via cfe-commits
uweigand wrote: For SystemZ the correct value is 256. In general I agree it makes sense to look at the GCC implementation as a source of reasonable values. Also, I think there probably should be no generic default value at all - it there is no platform-specific value known, it seems

[clang] [llvm] [ARM] Armv8-R does not require fp64 or neon. (PR #88287)

2024-04-21 Thread David Green via cfe-commits
davemgreen wrote: As far as I understand this will remove the tuning we do for cortex-r52 when using armv8r, which will mean a little less performance but the tuning features in the Arm backend are not handled as well as they could be. Can you add release note explaining what will change?

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

2024-04-21 Thread via cfe-commits
sopyb wrote: Ping https://github.com/llvm/llvm-project/pull/85572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ARM] Armv8-R does not require fp64 or neon. (PR #88287)

2024-04-21 Thread Chris Copeland via cfe-commits
chrisnc wrote: Another option is to include `FeatureFPARMv8_D16_SP` in `ARMv8r`. The R-profile supplement of the Arm manual does say that this is a minimum feature requirement (as opposed to just being a variant of the R52). https://github.com/llvm/llvm-project/pull/88287

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

2024-04-21 Thread via cfe-commits
sopyb wrote: Sorry for taking so long to come back with the changes. I have changed my environment last week and didn't have time to properly setup everything to make the required changes until now. https://github.com/llvm/llvm-project/pull/85572

[clang] [llvm] [RISCV] Add processor definition for XiangShan-KunMingHu (PR #89359)

2024-04-21 Thread Camel Coder via cfe-commits
camel-cdr wrote: Has the target architecture been finalized? (As in what it should be, not necessarily the rtl) Just yesterday, there was a significant change in vector execution units:

[clang] [clang]MveEmitter: Pass Args as a const reference (PR #89551)

2024-04-21 Thread via cfe-commits
https://github.com/aniplcc created https://github.com/llvm/llvm-project/pull/89551 Closes #89192. Also updated with review patches. In continuation of: `https://github.com/llvm/llvm-project/pull/89202` [Closed due to a bad rebase] >From 21ef2c83063a16866edec3eaa1847db7b34592c4 Mon Sep 17

[clang] Reapply "[Clang][Sema] placement new initializes typedef array with correct size (#83124)" (PR #89036)

2024-04-21 Thread via cfe-commits
mahtohappy wrote: Hi @cor3ntin Please merge this. https://github.com/llvm/llvm-project/pull/89036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU][WIP] Add support for i64/f64 readlane, writelane and readfirstlane operations. (PR #89217)

2024-04-21 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm commented: In a separate patch should have AMDGPUInstCombineIntrinsic try to fold bitcasts into the intrinsic https://github.com/llvm/llvm-project/pull/89217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [AMDGPU][WIP] Add support for i64/f64 readlane, writelane and readfirstlane operations. (PR #89217)

2024-04-21 Thread Matt Arsenault via cfe-commits
@@ -18410,6 +18410,24 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID, CGM.getIntrinsic(Intrinsic::amdgcn_update_dpp, Args[0]->getType()); return Builder.CreateCall(F, Args); } + case AMDGPU::BI__builtin_amdgcn_readlane: + case

[clang] [llvm] [AMDGPU][WIP] Add support for i64/f64 readlane, writelane and readfirstlane operations. (PR #89217)

2024-04-21 Thread Matt Arsenault via cfe-commits
@@ -18410,6 +18410,24 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID, CGM.getIntrinsic(Intrinsic::amdgcn_update_dpp, Args[0]->getType()); return Builder.CreateCall(F, Args); } + case AMDGPU::BI__builtin_amdgcn_readlane: + case

[clang] [llvm] [AMDGPU][WIP] Add support for i64/f64 readlane, writelane and readfirstlane operations. (PR #89217)

2024-04-21 Thread Matt Arsenault via cfe-commits
@@ -4822,6 +4822,111 @@ static MachineBasicBlock *lowerWaveReduce(MachineInstr , return RetBB; } +static MachineBasicBlock *lowerPseudoLaneOp(MachineInstr , arsenm wrote: You should try to do this before selection. Doing it after just adds a lot of

[clang] [llvm] [AMDGPU][WIP] Add support for i64/f64 readlane, writelane and readfirstlane operations. (PR #89217)

2024-04-21 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/89217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add ignoring paren imp casts in has any argument (PR #89509)

2024-04-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/89509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-21 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,34 @@ +//===--- ReturnConstRefFromParameterCheck.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:

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-21 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,35 @@ +//===--- ReturnConstRefFromParameterCheck.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:

[clang] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

2024-04-21 Thread Yu Zeng via cfe-commits
l1nxy wrote: @cor3ntin @shafikHi, I want to take charge of this issue and submit a PR for the fix. https://github.com/llvm/llvm-project/pull/78598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

2024-04-21 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > Are there actually any benefit from being that eager to delete template > annotations? Well, I don't have much context of that patch, but I think that makes sense in part e.g. When we have a function that involves many generic lambdas, where we would destroy template

[clang-tools-extra] Add ignoring paren imp casts in has any argument (PR #89509)

2024-04-21 Thread Julian Schmidt via cfe-commits
@@ -90,8 +91,9 @@ RewriteRuleWith StringviewNullptrCheckImpl() { auto HandleTemporaryCXXTemporaryObjectExprAndCompoundLiteralExpr = makeRule( cxxTemporaryObjectExpr(cxxConstructExpr( HasBasicStringViewType, argumentCountIs(1), - hasAnyArgument(/*

[clang-tools-extra] Add ignoring paren imp casts in has any argument (PR #89509)

2024-04-21 Thread Julian Schmidt via cfe-commits
@@ -74,8 +74,9 @@ RewriteRuleWith StringviewNullptrCheckImpl() { auto BasicStringViewConstructingFromNullExpr = cxxConstructExpr( HasBasicStringViewType, argumentCountIs(1), - hasAnyArgument(/* `hasArgument` would skip over parens */ anyOf( -

[clang-tools-extra] Add ignoring paren imp casts in has any argument (PR #89509)

2024-04-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/89509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add ignoring paren imp casts in has any argument (PR #89509)

2024-04-21 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. I started taking a look at this and realized you switched up which argument matcher needs the extra `ignoringParenImpCasts`, so that it can be removed from the matcher definition. See

[clang] Re-apply "Emit missing cleanups for stmt-expr" and other commits (PR #89154)

2024-04-21 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/89154 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Re-apply "Emit missing cleanups for stmt-expr" and other commits (PR #89154)

2024-04-21 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/89154 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Default -g to full debug info. (PR #89418)

2024-04-21 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/89418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Default -g to full debug info. (PR #89418)

2024-04-21 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/89418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Re-apply "Emit missing cleanups for stmt-expr" and other commits (PR #89154)

2024-04-21 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/89154 >From f1ab4c2677394bbfc985d9680d5eecd7b2e6a882 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Wed, 17 Apr 2024 22:47:36 + Subject: [PATCH 1/3] Reapply "[codegen] Emit missing cleanups for stmt-expr and

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

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -16,6 +16,49 @@ using namespace clang::ast_matchers; namespace clang::tidy::modernize { +namespace { +// Given two argument indices X and Y, matches when a call expression has a +// string at index X with an expression representing that string's length at +// index Y. The

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

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -16,6 +16,49 @@ using namespace clang::ast_matchers; namespace clang::tidy::modernize { +namespace { +// Given two argument indices X and Y, matches when a call expression has a +// string at index X with an expression representing that string's length at +// index Y. The

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

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -298,6 +298,10 @@ Changes in existing checks check by resolving fix-it overlaps in template code by disregarding implicit instances. +- Improved :doc:`modernize-use-starts-ends-with + ` check to also handle + cases using `compare()`. PiotrZSL wrote:

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

2024-04-21 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Looks +- fine, I just worry a little bit about performance. But as "HasStringAndLengthArguments" will be executed only for an compare methods, then probably it could be fine. https://github.com/llvm/llvm-project/pull/89530

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

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

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

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -16,6 +16,49 @@ using namespace clang::ast_matchers; namespace clang::tidy::modernize { +namespace { +// Given two argument indices X and Y, matches when a call expression has a +// string at index X with an expression representing that string's length at +// index Y. The

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

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -94,11 +155,12 @@ void UseStartsEndsWithCheck::check(const MatchFinder::MatchResult ) { Diagnostic << FixItHint::CreateRemoval(CharSourceRange::getCharRange( ComparisonExpr->getBeginLoc(), FindExpr->getBeginLoc())); - // Replace '(r?)find' with 'starts_with'. +

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

2024-04-21 Thread via cfe-commits
@@ -298,6 +298,10 @@ Changes in existing checks check by resolving fix-it overlaps in template code by disregarding implicit instances. +- Improved :doc:`modernize-use-starts-ends-with EugeneZelenko wrote: Please keep alphabetical order in this section

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

2024-04-21 Thread via cfe-commits
@@ -298,6 +298,10 @@ Changes in existing checks check by resolving fix-it overlaps in template code by disregarding implicit instances. +- Improved :doc:`modernize-use-starts-ends-with + ` check to also handle + cases using `compare()`. EugeneZelenko

[clang] [clang-repl] Implement value printing of custom types (PR #84769)

2024-04-21 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/84769 >From a1639ef21a6085f12383e815ce2ed31976f78cfa Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 16 Jul 2023 21:18:26 + Subject: [PATCH 1/2] [clang-repl] Implement value printing of custom types.

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-21 Thread via cfe-commits
@@ -112,6 +112,12 @@ New checks Detects error-prone Curiously Recurring Template Pattern usage, when the CRTP can be constructed outside itself and the derived class. +- New :doc:`bugprone-return-const-ref-from-parameter + ` check. + + Detects the function which returns

[clang-tools-extra] Add ignoring paren imp casts in has any argument (PR #89509)

2024-04-21 Thread via cfe-commits
komalverma04 wrote: @PiotrZSL Please guide me tackling the failing tests https://github.com/llvm/llvm-project/pull/89509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

2024-04-21 Thread via cfe-commits
cor3ntin wrote: If @HerrCai0907 doesn't reply, we should take over @shafik @erichkeane @Endilll https://github.com/llvm/llvm-project/pull/78598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][frontend] Make DumpModuleInfoAction emit the full macro (PR #85745)

2024-04-21 Thread Zhang Yi via cfe-commits
zhanyi22333 wrote: This commit use tokens from MacroInfo to emit the macro body. It emits macro body below the part of macro name. For import test case, it can not get MacroInfo. So it will just print macro name as below. ``` Macro Definitions: CONSTANT FUNC_Macro FOO

[clang] [clang] Mark ill-formed partial specialization as invalid (PR #89536)

2024-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes Fixes #89374 Solution suggested by @cor3ntin --- Full diff: https://github.com/llvm/llvm-project/pull/89536.diff 3 Files Affected: - (modified) clang/lib/Sema/SemaTemplate.cpp (+2) - (modified)

[clang] [clang] Mark ill-formed partial specialization as invalid (PR #89536)

2024-04-21 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/89536 Fixes #89374 Solution suggested by @cor3ntin >From 58058a88305c7d4c1b1a30d8572ca481889ea3f9 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 21 Apr 2024 13:29:39 +0300 Subject: [PATCH] [clang] Mark

[clang] [clang]MveEmitter:Pass Args as const references (PR #89202)

2024-04-21 Thread Simon Pilgrim via cfe-commits
@@ -660,7 +660,7 @@ class IRBuilderResult : public Result { std::map IntegerArgs; IRBuilderResult(StringRef CallPrefix, std::vector Args, RKSimon wrote: std::vector Args? https://github.com/llvm/llvm-project/pull/89202

[clang] [clang]MveEmitter:Pass Args as const references (PR #89202)

2024-04-21 Thread Simon Pilgrim via cfe-commits
@@ -660,7 +660,7 @@ class IRBuilderResult : public Result { std::map IntegerArgs; IRBuilderResult(StringRef CallPrefix, std::vector Args, std::set AddressArgs, RKSimon wrote: std::set AddressArgs?

[clang] [clang]MveEmitter:Pass Args as const references (PR #89202)

2024-04-21 Thread Simon Pilgrim via cfe-commits
@@ -728,7 +728,7 @@ class IRIntrinsicResult : public Result { std::vector ParamTypes; std::vector Args; IRIntrinsicResult(StringRef IntrinsicID, std::vector ParamTypes, RKSimon wrote: std::vector ParamTypes?

[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

2024-04-21 Thread via cfe-commits
cor3ntin wrote: Are there actually any benefit from being _that_ eager to delete template annotations? Getting back to a place where who only delete at the end of Top level decls would avoid the new complexity, right? That design question notwithstanding, the patch looks reasonable to me

[clang] [Clang] Allow the value of unroll count to be zero in `#pragma GCC unroll` and `#pragma unroll` (PR #88666)

2024-04-21 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: @ronlieb nice and small reproducer would definitely help resolving this. https://github.com/llvm/llvm-project/pull/88666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] aa22d44 - [Clang] Do not try to diagnose parameter packs in invalid pack expressions (#89257)

2024-04-21 Thread via cfe-commits
Author: cor3ntin Date: 2024-04-21T11:43:51+02:00 New Revision: aa22d4422ee031d3867290e6ec12985f87d9ea2f URL: https://github.com/llvm/llvm-project/commit/aa22d4422ee031d3867290e6ec12985f87d9ea2f DIFF: https://github.com/llvm/llvm-project/commit/aa22d4422ee031d3867290e6ec12985f87d9ea2f.diff

[clang] [Clang] Do not try to diagnose parameter packs in invalid pack expressions (PR #89257)

2024-04-21 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/89257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [tidy] add new check bugprone-return-const-ref-from-parameter (PR #89497)

2024-04-21 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,35 @@ +//===--- ReturnConstRefFromParameterCheck.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:

[clang] [clang][frontend] Make DumpModuleInfoAction emit the full macro (PR #85745)

2024-04-21 Thread Zhang Yi via cfe-commits
https://github.com/zhanyi22333 updated https://github.com/llvm/llvm-project/pull/85745 >From 61b24269867dcec12c8fcab0c26b444f33a57454 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Apr 2024 16:43:17 +0800 Subject: [PATCH 1/2] [clang][frontend] change DumpModuleInfoAction test cases. ---

[clang] [Clang] Allow the value of unroll count to be zero in `#pragma GCC unroll` and `#pragma unroll` (PR #88666)

2024-04-21 Thread via cfe-commits
ronlieb wrote: our downstream CI for amdgpu build of rccl, rocblas and rocSolver are seeing this assertions due to this patch [2024-04-21T03:28:05.859Z] clang-19: /jenkins/workspace/compiler-psdb-amd-staging/repos/external/llvm-project/clang/lib/AST/ExprConstant.cpp:15721: bool

[clang] [llvm] [cmake] Remove custom linker flag check function (PR #86602)

2024-04-21 Thread Petr Hosek via cfe-commits
petrhosek wrote: I'd actually prefer this not be merged as is. I have already made a similar change locally but during testing I discovered a major issue with `check_linker_flag`: unlike other CMake `check_*` functions, and even `llvm_check_linker_flag`, `check_linker_flag` doesn't apply

[clang] Fix objc_sel_{name,types} missing an underscore (PR #88713)

2024-04-21 Thread Jonathan Schleifer via cfe-commits
Midar wrote: Maybe @rjmccall would be a good reviewer? https://github.com/llvm/llvm-project/pull/88713 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Clang][Sema] placement new initializes typedef array with correct size (#83124)" (PR #89036)

2024-04-21 Thread via cfe-commits
https://github.com/mahtohappy updated https://github.com/llvm/llvm-project/pull/89036 >From 56c2b4f70735a6ef3b80cb8461a88ea51f2d02d7 Mon Sep 17 00:00:00 2001 From: mahtohappy Date: Tue, 16 Apr 2024 17:48:45 +0530 Subject: [PATCH 1/6] [Clang][Sema] placement new initializes typedef array with

[clang] fa01d04 - [clang][Interp][NFC] Change pointer offset to uint64

2024-04-21 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2024-04-21T08:30:58+02:00 New Revision: fa01d04c9b9a3c8454194a36a0e64daf43cddaf2 URL: https://github.com/llvm/llvm-project/commit/fa01d04c9b9a3c8454194a36a0e64daf43cddaf2 DIFF: https://github.com/llvm/llvm-project/commit/fa01d04c9b9a3c8454194a36a0e64daf43cddaf2.diff