[clang-tools-extra] [clang-tidy] [docs] Replace _not_ in reserved-identifier.rst with *not* (PR #112162)

2024-10-13 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: @njriasan Thanks for the contribution! I see the commit message would include this: ``` Co-authored-by: Nicholas Riasanovsky ``` Do you want to keep that? https://github.com/llvm/llvm-project/pull/112162 ___ cfe-commits mailin

[clang-tools-extra] [clang-tidy] [docs] Replace _not_ in reserved-identifier.rst with *not* (PR #112162)

2024-10-13 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. https://github.com/llvm/llvm-project/pull/112162 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/112126 >From 17c346706a58342097170bdfac0aabd8c095994e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 13 Oct 2024 08:57:48 +0200 Subject: [PATCH] [clang][bytecode] Start implementing __builtin_

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s +// FIXME: %clang_cc1 -std=c++17 -fsyntax-only -verify -fexperimental-new-constant-interpreter %s +// expected-no-diagnostics + +constexpr double NaN = __builtin_nan(""); +constexpr double Inf = __builtin_in

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread YunQiang Su via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s +// FIXME: %clang_cc1 -std=c++17 -fsyntax-only -verify -fexperimental-new-constant-interpreter %s +// expected-no-diagnostics + +constexpr double NaN = __builtin_nan(""); +constexpr double Inf = __builtin_in

[clang] [lld] [lld][LoongArch] Enable relaxation when --relax option is passed (PR #111488)

2024-10-13 Thread via cfe-commits
https://github.com/ywgrit edited https://github.com/llvm/llvm-project/pull/111488 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [lld][LoongArch] Enable relaxation when --relax option is passed (PR #111488)

2024-10-13 Thread via cfe-commits
@@ -1462,6 +1462,8 @@ template void Writer::finalizeAddressDependentContent() { for (;;) { bool changed = ctx.target->needsThunks ? tc.createThunks(pass, ctx.outputSections) + : ctx.arg.emachine == EM_LOONGARCH && !ctx.arg.relax

[clang-tools-extra] [clang-tidy] [docs] Replace _not_ in reserved-identifier.rst with *not* (PR #112162)

2024-10-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Nick Riasanovsky (njriasan) Changes Fixes a documentation formatting error where `_not_` was used which has no special meaning in markdown and replaces it with `*not*`. Closes #111691 --- Full diff: https://github.com/llvm/llvm-pr

[clang-tools-extra] [clang-tidy] [docs] Replace _not_ in reserved-identifier.rst with *not* (PR #112162)

2024-10-13 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang-tools-extra] [clang-tidy] [docs] Replace _not_ in reserved-identifier.rst with *not* (PR #112162)

2024-10-13 Thread Nick Riasanovsky via cfe-commits
https://github.com/njriasan created https://github.com/llvm/llvm-project/pull/112162 Fixes a documentation formatting error where `_not_` was used which has no special meaning in markdown and replaces it with `*not*`. Closes #111691 >From 8b954f0c5479f45672ebe860337f39acccf30019 Mon Sep 17

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-13 Thread Piyou Chen via cfe-commits
https://github.com/BeMg edited https://github.com/llvm/llvm-project/pull/112161 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-13 Thread Piyou Chen via cfe-commits
@@ -111,3 +111,9 @@ __attribute__((target_version("default"))) int invalidVerson4(void) { return 2; __attribute__((target_version("priority=1"))) int prioriyWithoutArch(void) { return 2; } // expected-error@+1 {{redefinition of 'prioriyWithoutArch'}} __attribute__((target_ver

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Piyou Chen (BeMg) Changes Ensure that target_version and target_clones do not accept negative numbers for the priority feature. Base on discussion on https://github.com/riscv-non-isa/riscv-c-api-doc/pull/85. --- Patch is 23.87 KiB, tru

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v @llvm/pr-subscribers-clang-codegen Author: Piyou Chen (BeMg) Changes Ensure that target_version and target_clones do not accept negative numbers for the priority feature. Base on discussion on https://github.com/riscv-non-isa/riscv-c-ap

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-13 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/112161 Ensure that target_version and target_clones do not accept negative numbers for the priority feature. Base on discussion on https://github.com/riscv-non-isa/riscv-c-api-doc/pull/85. >From d7a00a878b472e1ba7abad1b

[clang] [Headers] [ARM64EC] Fix extra tokens inside intrin0.h preprocessor directive (PR #112066)

2024-10-13 Thread Max Winkler via cfe-commits
https://github.com/MaxEW707 updated https://github.com/llvm/llvm-project/pull/112066 >From 52e2175eb672fa9a97f9c1480a3cfb727b7c3dce Mon Sep 17 00:00:00 2001 From: MaxEW707 Date: Fri, 11 Oct 2024 19:01:59 -0700 Subject: [PATCH 1/2] Fix extra tokens inside intrin0.h preprocessor directive --- c

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread Matt Arsenault via cfe-commits
arsenm wrote: Maybe should add support for elementwise builtins next https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s +// FIXME: %clang_cc1 -std=c++17 -fsyntax-only -verify -fexperimental-new-constant-interpreter %s +// expected-no-diagnostics + +constexpr double NaN = __builtin_nan(""); +constexpr double Inf = __builtin_in

[clang] [Headers] [ARM64EC] Fix extra tokens inside intrin0.h preprocessor directive (PR #112066)

2024-10-13 Thread Max Winkler via cfe-commits
MaxEW707 wrote: > Not sure how you're actually hitting the error you reported; the clang header > directory should count as a system header, so the warning should normally be > suppressed, I think. It is counted as a system header and I could not repro the warning in my local tests. I was goi

[clang] [ARM64EC] Fix compilation of intrin.h in ARM64EC mode. (PR #87717)

2024-10-13 Thread Max Winkler via cfe-commits
@@ -44,7 +44,7 @@ unsigned char _InterlockedCompareExchange128_rel(__int64 volatile *_Destination, __int64 *_ComparandResult); #endif -#ifdef __x86_64__ +#ifdef __x86_64__ && !defined(__arm64ec__) MaxEW707 wrot

[clang] [clang][test] add testing for the AST matcher reference (PR #110258)

2024-10-13 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-m68k-linux-cross` running on `suse-gary-m68k-cross` while building `clang` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/554 Here is the relevant piece of

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-13 Thread via cfe-commits
@@ -0,0 +1,92 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] [Sema] Avoid repeated hash lookups (NFC) (PR #112156)

2024-10-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/112156.diff 1 Files Affected: - (modified) clang/lib/Sema/SemaAttr.cpp (+3-5) ``diff diff --git a/clang/lib/Sema/SemaAttr.cpp b/cl

[clang] [Sema] Avoid repeated hash lookups (NFC) (PR #112156)

2024-10-13 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/112156 None >From eeb4bc3b6cf466332b33413441c80291556c3142 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 13 Oct 2024 07:48:45 -0700 Subject: [PATCH] [Sema] Avoid repeated hash lookups (NFC) --- clang/

[clang] [AST] Avoid repeated set lookups (NFC) (PR #112155)

2024-10-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/112155.diff 1 Files Affected: - (modified) clang/lib/AST/InheritViz.cpp (+1-2) ``diff diff --git a/clang/lib/AST/InheritViz.cpp b/

[clang] [AST] Avoid repeated set lookups (NFC) (PR #112155)

2024-10-13 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/112155 None >From d484b61db4ac1645358faa30962d406413f0714b Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 13 Oct 2024 07:42:03 -0700 Subject: [PATCH] [AST] Avoid repeated set lookups (NFC) --- clang/li

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-13 Thread via cfe-commits
https://github.com/goldsteinn updated https://github.com/llvm/llvm-project/pull/91101 >From 272c27c42b61d5e1513c9141b5a4ec0f4d9a466d Mon Sep 17 00:00:00 2001 From: Noah Goldstein Date: Sat, 4 May 2024 18:12:34 -0500 Subject: [PATCH 1/3] [Inliner] Add tests for propagating more parameter attrib

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-13 Thread via cfe-commits
https://github.com/goldsteinn updated https://github.com/llvm/llvm-project/pull/91101 >From 272c27c42b61d5e1513c9141b5a4ec0f4d9a466d Mon Sep 17 00:00:00 2001 From: Noah Goldstein Date: Sat, 4 May 2024 18:12:34 -0500 Subject: [PATCH 1/2] [Inliner] Add tests for propagating more parameter attrib

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-13 Thread via cfe-commits
@@ -98,6 +98,13 @@ Improvements to clang-tidy New checks ^^ +- New :doc:`bugprone-incorrect-enable-shared-from-this + ` check. + + Detects if class/structs publicly inherits from ``std::enable_shared_from_this``, MichelleCDjunaidi wrote: Will synch

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-13 Thread via cfe-commits
@@ -0,0 +1,34 @@ +.. title:: clang-tidy - bugprone-incorrect-enable-shared-from-this + +bugprone-incorrect-enable-shared-from-this +== + +Detects if a class or struct publicly inherits from +``std::enable_shared_from_this``, because uninten

[clang] [llvm] [LoongArch] Add options for annotate tablejump (PR #102411)

2024-10-13 Thread via cfe-commits
@@ -167,6 +169,39 @@ bool LoongArchPreRAExpandPseudo::expandMI( case LoongArch::PseudoTAIL_MEDIUM: case LoongArch::PseudoTAIL_LARGE: return expandFunctionCALL(MBB, MBBI, NextMBBI, /*IsTailCall=*/true); + case LoongArch::PseudoBRIND: { +// If the PseudoBRIND is used

[clang] [llvm] [LoongArch] Add options for annotate tablejump (PR #102411)

2024-10-13 Thread via cfe-commits
wangleiat wrote: > > Is this expected? Thank you very much. I didn't take into account the situation where a basic block belongs to multiple `MachineJumpTableEntry`. It seems that traversing the entire `MF` would provide a more accurate output. https://github.com/llvm/llvm-project/pull/10241

[clang] [Headers] [ARM64EC] Fix extra tokens inside intrin0.h preprocessor directive (PR #112066)

2024-10-13 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Please add a testcase (something similar to clang/test/Headers/ms-intrin.cpp, but including intrin0.h instead of intrin.h, to catch obvious mistakes in the header). Not sure how you're actually hitting the error you reported; the clang header directory should count as a s

[clang] [llvm] [RISCV] Add support for inline asm constraint vd (PR #111653)

2024-10-13 Thread Jim Lin via cfe-commits
https://github.com/tclin914 closed https://github.com/llvm/llvm-project/pull/111653 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] dba54fb - [RISCV] Add support for inline asm constraint vd (#111653)

2024-10-13 Thread via cfe-commits
Author: Jim Lin Date: 2024-10-14T10:47:59+08:00 New Revision: dba54fb074af1573984807e23640a202e0984a56 URL: https://github.com/llvm/llvm-project/commit/dba54fb074af1573984807e23640a202e0984a56 DIFF: https://github.com/llvm/llvm-project/commit/dba54fb074af1573984807e23640a202e0984a56.diff LOG:

[clang] [ASTWriter] Detect more non-affecting FileIDs to reduce source location duplication (PR #112015)

2024-10-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. looks good to me. Please leave some time to @jansvoboda11 https://github.com/llvm/llvm-project/pull/112015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [ASTWriter] Detect more non-affecting FileIDs to reduce source location duplication (PR #112015)

2024-10-13 Thread Chuanqi Xu via cfe-commits
@@ -192,13 +201,13 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) { // The containing module map is affecting, because it's being pointed // into by Module::DefinitionLoc. - if (auto FE = MM.getContainingModuleMapFile(Mod)) -Mod

[clang] [ASTWriter] Detect more non-affecting FileIDs to reduce source location duplication (PR #112015)

2024-10-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/112015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-10-13 Thread Chuanqi Xu via cfe-commits
@@ -10057,15 +10057,18 @@ void ASTReader::finishPendingActions() { // For a function defined inline within a class template, force the // canonical definition to be the one inside the canonical definition of // the template. This ensures that we instantiate fr

[clang] Make [[clang::lifetimebound]] work for expressions coming from default arguments (PR #112047)

2024-10-13 Thread via cfe-commits
higher-performance wrote: Thanks so much, I made all those changes, please take another look. https://github.com/llvm/llvm-project/pull/112047 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] Make [[clang::lifetimebound]] work for expressions coming from default arguments (PR #112047)

2024-10-13 Thread via cfe-commits
@@ -19,8 +19,10 @@ namespace usage_invalid { namespace usage_ok { struct IntRef { int *target; }; + const int *defaultparam(const int &def1 [[clang::lifetimebound]] = 0); // #def1 int &refparam(int ¶m [[clang::lifetimebound]]); int &classparam(IntRef param [[clang::l

[clang] Make [[clang::lifetimebound]] work for expressions coming from default arguments (PR #112047)

2024-10-13 Thread via cfe-commits
@@ -532,6 +533,11 @@ static void visitLocalsRetainedByReferenceBinding(IndirectLocalPath &Path, } } while (Init != Old); + if (auto *DAE = dyn_cast(Init)) { +Path.push_back({IndirectLocalPathEntry::DefaultArg, DAE, DAE->getParam()}); +Init = DAE->getExpr(); +

[clang] Make [[clang::lifetimebound]] work for expressions coming from default arguments (PR #112047)

2024-10-13 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/112047 >From 5a7cd2a5cf5275d408fac91dd03363137457b0e1 Mon Sep 17 00:00:00 2001 From: higher-performance Date: Fri, 11 Oct 2024 17:09:13 -0400 Subject: [PATCH] Make [[clang::lifetimebound]] work for expressio

[clang] [Clang] Implement CWG 2628 "Implicit deduction guides should propagate constraints" (PR #111143)

2024-10-13 Thread Younan Zhang via cfe-commits
@@ -478,3 +478,166 @@ A a{.f1 = {1}}; // CHECK-NEXT: `-DeclRefExpr {{.+}} 'int' NonTypeTemplateParm {{.+}} 'N' 'int' } // namespace GH83368 + +namespace GH60777 { + +template constexpr bool True() { return true; } + +template + requires(sizeof(T) == 4) +struct A { +

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-13 Thread Chuanqi Xu via cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr { /// /// If the low bit is clear, a pointer to the AST node. If the low /// bit is set, the upper 63 bits are the offset. - mutable uint64_t Ptr = 0; + mutable uintptr_t Ptr = 0; public: LazyOffsetPtr() = default; - exp

[clang] [clang] Mark `__builtin_convertvector` and `__builtin_shufflevector` as `constexpr`. (PR #112129)

2024-10-13 Thread via cfe-commits
c8ef wrote: And I think we need to align these two to make the feature test macro work. https://github.com/llvm/llvm-project/pull/112129 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Mark `__builtin_convertvector` and `__builtin_shufflevector` as `constexpr`. (PR #112129)

2024-10-13 Thread via cfe-commits
c8ef wrote: I believe the difference lies in the AST construction. Most built-in functions generate a `CallExpr` AST node, which requires the constant evaluator to check if the function is built-in. However, in this case, Clang emits a `ConvertVector` node directly. Therefore, even if we don't

[clang] [lld] [lld][LoongArch] Enable relaxation when --relax option is passed (PR #111488)

2024-10-13 Thread Lu Weining via cfe-commits
@@ -1462,6 +1462,8 @@ template void Writer::finalizeAddressDependentContent() { for (;;) { bool changed = ctx.target->needsThunks ? tc.createThunks(pass, ctx.outputSections) + : ctx.arg.emachine == EM_LOONGARCH && !ctx.arg.relax

[clang] [lld] [lld][LoongArch] Enable relaxation when --relax option is passed (PR #111488)

2024-10-13 Thread via cfe-commits
@@ -1462,6 +1462,8 @@ template void Writer::finalizeAddressDependentContent() { for (;;) { bool changed = ctx.target->needsThunks ? tc.createThunks(pass, ctx.outputSections) + : ctx.arg.emachine == EM_LOONGARCH && !ctx.arg.relax

[clang] [lld] [lld][LoongArch] Enable relaxation when --relax option is passed (PR #111488)

2024-10-13 Thread Lu Weining via cfe-commits
@@ -1462,6 +1462,8 @@ template void Writer::finalizeAddressDependentContent() { for (;;) { bool changed = ctx.target->needsThunks ? tc.createThunks(pass, ctx.outputSections) + : ctx.arg.emachine == EM_LOONGARCH && !ctx.arg.relax

[clang] [llvm] [LLVM] [Clang] Support for Gentoo `*t64` triples (64-bit time_t ABIs) (PR #111302)

2024-10-13 Thread Sam James via cfe-commits
=?utf-8?q?Micha=C5=82_G=C3=B3rny?= , =?utf-8?q?Micha=C5=82_G=C3=B3rny?= Message-ID: In-Reply-To: https://github.com/thesamesam approved this pull request. https://github.com/llvm/llvm-project/pull/111302 ___ cfe-commits mailing list cfe-commits@list

[clang] [clang][GNU] Pass -t through to the linker (PR #112106)

2024-10-13 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/112106 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-13 Thread via cfe-commits
@@ -0,0 +1,34 @@ +.. title:: clang-tidy - bugprone-incorrect-enable-shared-from-this + +bugprone-incorrect-enable-shared-from-this +== + +Detects if a class or struct publicly inherits from +``std::enable_shared_from_this``, because uninten

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-10-13 Thread Owen Pan via cfe-commits
@@ -616,6 +627,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) + return 0; +

[clang] [Clang] Diagnose additional ObjC statements as function effect violations (PR #112148)

2024-10-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Doug Wyatt (dougsonos) Changes Bug fix: `@autoreleasepool`, `@synchronized`, and `@finally` were not being noticed and treated as function effect violations. --- Full diff: https://github.com/llvm/llvm-project/pull/112148.diff 2 Files Af

[clang] [Clang] Diagnose additional ObjC statements as function effect violations (PR #112148)

2024-10-13 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos created https://github.com/llvm/llvm-project/pull/112148 Bug fix: `@autoreleasepool`, `@synchronized`, and `@finally` were not being noticed and treated as function effect violations. >From f34e4ac55d04bcd8e34bef57afec5a39fbf2acb9 Mon Sep 17 00:00:00 2001 From: Dou

[clang] Rough first stab at addressing #85120 (PR #85147)

2024-10-13 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos closed https://github.com/llvm/llvm-project/pull/85147 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-13 Thread Daniel Chen via cfe-commits
DanielCChen wrote: We have downstream code that used `getDeclaration` and not we have changed to `getOrInsertDeclaration` for all places. My understanding from reading the thread is that `getOrInsertDelcaration1 will stay and a new `findDeclaration` will be added temporarily and it will eventu

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-10-13 Thread Julian Schmidt via cfe-commits
@@ -38,3 +38,12 @@ Example: This check implements `F.19 `_ from the C++ Core Guidelines. + +Options +--- + +.. option:: IgnoreStaticCasts + + Boolean flag to allow users who want to use the forwarding

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-10-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Sorry for the delay. Feel free to ping PRs that had no activity https://github.com/llvm/llvm-project/pull/99477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

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

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-10-13 Thread Julian Schmidt via cfe-commits
@@ -86,6 +88,15 @@ AST_MATCHER(VarDecl, hasIdentifier) { } // namespace +MissingStdForwardCheck::MissingStdForwardCheck(StringRef Name, + ClangTidyContext *Context) +: ClangTidyCheck(Name, Context), + IgnoreStaticCasts(Op

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,34 @@ +.. title:: clang-tidy - bugprone-incorrect-enable-shared-from-this + +bugprone-incorrect-enable-shared-from-this +== + +Detects if a class or struct publicly inherits from +``std::enable_shared_from_this``, because uninten

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,92 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,35 @@ +//===--- IncorrectEnableSharedFromThisCheck.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-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: This is 'basically' ready. Sorry for the delay. --- As stated in the comment, I've benchmarked the RAV and matcher-based solution, and they perform the same. So the actual (performance) benefit of using the RAV does not actually exist. I'd suggest using

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

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

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-13 Thread Julian Schmidt via cfe-commits
@@ -98,6 +98,13 @@ Improvements to clang-tidy New checks ^^ +- New :doc:`bugprone-incorrect-enable-shared-from-this + ` check. + + Detects if class/structs publicly inherits from ``std::enable_shared_from_this``, 5chmidti wrote: `Detects if a class

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,92 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] [clang] Mark `__builtin_convertvector` and `__builtin_shufflevector` as `constexpr`. (PR #112129)

2024-10-13 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: How are we already able to use these in constexpr if they are missing the attribute? https://github.com/llvm/llvm-project/pull/112129 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [clang][bytecode] Start implementing __builtin_bit_cast (PR #112126)

2024-10-13 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/112126 >From 4eedfc2870d66c3581d78bc4963ec3999b4ce4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 13 Oct 2024 08:57:48 +0200 Subject: [PATCH] [clang][bytecode] Start implementing __builtin_

[clang] [clang][python] Don't add check-clang-python to check-all if cross-compiling (PR #111657)

2024-10-13 Thread Alex Bradbury via cfe-commits
https://github.com/asb closed https://github.com/llvm/llvm-project/pull/111657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] c1b206f - [clang][python] Don't add check-clang-python to check-all if cross-compiling (#111657)

2024-10-13 Thread via cfe-commits
Author: Alex Bradbury Date: 2024-10-13T16:51:37+01:00 New Revision: c1b206f347f633c84ac32f691241460196cd6226 URL: https://github.com/llvm/llvm-project/commit/c1b206f347f633c84ac32f691241460196cd6226 DIFF: https://github.com/llvm/llvm-project/commit/c1b206f347f633c84ac32f691241460196cd6226.diff

[clang] [clang][python] Don't add check-clang-python to check-all if cross-compiling (PR #111657)

2024-10-13 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: LGTM https://github.com/llvm/llvm-project/pull/111657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fix access checking about function overloading (PR #107768)

2024-10-13 Thread Zhikai Zeng via cfe-commits
Backl1ght wrote: After some more debugging, I find out that we will check access here at https://github.com/llvm/llvm-project/blob/8e010ac5a173c9dee44b44324169a3e100a1a6fc/clang/lib/Sema/SemaInit.cpp#L7807 And for `f()` inside code below, `Found.getAccess()` is `AS_none` hence `CheckAddressOfM

[clang] [analyzer] Modernize FuchsiaHandleChecker (PR #111588)

2024-10-13 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/111588 >From a3805292ea37cf06d1cf227768034b30a42a685f Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Mon, 7 Oct 2024 23:01:24 +0300 Subject: [PATCH 1/6] wip: initial versio --- .../Checkers/FuchsiaHandleChecker.

[clang] [HIP] Replace use of `llvm-mc` with `clang` (PR #112041)

2024-10-13 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > @petrhosek Can someone explain why the clang executable in these tests is > > called `llvm` on the Fuchsia bots? > > We enable the > [`LLVM_TOOL_LLVM_DRIVER_BUILD`](https://github.com/llvm/llvm-project/blob/48deb3568eb2452ff385b04b8f71c34121f47387/clang/cmake/caches/Fuchsia-

[clang] [clang][python] Don't add check-clang-python to check-all if cross-compiling (PR #111657)

2024-10-13 Thread Alex Bradbury via cfe-commits
@@ -47,6 +47,14 @@ if(${LLVM_NATIVE_ARCH} MATCHES "^(AArch64|Hexagon|Sparc|SystemZ)$") set(RUN_PYTHON_TESTS FALSE) endif() +# Tests will fail if cross-compiling for a different target, as tests will try +# to use the host Python3_EXECUTABLE and make FFI calls to functions i

[clang] [clang][python] Don't add check-clang-python to check-all if cross-compiling (PR #111657)

2024-10-13 Thread Alex Bradbury via cfe-commits
https://github.com/asb updated https://github.com/llvm/llvm-project/pull/111657 >From afd9488eb0b69c5375f7259a02581389c5003917 Mon Sep 17 00:00:00 2001 From: Alex Bradbury Date: Wed, 9 Oct 2024 11:09:44 +0100 Subject: [PATCH 1/4] [clang][python] Don't add check-clang-python to check-all if cros

[clang-tools-extra] [clang-tidy][readability-identifier-naming] Support namespace aliases (PR #112112)

2024-10-13 Thread via cfe-commits
EugeneZelenko wrote: I think change should be reflected in Release Notes. https://github.com/llvm/llvm-project/pull/112112 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][StackAddressEscape] Remove redundant "returned to caller" suffix for compound literal (PR #112135)

2024-10-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: None (z1nke) Changes This patch simplifies the diagnostic message in the core.StackAddrEscape for stack memory associated with compound literals by removing the redundant "returned to caller" suffix. Example: https://god

[clang] [analyzer][StackAddressEscape] Remove redundant "returned to caller" suffix for compound literal (PR #112135)

2024-10-13 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [analyzer][StackAddressEscape] Remove redundant "returned to caller" suffix for compound literal (PR #112135)

2024-10-13 Thread via cfe-commits
https://github.com/z1nke created https://github.com/llvm/llvm-project/pull/112135 This patch simplifies the diagnostic message in the core.StackAddrEscape for stack memory associated with compound literals by removing the redundant "returned to caller" suffix. Example: https://godbolt.org/z/Kx

[clang] [analyzer][StackAddressEscape] Remove redundant "returned to caller" for compound literal (PR #112134)

2024-10-13 Thread via cfe-commits
https://github.com/z1nke closed https://github.com/llvm/llvm-project/pull/112134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][StackAddressEscape] Remove redundant "returned to caller" for compound literal (PR #112134)

2024-10-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: None (z1nke) Changes This patch simplifies the diagnostic message in the core.StackAddrEscape for stack memory associated with compound literals by removing the redundant "*returned to caller*" suffix. Example: https://g

[clang] [analyzer][StackAddressEscape] Remove redundant "returned to caller" for compound literal (PR #112134)

2024-10-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (z1nke) Changes This patch simplifies the diagnostic message in the core.StackAddrEscape for stack memory associated with compound literals by removing the redundant "*returned to caller*" suffix. Example: https://godbolt.org/z/KxM67

[clang] [analyzer][StackAddressEscape] Remove redundant "returned to caller" for compound literal (PR #112134)

2024-10-13 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [analyzer][StackAddressEscape] Remove redundant "returned to caller" for compound literal (PR #112134)

2024-10-13 Thread via cfe-commits
https://github.com/z1nke created https://github.com/llvm/llvm-project/pull/112134 This patch simplifies the diagnostic message in the core.StackAddrEscape for stack memory associated with compound literals by removing the redundant "*returned to caller*" suffix. Example: https://godbolt.org/z/

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-13 Thread Rahul Joshi via cfe-commits
jurahul wrote: Thanks. So it seems we have 2 ways forwards: 1. Add back getDeclaration, marked deprecated, and then delete it in say 2-3 weeks, and then reintroduce it with different semantics 6 months down the road. Meanwhile, add findDeclaration as an alias, start using it, and then 6 months d

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-13 Thread Nikita Popov via cfe-commits
nikic wrote: To reuse the name with different semantics, I'd put removal and reuse in different releases, so it takes about half a year. (Deprecation itself can be very short-lived.) https://github.com/llvm/llvm-project/pull/111752 ___ cfe-commits ma

[clang] [clang] Mark `__builtin_convertvector` and `__builtin_shufflevector` as `constexpr`. (PR #112129)

2024-10-13 Thread via cfe-commits
https://github.com/c8ef edited https://github.com/llvm/llvm-project/pull/112129 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-13 Thread Byoungchan Lee via cfe-commits
@@ -49,12 +49,15 @@ int x = foo(); //RUN: FileCheck --match-full-lines --check-prefix=EDIT2 %s < %t.cpp // EDIT2-NOT: {{^}}#include "foo.h"{{$}} +// This test has commands that rely on shell capabilities that won't execute +// correctly on Windows e.g. subshell execut

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-13 Thread Byoungchan Lee via cfe-commits
@@ -48,3 +48,13 @@ int x = foo(); //RUN: clang-include-cleaner -edit --ignore-headers="foobar\.h,foo\.h" %t.cpp -- -I%S/Inputs/ //RUN: FileCheck --match-full-lines --check-prefix=EDIT2 %s < %t.cpp // EDIT2-NOT: {{^}}#include "foo.h"{{$}} + +//RUN: mkd

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-13 Thread Byoungchan Lee via cfe-commits
@@ -305,8 +307,84 @@ int main(int argc, const char **argv) { } } - clang::tooling::ClangTool Tool(OptionsParser->getCompilations(), - OptionsParser->getSourcePathList()); + auto VFS = llvm::vfs::getRealFileSystem(); + auto &CDB = Option

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-13 Thread Byoungchan Lee via cfe-commits
@@ -305,8 +307,84 @@ int main(int argc, const char **argv) { } } - clang::tooling::ClangTool Tool(OptionsParser->getCompilations(), - OptionsParser->getSourcePathList()); + auto VFS = llvm::vfs::getRealFileSystem(); + auto &CDB = Option

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-13 Thread Byoungchan Lee via cfe-commits
@@ -305,8 +307,84 @@ int main(int argc, const char **argv) { } } - clang::tooling::ClangTool Tool(OptionsParser->getCompilations(), - OptionsParser->getSourcePathList()); + auto VFS = llvm::vfs::getRealFileSystem(); + auto &CDB = Option

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-13 Thread Byoungchan Lee via cfe-commits
@@ -305,8 +307,84 @@ int main(int argc, const char **argv) { } } - clang::tooling::ClangTool Tool(OptionsParser->getCompilations(), - OptionsParser->getSourcePathList()); + auto VFS = llvm::vfs::getRealFileSystem(); + auto &CDB = Option

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-13 Thread Byoungchan Lee via cfe-commits
@@ -305,8 +307,84 @@ int main(int argc, const char **argv) { } } - clang::tooling::ClangTool Tool(OptionsParser->getCompilations(), - OptionsParser->getSourcePathList()); + auto VFS = llvm::vfs::getRealFileSystem(); + auto &CDB = Option

  1   2   >