[clang] [Clang] Check PP presence when printing stats (PR #131608)

2025-03-29 Thread Fangrui Song via cfe-commits
MaskRay wrote: LGTM! Thanks for the fix https://github.com/llvm/llvm-project/pull/131608 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-29 Thread Oliver Hunt via cfe-commits
@@ -1829,10 +1829,18 @@ class DeclContext { // refers to an enclosing template for hte purposes of [temp.friend]p9. LLVM_PREFERRED_TYPE(bool) uint64_t FriendConstraintRefersToEnclosingTemplate : 1; + +// Indicates this function is type aware operator new or dele

[clang] Disable alias template CTAD for C++17 (PR #133597)

2025-03-29 Thread via cfe-commits
GeorgeKA wrote: Gotcha. Thanks for the feedback. I'll comment in the issue. https://github.com/llvm/llvm-project/pull/133597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Basic] Use SmallSet::insert_range (NFC) (PR #133594)

2025-03-29 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/133594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format]: Add `StaticInlineOnly` and `StaticInline` options to `ShortFunctionStyle` (PR #133598)

2025-03-29 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] [Basic] Use SmallSet::insert_range (NFC) (PR #133594)

2025-03-29 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-arm-ubuntu` running on `linaro-lldb-arm-ubuntu` while building `clang` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/13707 Here is the relevant piece of the build lo

[clang] 0cd8232 - Fix some typos (NFC) (#133558)

2025-03-29 Thread via cfe-commits
Author: Qinkun Bao Date: 2025-03-29T20:54:15+01:00 New Revision: 0cd82327ff71282b2bfc51090074a3fd63e4842d URL: https://github.com/llvm/llvm-project/commit/0cd82327ff71282b2bfc51090074a3fd63e4842d DIFF: https://github.com/llvm/llvm-project/commit/0cd82327ff71282b2bfc51090074a3fd63e4842d.diff LO

[clang] Disable alias template CTAD for C++17 (PR #133597)

2025-03-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: It is generally ok, we only do not allow it when that would cause some significant backwards compatibility issues. https://github.com/llvm/llvm-project/pull/133597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang-tools-extra] [clang-tidy] Fix broken HeaderFilterRegex when read from config file (PR #133582)

2025-03-29 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/133582 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Disable alias template CTAD for C++17 (PR #133597)

2025-03-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: We do tend to offer newer features into older standards when that isn't a burden, as long as we have a warning advertising the incompatibility with the current standard, as we do. What is the motivation for this change? https://github.com/llvm/llvm-proje

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-29 Thread Oliver Hunt via cfe-commits
@@ -3134,6 +3134,31 @@ bool Type::isStdByteType() const { return false; } +bool Type::isDestroyingDeleteT() const { + auto *RD = getAsCXXRecordDecl(); + return RD && RD->isInStdNamespace() && RD->getIdentifier() && + RD->getIdentifier()->isStr("destroying_delete_t"

[clang] [Basic] Use SmallSet::insert_range (NFC) (PR #133594)

2025-03-29 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-aarch64-ubuntu` running on `linaro-lldb-aarch64-ubuntu` while building `clang` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/15138 Here is the relevant piece of the

[clang] [clang] implement common-sugar for adjusted member-pointers (PR #133613)

2025-03-29 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-aarch64-sve-vls` running on `linaro-g3-03` while building `clang` at step 7 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/143/builds/6546 Here is the relevant piece of the bui

[clang] [Clang][Cmake] fix libtool duplicate member name warnings (PR #133619)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Farzon Lotfi (farzonl) Changes fixes #133199 PR #132252 Created a second file that shared `.cpp` in `clang/lib/CodeGen/CMakeLists.txt` For example There were two `AMDGPU.cpp`'s one in `TargetBuiltins` and the other

[clang] [Clang][Cmake] fix libtool duplicate member name warnings (PR #133619)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Farzon Lotfi (farzonl) Changes fixes #133199 PR #132252 Created a second file that shared `.cpp` in `clang/lib/CodeGen/CMakeLists.txt` For example There were two `AMDGPU.cpp`'s one in `TargetBuiltins` and the other

[clang] [Clang][Cmake] fix libtool duplicate member name warnings (PR #133619)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Farzon Lotfi (farzonl) Changes fixes #133199 PR #132252 Created a second file that shared `.cpp` in `clang/lib/CodeGen/CMakeLists.txt` For example There were two `AMDGPU.cpp`'s one in `TargetBuiltins` and the other in `Targ

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-29 Thread Shafik Yaghmour via cfe-commits
@@ -1886,8 +1891,9 @@ TEST_F(StructuralEquivalenceCacheTest, VarDeclWithDifferentStorageClassNoEq) { Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::D

[clang] [flang] [flang] Expose -m64 option (PR #132409)

2025-03-29 Thread Daniel Chen via cfe-commits
DanielCChen wrote: @JDPailleux @kiranchandramohan We are planning to add support for flang to compile 32-bit application as well as building 32-bit flang-rt on AIX. The first thing would be to enable `-m32` for flang in the driver. I saw Kiran's comment. Would it be possible to make `-m32` av

[clang] [llvm] [PowerPC] Enable indiviual crbits tracking at -O2 (PR #133617)

2025-03-29 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 HEAD~1 HEAD --extensions cpp,h -- clang/lib/Basic/Targets/PPC.cpp llvm/lib/Target/Pow

[clang] [clang] implement common-sugar for adjusted member-pointers (PR #133613)

2025-03-29 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. https://github.com/llvm/llvm-project/pull/133613 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] implement common-sugar for adjusted member-pointers (PR #133613)

2025-03-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/133613 This implements a missing case for an adjusted member-pointer in getCommonSugaredType, when that was originally implemented here: https://github.com/llvm/llvm-project/pull/130537 This missing case could other

[clang] [llvm] [Clang] [OpenMP] Support NOWAIT with optional argument (PR #128742)

2025-03-29 Thread via cfe-commits
https://github.com/jadhbeika updated https://github.com/llvm/llvm-project/pull/128742 >From fa3dd1423e4bf2209feb9713f1833e653ec43a74 Mon Sep 17 00:00:00 2001 From: Jad Hbeika Date: Wed, 19 Feb 2025 12:53:11 -0800 Subject: [PATCH 1/3] [Clang] [OpenMP] Support NOWAIT with optional argument ---

[clang-tools-extra] [clang-tidy][NFC][doc] improve "options" sections of `bugprone-` and `modernize-` checks (PR #133525)

2025-03-29 Thread Baranov Victor via cfe-commits
@@ -53,4 +53,4 @@ Options If set to non-zero, the check does not suggest edits that will transform vbvictor wrote: yes, thanks for the notice https://github.com/llvm/llvm-project/pull/133525 ___ cfe-commits maili

[clang] Reland [HIP] fix host min/max in header (PR #133590)

2025-03-29 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/133590 >From 3f533ad3a54b199e96a14e91f01b9714c30f52c2 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Sun, 25 Feb 2024 11:13:40 -0500 Subject: [PATCH] [HIP] fix host min/max in header CUDA defines min/max func

[clang] [Basic] Use SmallSet::insert_range (NFC) (PR #133594)

2025-03-29 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-aarch64-sve2-vla-2stage` running on `linaro-g4-02` while building `clang` at step 12 "ninja check 2". Full details are available at: https://lab.llvm.org/buildbot/#/builders/199/builds/2460 Here is the relevant piece

[clang] Disable alias template CTAD for C++17 (PR #133597)

2025-03-29 Thread via cfe-commits
cor3ntin wrote: I think the issue here is that there is no extension warning in C++17. There should probably be one. Search for `ExtWarn` in DiagnosticSemaKinds.td and how these `ext_` diagnostics are used https://github.com/llvm/llvm-project/pull/133597

[clang] [WebKit checkers] Treat Objective-C message send return value as safe (PR #133605)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ryosuke Niwa (rniwa) Changes Objective-C selectors are supposed to return autoreleased object. Treat these return values as safe. --- Full diff: https://github.com/llvm/llvm-project/pull/133605.diff 6 Files Affected: - (modified) clan

[clang] cuda clang: Add support for CUDA surfaces (PR #132883)

2025-03-29 Thread Austin Schuh via cfe-commits
AustinSchuh wrote: > If the header is compileable without CUDA SDK (maybe with some stub headers > in tests Inputs), then a source file with a lot of builtin calls and > [autogenerated > checks](https://github.com/llvm/llvm-project/blob/d724bab8064685c98cdded88157b6e2245e0d7bc/llvm/utils/updat

[clang] [clang-tools-extra] [libcxx] [clang] improved preservation of template keyword (PR #133610)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Matheus Izvekov (mizvekov) Changes This makes it so clang can better represent the abscence of the template keyword for a template which cannot be resolved due to a dependent prefix. The tracking of the template keyword is removed

[clang] [clang-tools-extra] [libcxx] [clang] improved preservation of template keyword (PR #133610)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-libcxx Author: Matheus Izvekov (mizvekov) Changes This makes it so clang can better represent the abscence of the template keyword for a template which cannot be resolved due to a dependent prefix. The tracking of the template keyword is removed from t

[clang] [clang-tools-extra] [libcxx] [clang] improved preservation of template keyword (PR #133610)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-coroutines Author: Matheus Izvekov (mizvekov) Changes This makes it so clang can better represent the abscence of the template keyword for a template which cannot be resolved due to a dependent prefix. The tracking of the template keyword is removed fr

[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @alexfh should be fixed by https://github.com/llvm/llvm-project/pull/133613 https://github.com/llvm/llvm-project/pull/132401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [clang-format]: Add `StaticInlineOnly` and `StaticInline` options to `ShortFunctionStyle` (PR #133598)

2025-03-29 Thread via cfe-commits
@@ -15120,6 +15120,85 @@ TEST_F(FormatTest, PullInlineFunctionDefinitionsIntoSingleLine) { MergeInlineOnly); } +TEST_F(FormatTest, PullStaticInlineFunctionDefinitionsIntoSingleLine) { + FormatStyle MergeStaticInlineOnly = getLLVMStyle(); + MergeStaticInlineOn

[clang] [clang-format]: Add `StaticInlineOnly` and `StaticInline` options to `ShortFunctionStyle` (PR #133598)

2025-03-29 Thread via cfe-commits
@@ -335,6 +336,32 @@ class LineJoiner { } } + if (Style.AllowShortFunctionsOnASingleLine == + FormatStyle::SFS_StaticInlineOnly || + Style.AllowShortFunctionsOnASingleLine == + FormatStyle::SFS_StaticInline) { +// C

[clang] [clang-format]: Add `StaticInlineOnly` and `StaticInline` options to `ShortFunctionStyle` (PR #133598)

2025-03-29 Thread via cfe-commits
@@ -15120,6 +15120,85 @@ TEST_F(FormatTest, PullInlineFunctionDefinitionsIntoSingleLine) { MergeInlineOnly); } +TEST_F(FormatTest, PullStaticInlineFunctionDefinitionsIntoSingleLine) { + FormatStyle MergeStaticInlineOnly = getLLVMStyle(); + MergeStaticInlineOn

[clang] [clang-format]: Add `StaticInlineOnly` and `StaticInline` options to `ShortFunctionStyle` (PR #133598)

2025-03-29 Thread via cfe-commits
@@ -863,6 +870,12 @@ struct FormatStyle { /// void f() {} /// \endcode SFS_Inline, +/// Only merge functions defined as static inline. Implies ``empty``. irymarchyk wrote: Thanks, fixed. Now it mention that empty function also merged. https:

[clang] [clang-format]: Add `StaticInlineOnly` and `StaticInline` options to `ShortFunctionStyle` (PR #133598)

2025-03-29 Thread via cfe-commits
@@ -335,6 +336,32 @@ class LineJoiner { } } + if (Style.AllowShortFunctionsOnASingleLine == + FormatStyle::SFS_StaticInlineOnly || + Style.AllowShortFunctionsOnASingleLine == + FormatStyle::SFS_StaticInline) { +// C

[clang] [clang] implement common-sugar for adjusted member-pointers (PR #133613)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Matheus Izvekov (mizvekov) Changes This implements a missing case for an adjusted member-pointer in getCommonSugaredType, when that was originally implemented here: https://github.com/llvm/llvm-project/pull/130537 This missing case could

[clang] [Driver] Add linker options to support statical linking to shared flang-rt on AIX. (PR #131822)

2025-03-29 Thread Hubert Tong via cfe-commits
@@ -127,9 +127,19 @@ void aix::Linker::ConstructJob(Compilation &C, const JobAction &JA, } // Force static linking when "-static" is present. - if (Args.hasArg(options::OPT_static)) + if (Args.hasArg(options::OPT_static)) { CmdArgs.push_back("-bnso"); +if (D.

[clang] Disable alias template CTAD for C++17 (PR #133597)

2025-03-29 Thread Matheus Izvekov via cfe-commits
@@ -9895,26 +9895,30 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (!Template) { if (auto *AliasTemplate = dyn_cast_or_null( TemplateName.getAsTemplateDecl())) { - Diag(Kind.getLocation(), - diag::warn_cxx17_compat_ctad_for_

[clang] Disable alias template CTAD for C++17 (PR #133597)

2025-03-29 Thread Matheus Izvekov via cfe-commits
@@ -113,7 +113,7 @@ namespace dependent { }; template void f() { typename T::X tx = 0; -typename T::Y ty = 0; +typename T::template Y ty = 0; mizvekov wrote: This is just removing the test. Ideally this would still be tested under C++20. https

[clang] [clang-format]: Add `StaticInlineOnly` and `StaticInline` options to `ShortFunctionStyle` (PR #133598)

2025-03-29 Thread Björn Schäpers via cfe-commits
@@ -15120,6 +15120,85 @@ TEST_F(FormatTest, PullInlineFunctionDefinitionsIntoSingleLine) { MergeInlineOnly); } +TEST_F(FormatTest, PullStaticInlineFunctionDefinitionsIntoSingleLine) { + FormatStyle MergeStaticInlineOnly = getLLVMStyle(); + MergeStaticInlineOn

[clang] [clang-format]: Add `StaticInlineOnly` and `StaticInline` options to `ShortFunctionStyle` (PR #133598)

2025-03-29 Thread via cfe-commits
https://github.com/irymarchyk updated https://github.com/llvm/llvm-project/pull/133598 >From cc9c8d79396b6be64910eda59c4f7bd1a1d0a839 Mon Sep 17 00:00:00 2001 From: Ivan Rymarchyk <> Date: Sat, 29 Mar 2025 13:54:32 -0700 Subject: [PATCH 1/2] [clang-format]: Add `StaticInlineOnly` and `StaticInli

[clang] [alpha.webkit.RawPtrRefMemberChecker] The checker doesn't warn Objective-C types in ivars. (PR #132833)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Ryosuke Niwa (rniwa) Changes This PR fixes the bug that we weren't generating warnings when a raw poiner is used to point to a NS type in Objective-C ivars. Also fix the bug that we weren't suppressing this warning in sy

[clang] [clang] implement common-sugar for adjusted member-pointers (PR #133613)

2025-03-29 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-aarch64-sve-vls-2stage` running on `linaro-g3-02` while building `clang` at step 12 "ninja check 2". Full details are available at: https://lab.llvm.org/buildbot/#/builders/4/builds/5936 Here is the relevant piece of

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-29 Thread Oliver Hunt via cfe-commits
@@ -9784,10 +9850,16 @@ bool Sema::ShouldDeleteSpecialMember(CXXMethodDecl *MD, //results in an ambiguity or in a function that is deleted or inaccessible if (CSM == CXXSpecialMemberKind::Destructor && MD->isVirtual()) { FunctionDecl *OperatorDelete = nullptr; +

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-29 Thread Oliver Hunt via cfe-commits
@@ -16147,6 +16169,108 @@ bool Sema::CompleteConstructorCall(CXXConstructorDecl *Constructor, return Invalid; } +bool Sema::isTypeAwareOperatorNewOrDelete(const NamedDecl *ND) const { + const FunctionDecl *FnDecl = nullptr; + if (auto *FTD = dyn_cast(ND)) +FnDecl = FT

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-29 Thread Oliver Hunt via cfe-commits
@@ -1110,9 +1138,10 @@ static bool findDeleteForPromise(Sema &S, SourceLocation Loc, QualType PromiseTy // The deallocation function's name is looked up by searching for it in the // scope of the promise type. If nothing is found, a search is performed in // the global s

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-29 Thread Oliver Hunt via cfe-commits
@@ -307,6 +307,10 @@ EXTENSION(datasizeof, LangOpts.CPlusPlus) FEATURE(cxx_abi_relative_vtable, LangOpts.CPlusPlus && LangOpts.RelativeCXXABIVTables) +// Type aware allocators +FEATURE(cxx_type_aware_allocators, LangOpts.TypeAwareAllocators) ojhunt wrote: R

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-29 Thread Oliver Hunt via cfe-commits
@@ -477,6 +477,44 @@ class DeclarationName { return OO_None; } + bool isOperatorNew() const { +if (getNameKind() != DeclarationName::CXXOperatorName) + return false; +switch (getCXXOverloadedOperator()) { +case OO_New: +case OO_Array_New: + ret

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-29 Thread Oliver Hunt via cfe-commits
@@ -3128,6 +3128,26 @@ bool Type::isStdByteType() const { return false; } +static const TemplateDecl *getSpecializedTemplateType(const Type *T) { + const Type *DesugaredType = T->getUnqualifiedDesugaredType(); + if (const auto *Specialization = + DesugaredType->ge

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-29 Thread Oliver Hunt via cfe-commits
@@ -0,0 +1,145 @@ +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fcoroutines -fexceptions -Wall -Wpedantic + + +#include "Inputs/std-coroutine.h" + +namespace std { + template struct type_identity { + typedef T type; + }; + typedef __

[clang] [clang] Clear `NeedsCleaning` flag after `ExpandBuiltinMacro` (PR #133574)

2025-03-29 Thread via cfe-commits
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Discourse](https://discourse.llvm.org/t/hidden-email

[clang] [lld] Add the type to target_link_libraries (PR #133596)

2025-03-29 Thread Theo Paris via cfe-commits
https://github.com/theoparis created https://github.com/llvm/llvm-project/pull/133596 This fixes building with LLVM_TOOL_LLVM_DRIVER_BUILD and LLVM_LINK_LLVM_DYLIB set to true. CMake requires that "all uses of target_link_libraries with a target must be either all-keyword or all-plain". >Fro

[clang] [lld] Add the type to target_link_libraries (PR #133596)

2025-03-29 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] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-29 Thread Oliver Hunt via cfe-commits
@@ -16298,6 +16396,70 @@ bool Sema::CompleteConstructorCall(CXXConstructorDecl *Constructor, return Invalid; } +bool Sema::isTypeAwareOperatorNewOrDelete(const NamedDecl *ND) const { + const FunctionDecl *FnDecl = nullptr; + if (auto *FTD = dyn_cast(ND)) +FnDecl = FTD

[clang-tools-extra] [clang-tidy][NFC][doc] improve "options" sections of `bugprone-` and `modernize-` checks (PR #133525)

2025-03-29 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/133525 >From 9b88fc69e06d08fd06b60af24b5a9c12749185ef Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sat, 29 Mar 2025 00:46:22 +0300 Subject: [PATCH 1/2] improve docs options of `bugprone-` and `modernize-` chec

[clang] [clang-format] Add an option for editing enum trailing commas (PR #133576)

2025-03-29 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/133576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add range metadata for atomic load of boolean type. #131476 (PR #133546)

2025-03-29 Thread Jan Górski via cfe-commits
https://github.com/janagor created https://github.com/llvm/llvm-project/pull/133546 Addresses #131476. For `x86_64` it folds ``` movzbl t1(%rip), %eax andb$1, %al ``` into ``` movzbl t1(%rip), %eax ``` when run: `clang -S atomic-ops-load.c -o atomic-ops-load.s -O1 --target=x86_64`. But f

[clang] [CIR][Upstream] Local initialization for ArrayType (PR #132974)

2025-03-29 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/132974 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Modules] Fix the Size of `RecordDecl`'s `BitCodeAbbrevOp` (PR #133500)

2025-03-29 Thread via cfe-commits
https://github.com/higher-performance approved this pull request. Thank you for spotting & fixing this! Approving, but I'm also quite unfamiliar with these so please wait for another approval. https://github.com/llvm/llvm-project/pull/133500 ___ cfe-c

[clang] [Clang] Ensure the instantiation of array initializers for decltype/_typeof operator (PR #133575)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Younan Zhang (zyn0217) Changes This is a follow-up to a9672515ce, per Richard's suggestion we should ensure the instantiation for these unevaluated operators as well. No release entry because the issue being fixed was already claimed reso

[clang] [clang-format] Add an option for editing enum trailing commas (PR #133576)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/133576.diff 6 Files Affected: - (modified) clang/docs/ClangFormatStyleOptions.rst (+34) - (modified) clang/docs/ReleaseNotes.rst (+2) - (modifi

[clang] [clang-format] Add an option for editing enum trailing commas (PR #133576)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Owen Pan (owenca) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/133576.diff 6 Files Affected: - (modified) clang/docs/ClangFormatStyleOptions.rst (+34) - (modified) clang/docs/ReleaseNotes.rst (+2) - (modified) cla

[clang] [clang-format] Add an option for editing enum trailing commas (PR #133576)

2025-03-29 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/133576 None >From 3b352123c47cb382539fefc1bcd49228c17d994f Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 29 Mar 2025 00:30:49 -0700 Subject: [PATCH] [clang-format] Add an option for editing enum trailing commas -

[clang] [Clang] Ensure the instantiation of array initializers for decltype/_typeof operator (PR #133575)

2025-03-29 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > I find myself wanting a `RequireCompleteType` (or just `CompletesType` - > maybe with asserts that check that the resulting types is indeed complete) > overload that does not take a diagnostic. `getCompletedType` does not make it > clear what it does. And comments would help

[clang] [libcxx] [Clang] Add __builtin_common_reference (PR #121199)

2025-03-29 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/121199 >From 3010ba7ab5392394b37261807fc7cf4cbb205e0c Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 27 Sep 2024 22:11:14 +0200 Subject: [PATCH] [Clang] Add __builtin_common_reference --- clang/docs/Lan

[clang] [Clang] Ensure the instantiation of array initializers for decltype/_typeof operator (PR #133575)

2025-03-29 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/133575 >From 1100d56138a09a850aed4857ee69bffcff10fc6d Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 29 Mar 2025 16:42:12 +0800 Subject: [PATCH 1/2] [Clang] Ensure the instantiation of array initializers for d

[clang] Add range metadata for atomic load of boolean type. #131476 (PR #133546)

2025-03-29 Thread Jan Górski via cfe-commits
https://github.com/janagor edited https://github.com/llvm/llvm-project/pull/133546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-29 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes requested changes to this pull request. Looks reasonable to add vector support later for shifts. Because `SelectOp` is independent of `ShiftOp`, one possibility would have been to split it in two PRs to land them faster, but wouldn't bother changing for this rou

[clang] [flang] [libcxx] [llvm] [llvm-reduce]: print short form, actionable names in the log (PR #132813)

2025-03-29 Thread Matt Arsenault via cfe-commits
arsenm wrote: Replaced with new PR https://github.com/llvm/llvm-project/pull/132813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-29 Thread Martin Uecker via cfe-commits
uecker wrote: > I now see there's two different parts of the problem to worry about: > > First case: A redeclaration in a _different_ scope. This always defines a new > distinct type. This was valid before C23, and is still valid regardless of > whether the type is compatible. (In contrast wit

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-29 Thread David Rivera via cfe-commits
RiverDave wrote: Ping https://github.com/llvm/llvm-project/pull/129370 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] detect arithmetic operations within member list initialization in modernize-use-default-member-init check (PR #129370)

2025-03-29 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/129370 >From 82951dab6d1b834a5b296faddcf23603f3f05e84 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Sat, 1 Mar 2025 02:09:02 -0500 Subject: [PATCH] [clang-tidy] detect arithmetic operations within member list in

[clang] [clang-format] Handle C++ keywords in other languages better (PR #132941)

2025-03-29 Thread Owen Pan via cfe-commits
@@ -1369,6 +1374,7 @@ TEST_F(FormatTestJS, WrapRespectsAutomaticSemicolonInsertion) { getGoogleJSStyleWithColumns(10)); verifyFormat("await theReckoning;", getGoogleJSStyleWithColumns(10)); verifyFormat("some['a']['b']", getGoogleJSStyleWithColumns(10)); +

[clang] [clang-format] Handle C++ keywords in other languages better (PR #132941)

2025-03-29 Thread Owen Pan via cfe-commits
@@ -834,6 +834,11 @@ TEST_F(FormatTestJS, AsyncFunctions) { "}", "async function hello(myparamnameiswaytoolng) {}", getGoogleJSStyleWithColumns(10)); + verifyFormat("async function\n" + "union(\n" + "

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-03-29 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Clear `NeedsCleaning` flag after `ExpandBuiltinMacro` (PR #133574)

2025-03-29 Thread marius doerner via cfe-commits
https://github.com/mariusdr updated https://github.com/llvm/llvm-project/pull/133574 >From dd54aa59eabe9c3b7b110f46d82ff5c4d0b88c57 Mon Sep 17 00:00:00 2001 From: marius doerner Date: Sat, 29 Mar 2025 09:21:20 +0100 Subject: [PATCH] [clang] Clear `NeedsCleaning` flag after `ExpandBuiltinMacro`

[clang] [OpenMP 6.0] Parse/Sema support for reduction over private variable with reduction clause. (PR #129938)

2025-03-29 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev edited https://github.com/llvm/llvm-project/pull/129938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix some typos under clang (NFC) (PR #133558)

2025-03-29 Thread via cfe-commits
@@ -61,7 +61,7 @@ void addCXXDeallocatorChecker(AnalysisASTConsumer &AnalysisConsumer, } // TODO: What we should really be testing here is all the different varieties -// of delete operators, and wether the retrieval of their arguments works as +// of delete operators, and we

[clang] [clang] Clear `NeedsCleaning` flag after `ExpandBuiltinMacro` (PR #133574)

2025-03-29 Thread marius doerner via cfe-commits
https://github.com/mariusdr created https://github.com/llvm/llvm-project/pull/133574 After builtin macro expansion in `Preprocessor::ExpandBuiltinMacro` the result token may have the `Token::NeedsCleaning` flag set which causes an assertion failure later on when the lexer retrieves the spellin

[clang] [clang] Clear `NeedsCleaning` flag after `ExpandBuiltinMacro` (PR #133574)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: marius doerner (mariusdr) Changes After builtin macro expansion in `Preprocessor::ExpandBuiltinMacro` the result token may have the `Token::NeedsCleaning` flag set which causes an assertion failure later on when the lexer retrieves the sp

[clang] [Clang] Ensure the instantiation of array initializers for decltype/_typeof operator (PR #133575)

2025-03-29 Thread via cfe-commits
cor3ntin wrote: I find myself wanting a `RequireCompleteType` (or just `CompletesType` - maybe with asserts that check that the resulting types is indeed complete) overload that does not take a diagnostic. `getCompletedType` does not make it clear what it does. And comments would help https:/

[clang] Fix some typos under clang (NFC) (PR #133558)

2025-03-29 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/133558 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SROA] Vector promote some memsets (PR #133301)

2025-03-29 Thread via cfe-commits
https://github.com/macurtis-amd updated https://github.com/llvm/llvm-project/pull/133301 >From c0525fd7bd2c740b5b969e8e2913a878792a377c Mon Sep 17 00:00:00 2001 From: Matthew Curtis Date: Thu, 27 Mar 2025 14:04:40 -0500 Subject: [PATCH 1/2] [SROA] Vector promote some memsets --- clang/test/Co

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes Alloca operations were being emitted into the entry block of the current function unconditionally, even if the variable they represented was declared in a different scope. This change upstreams the code for

[clang] [NFC][analyzer] Fix typo in VirtualCall checker docs (PR #133593)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (Alcaro) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/133593.diff 1 Files Affected: - (modified) clang/docs/analyzer/checkers.rst (+2-2) ``diff diff --git a/clang/docs/analyzer/checkers.rst b/clang/d

[clang] [NFC][analyzer] Fix typo in VirtualCall checker docs (PR #133593)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: None (Alcaro) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/133593.diff 1 Files Affected: - (modified) clang/docs/analyzer/checkers.rst (+2-2) ``diff diff --git a/clang/docs/analyzer/chec

[clang] [NFC][analyzer] Fix typo in VirtualCall checker docs (PR #133593)

2025-03-29 Thread via cfe-commits
https://github.com/Alcaro created https://github.com/llvm/llvm-project/pull/133593 None >From e8036df84bf7ea8d544814ca52dc963c036a1e69 Mon Sep 17 00:00:00 2001 From: Alcaro Date: Sat, 29 Mar 2025 20:24:00 +0100 Subject: [PATCH] [NFC][analyzer] Fix typo in VirtualCall checker docs --- clang/d

[clang-tools-extra] 884b19a - [clang-tools-extra] Use *Set::insert_range (NFC) (#133589)

2025-03-29 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-03-29T12:22:13-07:00 New Revision: 884b19ab40c8b6e5d1fb54894c0418fd27bb93f9 URL: https://github.com/llvm/llvm-project/commit/884b19ab40c8b6e5d1fb54894c0418fd27bb93f9 DIFF: https://github.com/llvm/llvm-project/commit/884b19ab40c8b6e5d1fb54894c0418fd27bb93f9.diff L

[clang] [HIP] Claim `--offload-compress` for `-M` (PR #133456)

2025-03-29 Thread Fangrui Song via cfe-commits
@@ -242,3 +242,9 @@ // NO-WARN-ATOMIC: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-Werror=atomic-alignment" {{.*}} "-Wno-error=atomic-alignment" // NO-WARN-ATOMIC-NOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-Werror=atomic-alignment" // NO-WARN-ATOMIC-

[clang] [Basic] Use SmallSet::insert_range (NFC) (PR #133594)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/133594.diff 1 Files Affected: - (modified) clang/include/clang/Basic/TargetInfo.h (+1-2) ``diff diff --git a/clang/include/clang/B

[clang] [Basic] Use SmallSet::insert_range (NFC) (PR #133594)

2025-03-29 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/133594 None >From 379db5ff7e08973d2e5a6c08de1a475ce84313f5 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 29 Mar 2025 12:23:18 -0700 Subject: [PATCH] [Basic] Use SmallSet::insert_range (NFC) --- clang/

[clang] [Driver] Add linker options to support statical linking to shared flang-rt on AIX. (PR #131822)

2025-03-29 Thread Daniel Chen via cfe-commits
@@ -127,9 +127,19 @@ void aix::Linker::ConstructJob(Compilation &C, const JobAction &JA, } DanielCChen wrote: Thanks for the comment! Yes. I will add test. https://github.com/llvm/llvm-project/pull/131822 ___ cfe-c

[clang] Fix some typos under clang (NFC) (PR #133558)

2025-03-29 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/133558 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-29 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-flang-driver Author: Paul Osmialowski (pawosm-arm) Changes Although combining -fveclib=ArmPL with -nostdlib is a rare situation, it should still be supported correctly and should effect in avoidance of linking against libm. --- Full diff: https://git

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-29 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: Seriously, this is something CI people signaled to me. Our CI builds everything with `-fveclib=ArmPL` and one of the packages failed on unexpected linker behavior when libm was artificially added by `-fveclib=ArmPL` despite the `-nostdlib` flag being used. My suggestion to us

[clang] [llvm] [SROA] Vector promote some memsets (PR #133301)

2025-03-29 Thread via cfe-commits
macurtis-amd wrote: > Missing new tests? I'd expect to see a few new targeted tests stressing > different vector sizes and alignments, and not just updates of existing tests Added a new test. Thanks for the review! https://github.com/llvm/llvm-project/pull/133301 _

[clang] [llvm] [SROA] Vector promote some memsets (PR #133301)

2025-03-29 Thread via cfe-commits
@@ -1170,10 +1191,23 @@ class AllocaSlices::SliceBuilder : public PtrUseVisitor { if (!IsOffsetKnown) return PI.setAborted(&II); +auto IsSplittable = [&]() { + FixedVectorType *VTy = getVectorTypeFor(II, DL); + Type *ATy = AS.AI.getAllocatedType(); + +

[clang] [llvm] [SROA] Vector promote some memsets (PR #133301)

2025-03-29 Thread via cfe-commits
@@ -2316,12 +2362,15 @@ static VectorType *isVectorPromotionViable(Partition &P, const DataLayout &DL) { // Put load and store types into a set for de-duplication. for (const Slice &S : P) { -Type *Ty; +Type *Ty = nullptr; if (auto *LI = dyn_cast(S.getUse()->

  1   2   >