[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

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

[clang] [llvm] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-18 Thread Alex Bradbury via cfe-commits
asb wrote: Thanks James, that matches what I'd understood. Just one comment on this though: > If Zaamo is present, but neither Zalrsc nor Zacas are present, I think > there's no way to implement a cmpxchg operation. This means lock-free atomics > cannot be supported, so it should `setMaxAtomic

[clang] [clang-format] Option to ignore macro definitions (PR #70338)

2024-01-18 Thread via cfe-commits
tomekpaszek wrote: > @tomekpaszek Hi Tomek, do you think you will have time to work on this soon? > Otherwise, I can probably finish it off for you since we also want this > feature. Hi tru, Thanks for reaching out. Unfortunately I'm too busy to work on this at the moment. Feel free to push

[clang] [Clang][Sema] fix crash of attribute transform (PR #78088)

2024-01-18 Thread Qizhi Hu via cfe-commits
@@ -7081,10 +7085,10 @@ QualType TreeTransform::TransformAttributedType( // FIXME: dependent operand expressions? if (getDerived().AlwaysRebuild() || modifiedType != oldType->getModifiedType()) { -// TODO: this is really lame; we should really be rebuilding the -

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2024-01-18 Thread via cfe-commits
cor3ntin wrote: @sam-mccall Do you think you could add a release note? I think it would be useful to try to land this in Clang 18. Thanks! https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Félix-Antoine Constantin via cfe-commits
https://github.com/felix642 commented: Hey @11happy I left 2 more comments related to some tests that we should maybe add. https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Félix-Antoine Constantin via cfe-commits
@@ -0,0 +1,149 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t + +#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b)) + +constexpr int myConstexprMin(int a, int b) { + return a < b ? a : b; +} + +constexpr int myConstexprMax(int a, int b) { + return a > b ? a : b;

[llvm] [clang] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Félix-Antoine Constantin via cfe-commits
https://github.com/felix642 edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Félix-Antoine Constantin via cfe-commits
@@ -0,0 +1,149 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t + +#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b)) + +constexpr int myConstexprMin(int a, int b) { + return a < b ? a : b; +} + +constexpr int myConstexprMax(int a, int b) { + return a > b ? a : b;

[libc] [flang] [compiler-rt] [clang-tools-extra] [llvm] [clang] [flang] use setsid to assign the child to prevent zombie as it will be clean up by init process (PR #77944)

2024-01-18 Thread Kiran Chandramohan via cfe-commits
kiranchandramohan wrote: Could you add a test? https://github.com/llvm/llvm-project/pull/77944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 created https://github.com/llvm/llvm-project/pull/78589 Fixes: https://github.com/llvm/llvm-project/issues/78290 See the bug for more context. ``` Gen ACoroutine() { if constexpr (0) // remove it make clang compile. co_return; co_await Gen{}; } ``` We miss symbol

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-coroutines Author: Utkarsh Saxena (usx95) Changes Fixes: https://github.com/llvm/llvm-project/issues/78290 See the bug for more context. ``` Gen ACoroutine() { if constexpr (0) // remove it make clang compile. co_return; co_await Gen{}; } ``` We

[clang] 9d6e189 - [RISCV] Use regexp to check negative extensions in test. NFC

2024-01-18 Thread Luke Lau via cfe-commits
Author: Luke Lau Date: 2024-01-18T21:47:06+07:00 New Revision: 9d6e189ee8a93b9bc65a2b317961d8d1f63e3f64 URL: https://github.com/llvm/llvm-project/commit/9d6e189ee8a93b9bc65a2b317961d8d1f63e3f64 DIFF: https://github.com/llvm/llvm-project/commit/9d6e189ee8a93b9bc65a2b317961d8d1f63e3f64.diff LOG:

[llvm] [clang-tools-extra] [clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-18 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM, thanks Feel free to refactor `err_auto_not_allowed` in a separate PR https://github.com/llvm/llvm-project/pull/78103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [llvm] [clang-tools-extra] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-18 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/78103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-18 Thread via cfe-commits
@@ -11321,9 +11321,20 @@ Decl *Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) { << ClassType << ConvType; } - if (FunctionTemplateDecl *ConversionTemplate -= Conversion->getDescribedFunctionTemplate()) + if (FunctionTe

[clang] [llvm] [RISCV] Add support for new unprivileged extensions defined in profiles spec (PR #77458)

2024-01-18 Thread Luke Lau via cfe-commits
https://github.com/lukel97 updated https://github.com/llvm/llvm-project/pull/77458 >From d22817bcd7ea7ab5763cb4da58552ce6930d4b73 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Tue, 9 Jan 2024 19:42:10 +0700 Subject: [PATCH 1/7] [RISCV] Add support for new unprivileged extensions defined in pro

[llvm] [clang] [clang-tools-extra] [CLANG] Fix : More Detailed "No expected directives found" (PR #78338)

2024-01-18 Thread Shourya Goel via cfe-commits
@@ -11,7 +11,7 @@ #error // expected-error@-1 {{}} -// CHECK: error: no expected directives found: consider use of 'expected-no-diagnostics' +// CHECK: error: no expected directives found: consider use of '{{.*}}-no-diagnostics' Sh0g0-1758 wrote:

[llvm] [clang] [RISCV] Add support for new unprivileged extensions defined in profiles spec (PR #77458)

2024-01-18 Thread Luke Lau via cfe-commits
lukel97 wrote: Rebased on top of 9d6e189ee8a93b9bc65a2b317961d8d1f63e3f64 which should fix the pre-merge check test failure https://github.com/llvm/llvm-project/pull/77458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/78589 >From 07c6ad92fda63e69489933b5cededf8f03a68ef3 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Thu, 18 Jan 2024 14:38:22 + Subject: [PATCH 1/2] [coroutine] Create coroutine body in the correct eval context

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread via cfe-commits
@@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -std=c++20 -ast-dump %s | FileCheck %s +#include "Inputs/std-coroutine.h" + +// Github issue: https://github.com/llvm/llvm-project/issues/78290 +class Gen { + public: +class promise_type { + public: +template +explic

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/78589 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread via cfe-commits
https://github.com/cor3ntin commented: Can you add a release note for this change (mentioning the issue) ? thanks! https://github.com/llvm/llvm-project/pull/78589 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang-format] Option to ignore macro definitions (PR #70338)

2024-01-18 Thread Tobias Hieta via cfe-commits
tru wrote: @owenca What's the things that still needs to be addressed for this to land? https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/78103 >From 522c7dff31a6f63995877674f9f4282ae60f7aaa Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 14 Jan 2024 19:45:04 +0300 Subject: [PATCH 1/6] [clang] Implement CWG1878 "`operator auto` template" C+

[clang] [llvm] [clang-tools-extra] [CLANG] Add warning when INF or NAN are used in a binary operation or as function argument in fast math mode. (PR #76873)

2024-01-18 Thread Aaron Ballman via cfe-commits
@@ -2835,6 +2835,9 @@ class Preprocessor { if (Identifier.getIdentifierInfo()->isRestrictExpansion() && !SourceMgr.isInMainFile(Identifier.getLocation())) emitRestrictExpansionWarning(Identifier); + +if (Identifier.getIdentifierInfo()->getName() == "INFINI

[clang-tools-extra] [llvm] [clang] [CLANG] Add warning when INF or NAN are used in a binary operation or as function argument in fast math mode. (PR #76873)

2024-01-18 Thread Aaron Ballman via cfe-commits
@@ -70,6 +70,10 @@ def warn_pragma_debug_missing_argument : Warning< def warn_pragma_debug_unexpected_argument : Warning< "unexpected argument to debug command">, InGroup; +def warn_fp_nan_inf_when_disabled : Warning< + "use of %select{infinity|NaN}0 %select{|via a macro}1

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

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

[llvm] [clang] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-01-18 Thread Nikita Popov via cfe-commits
@@ -2274,6 +2274,26 @@ bool LoopAccessInfo::canAnalyzeLoop() { return true; } +/// Returns whether \p I is a known math library call that has attribute +/// 'memory(argmem: write)' set. +static bool isMathLibCallMemWriteOnly(const TargetLibraryInfo *TLI, +

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/78589 >From 07c6ad92fda63e69489933b5cededf8f03a68ef3 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Thu, 18 Jan 2024 14:38:22 + Subject: [PATCH 1/3] [coroutine] Create coroutine body in the correct eval context

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/78589 >From 07c6ad92fda63e69489933b5cededf8f03a68ef3 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Thu, 18 Jan 2024 14:38:22 + Subject: [PATCH 1/4] [coroutine] Create coroutine body in the correct eval context

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread Utkarsh Saxena via cfe-commits
usx95 wrote: Added release notes and fix new line. https://github.com/llvm/llvm-project/pull/78589 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-apply-replacements] Apply format only if --format is specified (PR #70801)

2024-01-18 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: @kuganv do you have cycles to work on this issue? If not, I can commandeer this pull requests and update release notes. Please let me know what is your preference. https://github.com/llvm/llvm-project/pull/70801 ___ cfe-commits mail

[libc] [clang] [llvm] [flang] [compiler-rt] [clang-tools-extra] [flang] use setsid to assign the child to prevent zombie as it will be clean up by init process (PR #77944)

2024-01-18 Thread Yi Wu via cfe-commits
https://github.com/yi-wu-arm updated https://github.com/llvm/llvm-project/pull/77944 >From b51f293d57a1ae96fab5d3b2a529186a78643c8c Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Fri, 12 Jan 2024 16:44:21 + Subject: [PATCH 1/4] use setsid to assign the child to prevent zombie as it will be cle

[clang] [Clang][Sema] Diagnose use of template keyword in declarative nested-… (PR #78595)

2024-01-18 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/78595 According to [[temp.names] p5](http://eel.is/c++draft/temp.names#5): > The keyword template shall not appear immediately after a declarative > [nested-name-specifier](http://eel.is/c++draft/expr.prim.id.qual#n

[clang] [Clang][Sema] Diagnose use of template keyword in declarative nested-name-specifiers (PR #78595)

2024-01-18 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/78595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose use of template keyword in declarative nested-name-specifiers (PR #78595)

2024-01-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Krystian Stasiowski (sdkrystian) Changes According to [[temp.names] p5](http://eel.is/c++draft/temp.names#5): > The keyword template shall not appear immediately after a declarative [nested-name-specifier](http://eel.is/c++draft/expr.prim.

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM, thanks! Please give a chance to @ChuanqiXu9 to look at it before merging https://github.com/llvm/llvm-project/pull/78589 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/78589 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread via cfe-commits
@@ -804,6 +804,9 @@ Bug Fixes in This Version Objective-C++ property accesses to not be converted to a function call to the getter in the placement-args of new-expressions. Fixes (`#65053 `_) +- Fix an issue with missing

[clang] [Clang][Sema] Diagnose use of template keyword in declarative nested-name-specifiers (PR #78595)

2024-01-18 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: (still need to add a release note) https://github.com/llvm/llvm-project/pull/78595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose use of template keyword in declarative nested-name-specifiers (PR #78595)

2024-01-18 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 77d21e758ea9665631b211abc0e424d7a7c44989 8a5ad668768ed97466f195e85308b6a15910c38a --

[clang] [coroutine] Create coroutine body in the correct eval context (PR #78589)

2024-01-18 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/78589 >From 07c6ad92fda63e69489933b5cededf8f03a68ef3 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Thu, 18 Jan 2024 14:38:22 + Subject: [PATCH 1/5] [coroutine] Create coroutine body in the correct eval context

[clang] [Clang][Sema] Diagnose use of template keyword in declarative nested-name-specifiers (PR #78595)

2024-01-18 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/78595 >From c0babaca73a6451bdefd4ba3a28976e2d7dd136a Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 17 Jan 2024 10:13:29 -0500 Subject: [PATCH] [Clang][Sema] Diagnose use of template keyword in declar

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-18 Thread via cfe-commits
zmodem wrote: Obviously we have some code where this fires :-) First hit is https://source.chromium.org/chromium/chromium/src/+/main:third_party/libunwindstack/src/libartbase/base/stl_util.h;l=296 ``` template static inline IterationRange> Filter( IterationRange it, Filter cond) { auto

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

2024-01-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/78598 Expression in `RequiresExprBodyDecl` is resolved as constants and should not be captured. Fixes: #69307, #76593. >From 33db497c31fd9da3a3acfc0d419dcdc396752863 Mon Sep 17 00:00:00 2001 From: Congcong Cai Da

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

2024-01-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Congcong Cai (HerrCai0907) Changes Expression in `RequiresExprBodyDecl` is resolved as constants and should not be captured. Fixes: #69307, #76593. --- Full diff: https://github.com/llvm/llvm-project/pull/78598.diff 2 Files Affected: -

[clang] [Clang][Sema] Diagnose use of template keyword after declarative nested-name-specifiers (PR #78595)

2024-01-18 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/78595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Amend SME attributes with support for ZT0. (PR #77941)

2024-01-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I'm ok with this now. https://github.com/llvm/llvm-project/pull/77941 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clang] [CLANG] Add warning when INF or NAN are used in a binary operation or as function argument in fast math mode. (PR #76873)

2024-01-18 Thread Zahira Ammarguellat via cfe-commits
@@ -2835,6 +2835,9 @@ class Preprocessor { if (Identifier.getIdentifierInfo()->isRestrictExpansion() && !SourceMgr.isInMainFile(Identifier.getLocation())) emitRestrictExpansionWarning(Identifier); + +if (Identifier.getIdentifierInfo()->getName() == "INFINI

[clang] 819bd9e - [clang][Interp] IndirectMember initializers (#69900)

2024-01-18 Thread via cfe-commits
Author: Timm Baeder Date: 2024-01-18T16:25:05+01:00 New Revision: 819bd9e39b8c255600b7ec13ac195f726aa9a082 URL: https://github.com/llvm/llvm-project/commit/819bd9e39b8c255600b7ec13ac195f726aa9a082 DIFF: https://github.com/llvm/llvm-project/commit/819bd9e39b8c255600b7ec13ac195f726aa9a082.diff L

[clang] [clang][Interp] IndirectMember initializers (PR #69900)

2024-01-18 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/69900 ___ cfe-commits mailing list cfe-commits@lis

[clang] [Clang][Sema] Diagnose use of template keyword after declarative nested-name-specifiers (PR #78595)

2024-01-18 Thread Vlad Serebrennikov via cfe-commits
@@ -182,8 +182,8 @@ struct Bad2 { int a, b; }; } // namespace dr2386 namespace std { template struct tuple_size; -template <> struct std::tuple_size {}; Endilll wrote: Is this a really necessary change? https://github.com/llvm/llvm-project/pull/78595 ___

[llvm] [clang] [clang][CoverageMapping] Refactor setting MC/DC True/False Condition IDs (PR #78202)

2024-01-18 Thread Alan Phipps via cfe-commits
https://github.com/evodius96 edited https://github.com/llvm/llvm-project/pull/78202 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-18 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @zmodem template parameter shadowing is an extension with `-fms-compatibility`, if that works https://github.com/llvm/llvm-project/pull/78274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [Clang][Sema] Diagnose use of template keyword after declarative nested-name-specifiers (PR #78595)

2024-01-18 Thread via cfe-commits
cor3ntin wrote: Thank for this patch I think this might be better done as a pedantic warning. IE, I am concerned that this could break existing code, similarly to https://github.com/llvm/llvm-project/issues/78031#issuecomment-1891475606 I wonder if we should add tests for https://cplusplus.g

[clang] Warning for incorrect useof 'pure' attribute (PR #78200)

2024-01-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/78200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Warning for incorrect useof 'pure' attribute (PR #78200)

2024-01-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/78200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Warning for incorrect useof 'pure' attribute (PR #78200)

2024-01-18 Thread Erich Keane via cfe-commits
@@ -692,6 +692,13 @@ def warn_maybe_falloff_nonvoid_function : Warning< def warn_falloff_nonvoid_function : Warning< "non-void function does not return a value">, InGroup; +def warn_const_attr_with_pure_attr : Warning< + "'const' attribute imposes more restrictions, 'pure'

[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-18 Thread James Y Knight via cfe-commits
jyknight wrote: Yes, that's an acceptable/correct solution in that circumstance. Given we already have a forced-atomics option, IMO it probably makes sense to still require users to specify that explicitly, rather than effectively defaulting it to on with Zaamo. However, I must say, I cannot

[clang] [clang-tools-extra] [llvm] [clang] Refactor Builtins.def to be a tablegen file (PR #68324)

2024-01-18 Thread Nikolas Klauser via cfe-commits
@@ -6571,11 +6571,14 @@ class AtomicExpr : public Expr { /// \return empty atomic scope model if the atomic op code does not have /// scope operand. static std::unique_ptr getScopeModel(AtomicOp Op) { -if (Op >= AO__opencl_atomic_load && Op <= AO__opencl_atomic_fetc

[clang] [Clang][Sema] Diagnose use of template keyword after declarative nested-name-specifiers (PR #78595)

2024-01-18 Thread Krystian Stasiowski via cfe-commits
@@ -182,8 +182,8 @@ struct Bad2 { int a, b; }; } // namespace dr2386 namespace std { template struct tuple_size; -template <> struct std::tuple_size {}; sdkrystian wrote: @Endilll if left unchanged this will result in a warning about redundant qualification,

[clang] [llvm] [CMake] Add support for building on illumos (PR #74930)

2024-01-18 Thread Rainer Orth via cfe-commits
rorth wrote: I wonder what the current flurry of patdhes to support Illumos is about. I'd originally filed Issue #53919 to make clear what's needed from the Illumos project to keep it as an LLVM target, given that they haven't contributed either bug reports, code or testing in a long time. W

[clang] 2286789 - [clang][CoverageMapping] Refactor setting MC/DC True/False Condition IDs (#78202)

2024-01-18 Thread via cfe-commits
Author: Alan Phipps Date: 2024-01-18T09:34:52-06:00 New Revision: 22867890e4e6e272ddb9cee78e3eb0a2bca1cc81 URL: https://github.com/llvm/llvm-project/commit/22867890e4e6e272ddb9cee78e3eb0a2bca1cc81 DIFF: https://github.com/llvm/llvm-project/commit/22867890e4e6e272ddb9cee78e3eb0a2bca1cc81.diff L

[clang] [llvm] [clang][CoverageMapping] Refactor setting MC/DC True/False Condition IDs (PR #78202)

2024-01-18 Thread Alan Phipps via cfe-commits
https://github.com/evodius96 closed https://github.com/llvm/llvm-project/pull/78202 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose use of template keyword after declarative nested-name-specifiers (PR #78595)

2024-01-18 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @cor3ntin Pedantic warning would probably be best as other implementations are not great at diagnosing this https://github.com/llvm/llvm-project/pull/78595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [llvm] [LinkerWrapper] Support device binaries in multiple link jobs (PR #72442)

2024-01-18 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/72442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [LinkerWrapper] Support device binaries in multiple link jobs (PR #72442)

2024-01-18 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Replaced by https://github.com/llvm/llvm-project/pull/78359 https://github.com/llvm/llvm-project/pull/72442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose use of template keyword after declarative nested-name-specifiers (PR #78595)

2024-01-18 Thread Vlad Serebrennikov via cfe-commits
@@ -182,8 +182,8 @@ struct Bad2 { int a, b; }; } // namespace dr2386 namespace std { template struct tuple_size; -template <> struct std::tuple_size {}; Endilll wrote: Is this warning emitted if we spell it `::std::tuple)size`? https://github.com/llvm/llvm-p

[clang] [Clang][Sema] Diagnose use of template keyword after declarative nested-name-specifiers (PR #78595)

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

[clang] [Clang][Sema] fix crash of attribute transform (PR #78088)

2024-01-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM but please wait in case @erichkeane has final thoughts. https://github.com/llvm/llvm-project/pull/78088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [Clang][Sema] fix crash of attribute transform (PR #78088)

2024-01-18 Thread Aaron Ballman via cfe-commits
@@ -7081,10 +7085,10 @@ QualType TreeTransform::TransformAttributedType( // FIXME: dependent operand expressions? if (getDerived().AlwaysRebuild() || modifiedType != oldType->getModifiedType()) { -// TODO: this is really lame; we should really be rebuilding the -

[clang] [Clang][Sema] fix crash of attribute transform (PR #78088)

2024-01-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/78088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Félix-Antoine Constantin via cfe-commits
@@ -0,0 +1,149 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t + +#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b)) + +constexpr int myConstexprMin(int a, int b) { + return a < b ? a : b; +} + +constexpr int myConstexprMax(int a, int b) { + return a > b ? a : b;

[clang-tools-extra] [lldb] [libc] [llvm] [clang] [libcxxabi] [libunwind] [libcxx] [flang] [lld] [compiler-rt] Fix a bug in Smith's algorithm used in complex div/mul. (PR #78330)

2024-01-18 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon updated https://github.com/llvm/llvm-project/pull/78330 >From 8f8917528e30d2ba67f669cfd1a893bc85c21121 Mon Sep 17 00:00:00 2001 From: Ammarguellat Date: Tue, 16 Jan 2024 11:24:03 -0800 Subject: [PATCH 1/4] Fixed a bug in Smith's algorithm and made sure last option in

[clang] 12c90bd - [LinkerWrapper] Handle AMDGPU Target-IDs correctly when linking (#78359)

2024-01-18 Thread via cfe-commits
Author: Joseph Huber Date: 2024-01-18T09:44:56-06:00 New Revision: 12c90bd612fe7eb9e991bbfce8ca0ec43a3caccb URL: https://github.com/llvm/llvm-project/commit/12c90bd612fe7eb9e991bbfce8ca0ec43a3caccb DIFF: https://github.com/llvm/llvm-project/commit/12c90bd612fe7eb9e991bbfce8ca0ec43a3caccb.diff

[clang] [llvm] [LinkerWrapper] Handle AMDGPU Target-IDs correctly when linking (PR #78359)

2024-01-18 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/78359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [libcxx] [clang-tools-extra] [flang] [compiler-rt] [libc] [libcxxabi] [libunwind] [lldb] [llvm] Fix a bug in Smith's algorithm used in complex div/mul. (PR #78330)

2024-01-18 Thread Zahira Ammarguellat via cfe-commits
@@ -978,7 +978,11 @@ ComplexPairTy ComplexExprEmitter::EmitBinDiv(const BinOpInfo &Op) { return EmitRangeReductionDiv(LHSr, LHSi, RHSr, RHSi); else if (Op.FPFeatures.getComplexRange() == LangOptions::CX_Limited) return EmitAlgebraicDiv(LHSr, LHSi, RHSr, RHSi);

[clang-tools-extra] [lldb] [libc] [llvm] [clang] [libcxxabi] [libunwind] [libcxx] [flang] [lld] [compiler-rt] Fix a bug in Smith's algorithm used in complex div/mul. (PR #78330)

2024-01-18 Thread Zahira Ammarguellat via cfe-commits
@@ -2780,24 +2781,24 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D, case options::OPT_fcx_limited_range: { EmitComplexRangeDiag(D, Range, LangOptions::ComplexRangeKind::CX_Limited); Range = LangOptions::ComplexRangeKind::CX_Lim

[clang-tools-extra] [lldb] [libc] [llvm] [clang] [libcxxabi] [libunwind] [libcxx] [flang] [lld] [compiler-rt] Fix a bug in Smith's algorithm used in complex div/mul. (PR #78330)

2024-01-18 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: > It's bad that we don't have a IR test that breaks when you change the IR > output like this. Please add one. Done. https://github.com/llvm/llvm-project/pull/78330 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[libunwind] [libcxxabi] [llvm] [flang] [libc] [libcxx] [lldb] [clang] [lld] [clang-tools-extra] [compiler-rt] Fix a bug in Smith's algorithm used in complex divl. (PR #78330)

2024-01-18 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/78330 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [lldb] [libc] [llvm] [clang] [libcxxabi] [libunwind] [libcxx] [flang] [lld] [compiler-rt] Fix a bug in Smith's algorithm used in complex div. (PR #78330)

2024-01-18 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/78330 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose use of template keyword after declarative nested-name-specifiers (PR #78595)

2024-01-18 Thread Krystian Stasiowski via cfe-commits
@@ -182,8 +182,8 @@ struct Bad2 { int a, b; }; } // namespace dr2386 namespace std { template struct tuple_size; -template <> struct std::tuple_size {}; sdkrystian wrote: It is, yes https://github.com/llvm/llvm-project/pull/78595

[clang] [llvm] [compiler-rt] [clang-tools-extra] [flang] [clang] Add test for CWG1807 (PR #77637)

2024-01-18 Thread Nico Weber via cfe-commits
nico wrote: This breaks tests on macOS: http://45.33.8.238/macm1/76983/step_7.txt Please take a look and revert for now if it takes a while to fix. https://github.com/llvm/llvm-project/pull/77637 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[llvm] [clang] [HLSL][SPIR-V] Add Vulkan to target triple (PR #76749)

2024-01-18 Thread Natalie Chouinard via cfe-commits
https://github.com/sudonatalie updated https://github.com/llvm/llvm-project/pull/76749 >From 0aa15ea1cc6cec12bc347aff1753a95894fa1677 Mon Sep 17 00:00:00 2001 From: Natalie Chouinard Date: Fri, 15 Dec 2023 20:50:43 + Subject: [PATCH 1/4] [HLSL][SPIR-V] Add Vulkan to target triple Add suppo

[clang] [llvm] [CodeGen] Port AtomicExpand to new Pass Manager (PR #71220)

2024-01-18 Thread Matt Arsenault via cfe-commits
@@ -340,7 +342,31 @@ bool AtomicExpand::runOnFunction(Function &F) { return MadeChange; } -bool AtomicExpand::bracketInstWithFences(Instruction *I, AtomicOrdering Order) { +bool AtomicExpandLegacy::runOnFunction(Function &F) { + i arsenm wrote: Stray char

[llvm] [clang] [CodeGen] Port AtomicExpand to new Pass Manager (PR #71220)

2024-01-18 Thread Matt Arsenault via cfe-commits
@@ -457,7 +457,7 @@ TargetPassConfig *PPCTargetMachine::createPassConfig(PassManagerBase &PM) { void PPCPassConfig::addIRPasses() { if (TM->getOptLevel() != CodeGenOptLevel::None) addPass(createPPCBoolRetToIntPass()); - addPass(createAtomicExpandPass()); + addPass(crea

[llvm] [clang] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2024-01-18 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan approved this pull request. I meant to approve this before but forgot. I think LGTM once the comments are addressed. https://github.com/llvm/llvm-project/pull/68919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[llvm] [clang-tools-extra] [clang] [CLANG] Add warning when INF or NAN are used in a binary operation or as function argument in fast math mode. (PR #76873)

2024-01-18 Thread Aaron Ballman via cfe-commits
@@ -2835,6 +2835,9 @@ class Preprocessor { if (Identifier.getIdentifierInfo()->isRestrictExpansion() && !SourceMgr.isInMainFile(Identifier.getLocation())) emitRestrictExpansionWarning(Identifier); + +if (Identifier.getIdentifierInfo()->getName() == "INFINI

[llvm] [clang] [HLSL][SPIR-V] Add Vulkan to target triple (PR #76749)

2024-01-18 Thread Natalie Chouinard via cfe-commits
sudonatalie wrote: Rebased due to conflicts. I'm going to go ahead and merge this today to make the next dependent change easier to review, but DXIL folks please still feel free to follow-up if there are any concerns. (Also, ignoring the code formatter bot since it seems to be an existing int

[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-18 Thread Alex Bradbury via cfe-commits
asb wrote: > However, I must say, I cannot understand why this is even a thing that anyone > would want. Why would anyone design a single-processor RISCV system that > doesn't implement LR/SC? If you don't have the issue of coherent memory > across multiple CPUs, LR/SC is utterly trivial to im

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,149 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t + +#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b)) + +constexpr int myConstexprMin(int a, int b) { + return a < b ? a : b; +} + +constexpr int myConstexprMax(int a, int b) { + return a > b ? a : b;

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,149 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t + +#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b)) + +constexpr int myConstexprMin(int a, int b) { + return a < b ? a : b; +} + +constexpr int myConstexprMax(int a, int b) { + return a > b ? a : b;

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,149 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t + +#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b)) + +constexpr int myConstexprMin(int a, int b) { + return a < b ? a : b; +} + +constexpr int myConstexprMax(int a, int b) { + return a > b ? a : b;

[clang-tools-extra] [llvm] [clang] [LoopVectorize] Refine runtime memory check costs when there is an outer loop (PR #76034)

2024-01-18 Thread David Sherwood via cfe-commits
https://github.com/david-arm updated https://github.com/llvm/llvm-project/pull/76034 >From a4caa47dc8d2db75f6bb2ac3f880da4e1f6bea82 Mon Sep 17 00:00:00 2001 From: David Sherwood Date: Tue, 19 Dec 2023 16:07:33 + Subject: [PATCH 1/6] Add tests showing runtime checks cost with low trip count

[llvm] [clang] [clang, SystemZ] Pass HasDef flag to getMinGlobalAlign(). (PR #73511)

2024-01-18 Thread Jonas Paulsson via cfe-commits
@@ -11,6 +11,7 @@ //===--===// #include "SystemZ.h" +#include "clang/AST/Decl.h" JonPsson1 wrote: ping! Any further comments / opinions on how to best do this, please? https://github.com/l

[llvm] [clang-tools-extra] [clang] [LoopVectorize] Refine runtime memory check costs when there is an outer loop (PR #76034)

2024-01-18 Thread David Sherwood via cfe-commits
@@ -2076,16 +2081,61 @@ class GeneratedRTChecks { LLVM_DEBUG(dbgs() << " " << C << " for " << I << "\n"); RTCheckCost += C; } -if (MemCheckBlock) +if (MemCheckBlock) { + InstructionCost MemCheckCost = 0; for (Instruction &I : *MemChec

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-18 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 01/11] [Clang][Sema] Print more static_assert exprs This change int

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-18 Thread Félix-Antoine Constantin via cfe-commits
@@ -0,0 +1,149 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t + +#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b)) + +constexpr int myConstexprMin(int a, int b) { + return a < b ? a : b; +} + +constexpr int myConstexprMax(int a, int b) { + return a > b ? a : b;

[clang] Make getAttr, getSpecificAttr, hasAttr, and hasSpecificAttr variadic (PR #78518)

2024-01-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/78518 >From e3d667796b903d35405014db67b130ae20816bab Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 17 Jan 2024 10:26:22 -0800 Subject: [PATCH 1/2] Make getAttr, getSpecificAttr, hasAttr, and hasSpecificAttr

<    1   2   3   4   5   6   >