[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-28 Thread Younan Zhang via cfe-commits
@@ -186,3 +186,74 @@ class E { #endif template using D = int; // expected-note {{declared here}} E ed; // expected-note {{instantiation of}} + +namespace non_functions { + +#if __cplusplus >= 201103L +namespace PR88832 { +template struct O { + static const T v = 0; +}; +

[clang] [compiler-rt] [llvm] [ConstantFolding] Canonicalize constexpr GEPs to i8 (PR #89872)

2024-04-28 Thread Nikita Popov via cfe-commits
nikic wrote: > btw we're still looking into a performance regression caused by #68882 that > still repros with LLVM head, even after the SROA enhancements. this patch > looks good, but can we hold off a bit on submitting this? Sure! https://github.com/llvm/llvm-project/pull/89872

[clang] [compiler-rt] [llvm] [ConstantFolding] Canonicalize constexpr GEPs to i8 (PR #89872)

2024-04-28 Thread Nikita Popov via cfe-commits
@@ -944,43 +943,18 @@ Constant *SymbolicallyEvaluateGEP(const GEPOperator *GEP, return ConstantExpr::getIntToPtr(C, ResTy); } - // Otherwise form a regular getelementptr. Recompute the indices so that - // we eliminate over-indexing of the notional static type array

[clang] [compiler-rt] [llvm] [ConstantFolding] Canonicalize constexpr GEPs to i8 (PR #89872)

2024-04-28 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: btw we're still looking into a performance regression caused by #68882 that still repros with LLVM head, even after the SROA enhancements. this patch looks good, but can we hold off a bit on submitting this? https://github.com/llvm/llvm-project/pull/89872

[clang] [compiler-rt] [llvm] [ConstantFolding] Canonicalize constexpr GEPs to i8 (PR #89872)

2024-04-28 Thread Arthur Eubanks via cfe-commits
@@ -944,43 +943,18 @@ Constant *SymbolicallyEvaluateGEP(const GEPOperator *GEP, return ConstantExpr::getIntToPtr(C, ResTy); } - // Otherwise form a regular getelementptr. Recompute the indices so that - // we eliminate over-indexing of the notional static type array

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

2024-04-28 Thread Pengcheng Wang via cfe-commits
wangpc-pp wrote: > > > @dyung Can you help me to comfirm whether the Windows builder is passing > > > now? I don't have such environment. Thanks in advance! > > > > > > Sure, I'll try it on our internal builder and see if it passes and let you > > know the result. > > I can confirm that

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

2024-04-28 Thread via cfe-commits
dyung wrote: > > @dyung Can you help me to comfirm whether the Windows builder is passing > > now? I don't have such environment. Thanks in advance! > > Sure, I'll try it on our internal builder and see if it passes and let you > know the result. I can confirm that this change builds

[clang] [Clang][Sema] Fix a bug on template partial specialization with issue on deduction of nontype tempalte parameter (PR #90376)

2024-04-28 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/90376 >From 947096950049ac7047a26335a993e48c1fa5c16d Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sun, 28 Apr 2024 14:24:30 +0800 Subject: [PATCH] [Clang][Sema] Fix a bug on template partial specialization with issue

[clang] [X86_64] Fix empty field error in vaarg of C++. (PR #90389)

2024-04-28 Thread Longsheng Mou via cfe-commits
https://github.com/CoTinker updated https://github.com/llvm/llvm-project/pull/90389 >From 3c1aac31d879ebf172d2b9b6c9a351d967f72606 Mon Sep 17 00:00:00 2001 From: Longsheng Mou Date: Sun, 28 Apr 2024 17:14:29 +0800 Subject: [PATCH] [X86_64] Fix empty field error in vaarg of C++. Such struct

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-04-28 Thread Hubert Tong via cfe-commits
@@ -14638,6 +14649,8 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { return true; } + case Builtin::BIfmin: + case Builtin::BIfminf: hubert-reinterpretcast wrote: Makes me wonder how far C++ stdlibs will get if they included the C

[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)

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

[clang] [Clang][Sema] Fix a bug on template partial specialization with issue on deduction of nontype tempalte parameter (PR #90376)

2024-04-28 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/90376 >From cb7acd79aea4af3e92b5317e55fb43cabc7ebb40 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sun, 28 Apr 2024 14:24:30 +0800 Subject: [PATCH] [Clang][Sema] Fix a bug on template partial specialization with issue

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/89796 >From 662f160418c704f45e57e751168903d774b74303 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 23 Apr 2024 17:41:25 +0100 Subject: [PATCH 1/7] Add initial support for AMDGCN flavoured SPIRV. ---

[clang] [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (PR #89906)

2024-04-28 Thread NAKAMURA Takumi via cfe-commits
@@ -1115,7 +1115,9 @@ int64_t Decl::getID() const { const FunctionType *Decl::getFunctionType(bool BlocksToo) const { QualType Ty; - if (const auto *D = dyn_cast(this)) + if (const auto *D = dyn_cast(this)) chapuni wrote: Seems causes the warning.

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-28 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/89942 >From 8c5f1d0f92d77bffec88759c19133a0bac130f32 Mon Sep 17 00:00:00 2001 From: yronglin Date: Wed, 24 Apr 2024 23:36:10 +0800 Subject: [PATCH 1/7] [Clang] Implement P2748R5 "Disallow Binding a Returned Glvalue

[clang] [clang] fix(85447): clang 18.1.0 crashes in clang::ASTContext::getTypeInfoImpl (PR #89850)

2024-04-28 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/89850 >From f4e4e7b91e85d12c861063e1461b160b9bd22da6 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Mon, 29 Apr 2024 01:53:47 +0300 Subject: [PATCH] fix(85447): refine handling of incomplete anonymous struct

[clang] [Clang][Sema] Fix a bug on template partial specialization with issue on deduction of nontype tempalte parameter (PR #90376)

2024-04-28 Thread Qizhi Hu via cfe-commits
jcsxky wrote: Windows CI failed with an unrelated file. https://github.com/llvm/llvm-project/pull/90376 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [Flang] Add support for -w option (PR #90420)

2024-04-28 Thread Kiran Chandramohan via cfe-commits
https://github.com/kiranchandramohan updated https://github.com/llvm/llvm-project/pull/90420 >From 6a22c2de281bc04c9f71b7fcc8289e4217b70e08 Mon Sep 17 00:00:00 2001 From: Kiran Chandramohan Date: Fri, 26 Apr 2024 09:26:11 + Subject: [PATCH] [Flang][Driver] Add support for -w option A

[clang] [flang] [Flang] Add support for -w option (PR #90420)

2024-04-28 Thread Kiran Chandramohan via cfe-commits
https://github.com/kiranchandramohan edited https://github.com/llvm/llvm-project/pull/90420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [Flang][Driver] Add support for -w option (PR #90420)

2024-04-28 Thread Kiran Chandramohan via cfe-commits
https://github.com/kiranchandramohan created https://github.com/llvm/llvm-project/pull/90420 A quick and dirty implementation of the -w option. Filters the warning messages generated by the Frontend during emission. TODO: Add more tests TODO: Ignore MLIR, LLVM IR and Driver warnings TODO:

[clang] [clang] fix(85447): clang 18.1.0 crashes in clang::ASTContext::getTypeInfoImpl (PR #89850)

2024-04-28 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/89850 >From 484100917d034bc30131ebb95578d09083a2325a Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Wed, 24 Apr 2024 03:27:52 +0300 Subject: [PATCH] fix(85447): refine handling of incomplete anonymous struct

[clang] [clang] Fix `remove{CVR|Fast}Qualifiers` with 64-bit `Qualifiers::Mask` (PR #90329)

2024-04-28 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/90329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %check_clang_tidy %s bugprone-exception-rethrow %t -- -- -fexceptions + +struct exception {}; + +namespace std { + template + T&& move(T ) { +return static_cast(x); + } +} + +void correct() { + try { + throw exception(); + } catch(const

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %check_clang_tidy %s bugprone-exception-rethrow %t -- -- -fexceptions + +struct exception {}; + +namespace std { isuckatcs wrote: For the static analyzer we have `system-header-simulator-cxx.h`, maybe clang-tidy would also benefit

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

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

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread via cfe-commits
@@ -0,0 +1,67 @@ +.. title:: clang-tidy - bugprone-exception-rethrow + +bugprone-exception-rethrow +== + +Identifies problematic exception rethrowing, especially with caught exception +variables or empty throw statements outside catch blocks. + +In C++

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread via cfe-commits
@@ -0,0 +1,67 @@ +.. title:: clang-tidy - bugprone-exception-rethrow + +bugprone-exception-rethrow +== + +Identifies problematic exception rethrowing, especially with caught exception +variables or empty throw statements outside catch blocks. + +In C++

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread via cfe-commits
@@ -0,0 +1,67 @@ +.. title:: clang-tidy - bugprone-exception-rethrow + +bugprone-exception-rethrow +== + +Identifies problematic exception rethrowing, especially with caught exception +variables or empty throw statements outside catch blocks. + +In C++

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread via cfe-commits
https://github.com/isuckatcs requested changes to this pull request. Apart from a few typos in the docs and the lambda case, the patch looks good to me. https://github.com/llvm/llvm-project/pull/86448 ___ cfe-commits mailing list

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %check_clang_tidy %s bugprone-exception-rethrow %t -- -- -fexceptions + +struct exception {}; + +namespace std { + template + T&& move(T ) { isuckatcs wrote: ```suggestion T&& move(T &) { ``` The official signature is the one

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread via cfe-commits
@@ -0,0 +1,67 @@ +.. title:: clang-tidy - bugprone-exception-rethrow + +bugprone-exception-rethrow +== + +Identifies problematic exception rethrowing, especially with caught exception +variables or empty throw statements outside catch blocks. + +In C++

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread via cfe-commits
@@ -0,0 +1,67 @@ +.. title:: clang-tidy - bugprone-exception-rethrow + +bugprone-exception-rethrow +== + +Identifies problematic exception rethrowing, especially with caught exception +variables or empty throw statements outside catch blocks. + +In C++

[clang] [clang-format] Set Change.TokenLength to ColumnWidth (PR #90378)

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

[clang] aa596fa - [clang-format] Set Change.TokenLength to ColumnWidth (#90378)

2024-04-28 Thread via cfe-commits
Author: Owen Pan Date: 2024-04-28T14:06:12-07:00 New Revision: aa596fa4d974f75ed8d2db3f4880ec0e5be3e176 URL: https://github.com/llvm/llvm-project/commit/aa596fa4d974f75ed8d2db3f4880ec0e5be3e176 DIFF: https://github.com/llvm/llvm-project/commit/aa596fa4d974f75ed8d2db3f4880ec0e5be3e176.diff

[clang] 9c1de62 - [clang-format][NFC] Return early in isWordLike() for non-Verilog (#90363)

2024-04-28 Thread via cfe-commits
Author: Owen Pan Date: 2024-04-28T14:05:12-07:00 New Revision: 9c1de620344b2518bb171be51066e1ec9a5be623 URL: https://github.com/llvm/llvm-project/commit/9c1de620344b2518bb171be51066e1ec9a5be623 DIFF: https://github.com/llvm/llvm-project/commit/9c1de620344b2518bb171be51066e1ec9a5be623.diff

[clang] [clang-format][NFC] Return early in isWordLike() for non-Verilog (PR #90363)

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

[clang] [clang-format] Set Change.TokenLength to ColumnWidth (PR #90378)

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

[clang] [alpha.webkit.UncountedCallArgsChecker] Support more trivial expressions. (PR #90414)

2024-04-28 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/90414 >From ffc4df724e043e8655824bc2b3deb4e2ef632579 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sun, 28 Apr 2024 13:17:48 -0700 Subject: [PATCH] [alpha.webkit.UncountedCallArgsChecker] Support more trivial

[clang] [alpha.webkit.UncountedCallArgsChecker] Support more trivial expressions. (PR #90414)

2024-04-28 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/90414 >From 44bff2897be7531b33d558b711034aa98755a4cd Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sun, 28 Apr 2024 13:17:48 -0700 Subject: [PATCH] [alpha.webkit.UncountedCallArgsChecker] Support more trivial

[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)

2024-04-28 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 3ec858bc5d45ee22ca99febd38e1ba188f71022c 9a39e456a41e415cca62866ca093708412871e00 --

[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)

2024-04-28 Thread Ryosuke Niwa via cfe-commits
@@ -54,7 +54,7 @@ class UncountedCallArgsChecker bool shouldVisitImplicitCode() const { return false; } bool TraverseDecl(Decl *D) { -if (isa(D) && isRefType(safeGetName(D))) +if (D && isa(D) && isRefType(safeGetName(D))) return true;

[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)

2024-04-28 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/90301 >From 0e9d10029e6d498d3bc5a319ac0945cf23db230d Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Fri, 26 Apr 2024 17:01:35 -0700 Subject: [PATCH 1/3] Fix a crash introduced by 3d5e9ab by adding a nullptr check.

[clang] [alpha.webkit.UncountedCallArgsChecker] Support more trivial expressions. (PR #90414)

2024-04-28 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 3ec858bc5d45ee22ca99febd38e1ba188f71022c cc3b7f6c4d75aab856a8c31cc7ccfbcb5c6626e8 --

[clang] [alpha.webkit.UncountedCallArgsChecker] Support more trivial expressions. (PR #90414)

2024-04-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-static-analyzer-1 Author: Ryosuke Niwa (rniwa) Changes Treat a compound operator such as |=, array subscription, sizeof, and non-type template parameter as trivial so long as subexpressions are also trivial. Also treat

[clang] [alpha.webkit.UncountedCallArgsChecker] Support more trivial expressions. (PR #90414)

2024-04-28 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/90414 Treat a compound operator such as |=, array subscription, sizeof, and non-type template parameter as trivial so long as subexpressions are also trivial. Also treat true/false boolean literal as trivial. >From

[clang] [alpha.webkit.UncountedCallArgsChecker] Treat true/false as trivial (PR #90169)

2024-04-28 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/90169 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
@@ -309,7 +309,45 @@ StringRef AMDGPU::getCanonicalArchName(const Triple , StringRef Arch) { void AMDGPU::fillAMDGPUFeatureMap(StringRef GPU, const Triple , StringMap ) { // XXX - What does the member GPU mean if device name string passed

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.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] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.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] [clang-tidy] Add modernize-use-std-format check (PR #90397)

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

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Danny Mösch via cfe-commits
https://github.com/SimplyDanny approved this pull request. Only a few nits concerning non-functional code/text. Other than that LGTM. https://github.com/llvm/llvm-project/pull/90397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] Ignore unevaluated context in bugprone-optional-value-conversion (PR #90410)

2024-04-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Piotr Zegar (PiotrZSL) Changes Ignore optionals in unevaluated context, like static_assert or decltype. Closes #89593 --- Full diff: https://github.com/llvm/llvm-project/pull/90410.diff 3 Files Affected: - (modified)

[clang-tools-extra] [clang-tidy] Ignore unevaluated context in bugprone-optional-value-conversion (PR #90410)

2024-04-28 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/90410 Ignore optionals in unevaluated context, like static_assert or decltype. Closes #89593 >From 7dcbe220d74f2be4ade8429e6c0e710d7d7c58a4 Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Sun, 28 Apr 2024 19:16:43

[clang] [clang-format] Set Change.TokenLength to ColumnWidth (PR #90378)

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

[clang] [clang-format][NFC] Return early in isWordLike() for non-Verilog (PR #90363)

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

[clang] [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (PR #89906)

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

[clang] 6dd9061 - [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (#89906)

2024-04-28 Thread via cfe-commits
Author: cor3ntin Date: 2024-04-28T20:25:44+02:00 New Revision: 6dd90616c477d83c156eed62c880e951bb508cfd URL: https://github.com/llvm/llvm-project/commit/6dd90616c477d83c156eed62c880e951bb508cfd DIFF: https://github.com/llvm/llvm-project/commit/6dd90616c477d83c156eed62c880e951bb508cfd.diff

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. LG https://github.com/llvm/llvm-project/pull/89796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -54,3 +56,76 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions , BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +static const AMDGPUTargetInfo AMDGPUTI(llvm::Triple("amdgcn-amd-amdhsa"), {}); + +ArrayRef

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
@@ -54,3 +56,76 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions , BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +static const AMDGPUTargetInfo AMDGPUTI(llvm::Triple("amdgcn-amd-amdhsa"), {}); + +ArrayRef

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -54,3 +56,76 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions , BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +static const AMDGPUTargetInfo AMDGPUTI(llvm::Triple("amdgcn-amd-amdhsa"), {}); + +ArrayRef

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -309,7 +309,45 @@ StringRef AMDGPU::getCanonicalArchName(const Triple , StringRef Arch) { void AMDGPU::fillAMDGPUFeatureMap(StringRef GPU, const Triple , StringMap ) { // XXX - What does the member GPU mean if device name string passed

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
@@ -309,7 +309,45 @@ StringRef AMDGPU::getCanonicalArchName(const Triple , StringRef Arch) { void AMDGPU::fillAMDGPUFeatureMap(StringRef GPU, const Triple , StringMap ) { // XXX - What does the member GPU mean if device name string passed

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -309,7 +309,45 @@ StringRef AMDGPU::getCanonicalArchName(const Triple , StringRef Arch) { void AMDGPU::fillAMDGPUFeatureMap(StringRef GPU, const Triple , StringMap ) { // XXX - What does the member GPU mean if device name string passed

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/86448 >From 1b5c351acca7375c577111a4c55506146ef108ef Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Sun, 24 Mar 2024 18:39:54 + Subject: [PATCH 1/4] [clang-tidy] Added bugprone-exception-rethrow check

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,50 @@ +//===--- ExceptionRethrowCheck.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] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,50 @@ +//===--- ExceptionRethrowCheck.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] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,50 @@ +//===--- ExceptionRethrowCheck.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] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,37 @@ +//===--- ExceptionRethrowCheck.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-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,50 @@ +//===--- ExceptionRethrowCheck.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] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,60 @@ +// RUN: %check_clang_tidy %s bugprone-exception-rethrow %t -- -- -fexceptions + +struct exception {}; + +void correct() { + try { + throw exception(); + } catch(const exception &) { + throw; + } +} + +void correct2() { + try { + throw

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
@@ -6088,6 +6088,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, StringRef Prefix = llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch()); if (!Prefix.empty()) { +if (Prefix == "spv" && +

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -6088,6 +6088,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, StringRef Prefix = llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch()); if (!Prefix.empty()) { +if (Prefix == "spv" && +

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
@@ -6088,6 +6088,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, StringRef Prefix = llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch()); if (!Prefix.empty()) { +if (Prefix == "spv" && +

[clang] 8ad092f - [cc1as] Respect -mrelax-all

2024-04-28 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-04-28T09:42:43-07:00 New Revision: 8ad092f126bd1d6f9fe6006eba1e3115a080235e URL: https://github.com/llvm/llvm-project/commit/8ad092f126bd1d6f9fe6006eba1e3115a080235e DIFF: https://github.com/llvm/llvm-project/commit/8ad092f126bd1d6f9fe6006eba1e3115a080235e.diff

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,108 @@ +//===--- UseStdFormatCheck.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] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,97 @@ +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s modernize-use-std-format %t -- \ +// RUN: -config="{CheckOptions: [{key: StrictMode, value: true}]}" \ +// RUN: -- -isystem %clang_tidy_headers +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/90397 >From 0d6ede5d59cc70d803bfe2c7997737c1be358c75 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Apr 2024 12:41:46 +0100 Subject: [PATCH 1/8] [clang-tidy] Add modernize-use-std-format check Add a new

[clang] [lld] [llvm] Leaf + cgdata (PR #90401)

2024-04-28 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 b6824c9d459da059e247a60c1ebd1aeb580dacc2 9b99b234ef4edb68fc6d9734595d53685e16927c --

[clang] [lld] [llvm] [MachineOutliner][CGData] Append Content Hash To Outlined Function Name (PR #90400)

2024-04-28 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 b6824c9d459da059e247a60c1ebd1aeb580dacc2 6186c576e8ebfb80af7a58c6d8d24ca0f7277ade --

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -6088,6 +6088,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, StringRef Prefix = llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch()); if (!Prefix.empty()) { +if (Prefix == "spv" && +

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/89796 >From 662f160418c704f45e57e751168903d774b74303 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 23 Apr 2024 17:41:25 +0100 Subject: [PATCH 1/6] Add initial support for AMDGCN flavoured SPIRV. ---

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
@@ -54,3 +56,77 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions , BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +namespace { +const AMDGPUTargetInfo AMDGPUTI(llvm::Triple("amdgcn-amd-amdhsa"), {}); + +} //

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,97 @@ +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s modernize-use-std-format %t -- \ +// RUN: -config="{CheckOptions: [{key: StrictMode, value: true}]}" \ +// RUN: -- -isystem %clang_tidy_headers +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,48 @@ +//===--- UseStdFormatCheck.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-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -627,7 +628,8 @@ void FormatStringConverter::finalizeFormatText() { // It's clearer to convert printf("Hello\r\n"); to std::print("Hello\r\n") // than to std::println("Hello\r"); - if (StringRef(StandardFormatString).ends_with("\\n") && + if

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,108 @@ +//===--- UseStdFormatCheck.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] [clang-tidy] Add modernize-use-std-format check (PR #90397)

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

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. To be honest I'm not sure why it wasn't merged, there were some dependences on other changes and modernize-use-std-print check, and somehow it fall under radar. Overall looks fine. Please fix pointed out nits that pop up.

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,108 @@ +//===--- UseStdFormatCheck.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] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -54,3 +56,77 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions , BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +namespace { +const AMDGPUTargetInfo AMDGPUTI(llvm::Triple("amdgcn-amd-amdhsa"), {}); + +} //

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -54,3 +56,77 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions , BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +namespace { +const AMDGPUTargetInfo AMDGPUTI(llvm::Triple("amdgcn-amd-amdhsa"), {}); + +} //

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -673,8 +673,12 @@ std::unique_ptr AllocateTarget(const llvm::Triple , } case llvm::Triple::spirv64: { if (os != llvm::Triple::UnknownOS || -Triple.getEnvironment() != llvm::Triple::UnknownEnvironment) +Triple.getEnvironment() !=

[clang] [clang-repl] fix top-level statement declaration context (PR #75547)

2024-04-28 Thread Pavel Kalugin via cfe-commits
p4vook wrote: Looking for someone with knowledge of Clang AST, because I can't figure out the correct context to insert the statement into. Current implementation breaks "for" loop. https://github.com/llvm/llvm-project/pull/75547 ___ cfe-commits

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/89796 >From 662f160418c704f45e57e751168903d774b74303 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 23 Apr 2024 17:41:25 +0100 Subject: [PATCH 1/5] Add initial support for AMDGCN flavoured SPIRV. ---

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/89796 >From 662f160418c704f45e57e751168903d774b74303 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 23 Apr 2024 17:41:25 +0100 Subject: [PATCH 1/4] Add initial support for AMDGCN flavoured SPIRV. ---

  1   2   >