[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-04-21 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/83774 >From f84c6c7a108d179ffa7f5ec423d852cb667e0f33 Mon Sep 17 00:00:00 2001 From: wangpc Date: Fri, 14 Jul 2023 10:38:14 +0800 Subject: [PATCH] [clang] Enable sized deallocation by default in C++14 onwards Since C

[clang] [clang][dataflow] Model conditional operator correctly. (PR #89213)

2024-04-21 Thread via cfe-commits
https://github.com/martinboehme updated https://github.com/llvm/llvm-project/pull/89213 >From d4205b37d9ba3cecd7cd947a188ec84e9afec899 Mon Sep 17 00:00:00 2001 From: Martin Braenne Date: Thu, 18 Apr 2024 10:50:40 + Subject: [PATCH 1/4] [clang][dataflow] Model conditional operator correctly.

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

2024-04-21 Thread Matheus Izvekov via cfe-commits
@@ -13456,6 +13458,15 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { return; } + if (VDecl->isInvalidDecl()) { +CorrectDelayedTyposInExpr(Init, VDecl); +ExprResult Recovery = +CreateRecoveryExpr(Init->getBeginLoc(), In

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

2024-04-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov deleted https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-21 Thread Matheus Izvekov via cfe-commits
@@ -13456,6 +13458,15 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { return; } + if (VDecl->isInvalidDecl()) { +CorrectDelayedTyposInExpr(Init, VDecl); +ExprResult Recovery = +CreateRecoveryExpr(Init->getBeginLoc(), In

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

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

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

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

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

2024-04-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, Thanks! https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-21 Thread Matheus Izvekov via cfe-commits
@@ -13435,16 +13435,18 @@ void Sema::checkNonTrivialCUnion(QualType QT, SourceLocation Loc, void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { // If there is no declaration, there was an error parsing it. Just ignore // the initializer. - if (

[clang] [MC/DC][Coverage] Workaround for `##` conditions (PR #89573)

2024-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: NAKAMURA Takumi (chapuni) Changes A synthesized identifier with `##` is emitted to ``. `llvm-cov` cannot handle ` since it doesn't have actual files. As a workaround, peel `` to the ac

[clang] [MC/DC][Coverage] Workaround for `##` conditions (PR #89573)

2024-04-21 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni created https://github.com/llvm/llvm-project/pull/89573 A synthesized identifier with `##` is emitted to ``. `llvm-cov` cannot handle ` since it doesn't have actual files. As a workaround, peel `` to the actual definition if the definition is present. This affects

[clang] [MC/DC][Coverage] Add assertions into emitSourceRegions() (PR #89572)

2024-04-21 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/89572 >From 13035b230fd51422f6c3223fcffab4f44bd00956 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Fri, 19 Apr 2024 15:26:34 +0900 Subject: [PATCH 1/2] [MC/DC][Coverage] Add assertions into emitSourceRegions()

[clang] [MC/DC][Coverage] Add assertions into emitSourceRegions() (PR #89572)

2024-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: NAKAMURA Takumi (chapuni) Changes `emitSourceRegions()` has bugs to emit malformed MC/DC coverage mappings. They were detected in `llvm-cov` as the crash. Detect inconsistencies earlier in `clang` with a

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

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

[clang] [MC/DC][Coverage] Add assertions into emitSourceRegions() (PR #89572)

2024-04-21 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni created https://github.com/llvm/llvm-project/pull/89572 `emitSourceRegions()` has bugs to emit malformed MC/DC coverage mappings. They were detected in `llvm-cov` as the crash. Detect inconsistencies earlier in `clang` with assertions. * mcdc-system-headers.cpp cove

[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,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: Apa

[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,31 @@ +.. title:: clang-tidy - bugprone-return-const-ref-from-parameter + +bugprone-return-const-ref-from-parameter + + +Detects return statements that return constant reference parameter as constant SimplyDanny w

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

2024-04-21 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: @mizvekov does the updated patch look reasonable to you? https://github.com/llvm/llvm-project/pull/88645 ___ 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 members when hovering over a typedef (PR #89570)

2024-04-21 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: (This builds on https://github.com/llvm/llvm-project/pull/89557 and the commit view shows both commits. I still need to figure out how to do proper stacked PRs...) https://github.com/llvm/llvm-project/pull/89570 ___ cfe-commits

[clang] [clang-tools-extra] [clangd] Show struct members when hovering over a typedef (PR #89570)

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

[clang] [clang-tools-extra] [clangd] Show struct members when hovering over a typedef (PR #89570)

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

[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 bugprone-return-const-ref-from-param

[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 bugprone-return-const-ref-from-param

[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 +// PrintTagTypeCont

[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 +// PrintTagTypeCont

[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 https://lists.llvm.org/cgi-bin/mailm

[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 in

[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) - (modi

[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 b

[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? https://github.c

[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 https

[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 b

[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 https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[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 -fmodu

[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 Dat

[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 curren

[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 an

[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 consteval std::vector 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 diagno

[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: [1](https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:___c,selection:(endColumn:21,endLineNumber:8,

[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: [1](https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:___c,selection:(endColumn:21,endLineNumber:8,positionColu

[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] [clangd]

[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 cortex-r

[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 cortex-r

[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 TK_IgnoreUnlessSpelledInS

[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 TK_IgnoreUnlessSpelle

[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 throu

[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 s

[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 fo

[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 better

[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? Than

[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: [before](https://github.com/OpenXiangShan/XiangShan/blob/e25e4d90505c592524b410b127fe611ac49a3adf/src/main/s

[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 00:

[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 https://li

[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 AMDGPU::BI__b

[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 AMDGPU::BI__b

[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 &MI, return RetBB; } +static MachineBasicBlock *lowerPseudoLaneOp(MachineInstr &MI, 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: Apa

[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: Apa

[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 https://lists.llvm.org/cgi-bin/mailman/listinfo

[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 annotati

[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(/* `has

[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 https://github.com/llvm/llvm-project/blob

[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 cor

[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 s

[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 s

[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 s

[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 &Result) { 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 (b

[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 wro

[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.

  1   2   >