[clang] [clang][bytecode] Refactor Program::createGlobalString (PR #125467)

2025-02-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/125467 Remove unnecesary narrow() calls, rename a variable and initialize the array as a whole instead of each element individually. >From 20c472b39e94f51ed383a265f6c836f2b3276c50 Mon Sep 17 00:00:00 2001 From: =?UTF

[clang] c475356 - [clang][bytecode][NFC] Only call getSource() when necessary (#125419)

2025-02-02 Thread via cfe-commits
Author: Timm Baeder Date: 2025-02-03T08:51:30+01:00 New Revision: c475356603cd33ead378a9db00b7e579c9da366e URL: https://github.com/llvm/llvm-project/commit/c475356603cd33ead378a9db00b7e579c9da366e DIFF: https://github.com/llvm/llvm-project/commit/c475356603cd33ead378a9db00b7e579c9da366e.diff L

[clang] [clang][bytecode][NFC] Only call getSource() when necessary (PR #125419)

2025-02-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/125419 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpenMPToolChain. (PR #124754)

2025-02-02 Thread Amit Kumar Pandey via cfe-commits
https://github.com/ampandey-1995 updated https://github.com/llvm/llvm-project/pull/124754 >From 960eb5de4abcf21dec34e8932c94621733b9d11b Mon Sep 17 00:00:00 2001 From: Amit Pandey Date: Mon, 3 Feb 2025 10:57:17 +0530 Subject: [PATCH 1/4] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpe

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-02 Thread Richard Smith via cfe-commits
zygoloid wrote: Thank you for tackling this longstanding issue! How much does saving this extra state add to the runtime and memory usage on a template-heavy compilation? If the cost is concerning, one other option we could consider here would be performing pending local instantiations eagerly

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-02 Thread via cfe-commits
Sirraide wrote: > @Sirraide I did try it and the bug persists. The `LHS` is a RecoveryExpr, so > I am not sure how to approach that. Yeah, that one did look like the problem is probably elsewhere; thanks for trying though! https://github.com/llvm/llvm-project/pull/125394 _

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

2025-02-02 Thread Owen Anderson via cfe-commits
https://github.com/resistor updated https://github.com/llvm/llvm-project/pull/125448 >From 8d2ed55358510e45c03934aaaffccbf12d0bffce Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Mon, 3 Feb 2025 15:41:20 +1300 Subject: [PATCH] [clang] Do not emit template parameter objects as COMDATs when

[clang] [compiler-rt] [profile] Add `%b` `LLVM_PROFILE_FILE` option for binary ID (PR #123963)

2025-02-02 Thread Sinkevich Artem via cfe-commits
ArtSin wrote: PTAL @ZequanWu @david-xl https://github.com/llvm/llvm-project/pull/123963 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

2025-02-02 Thread Owen Anderson via cfe-commits
https://github.com/resistor updated https://github.com/llvm/llvm-project/pull/125448 >From b3078fa4389f6be3f0b8c463ab9e79f1b4a9d23b Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Mon, 3 Feb 2025 15:41:20 +1300 Subject: [PATCH] [clang] Do not emit template parameter objects as COMDATs when

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-02 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

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

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

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

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-02 Thread via cfe-commits
cor3ntin wrote: @ricejasonf yeah... really not a fan but i played with it an i don't see a way to meaningfully improve it. Thanks for trying though https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpenMPToolChain. (PR #124754)

2025-02-02 Thread Amit Kumar Pandey via cfe-commits
https://github.com/ampandey-1995 updated https://github.com/llvm/llvm-project/pull/124754 >From 960eb5de4abcf21dec34e8932c94621733b9d11b Mon Sep 17 00:00:00 2001 From: Amit Pandey Date: Mon, 3 Feb 2025 10:57:17 +0530 Subject: [PATCH 1/4] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpe

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-02 Thread via cfe-commits
@@ -1909,7 +1909,19 @@ class Sema final : public SemaBase { /// '\#pragma clang attribute push' directives to the given declaration. void AddPragmaAttributes(Scope *S, Decl *D); - void PrintPragmaAttributeInstantiationPoint(); + using DiagFuncRef = cor3n

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-02 Thread via cfe-commits
@@ -1654,11 +1654,20 @@ void Sema::EmitDiagnostic(unsigned DiagID, const DiagnosticBuilder &DB) { } case DiagnosticIDs::SFINAE_Suppress: + if (DiagnosticsEngine::Level Level = getDiagnostics().getDiagnosticLevel( + DiagInfo.getID(), DiagInfo.getLocat

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-02 Thread via cfe-commits
@@ -1909,7 +1909,19 @@ class Sema final : public SemaBase { /// '\#pragma clang attribute push' directives to the given declaration. void AddPragmaAttributes(Scope *S, Decl *D); - void PrintPragmaAttributeInstantiationPoint(); + using DiagFuncRef = + llvm::function_

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Kazu Hirata via cfe-commits
kazutakahirata wrote: @steakhal I just tried this PR on the LLVM code base (that is, `llvm-project/llvm`). I'm impressed how many real issues it finds. Thank you so much! https://github.com/llvm/llvm-project/pull/125420 ___ cfe-commits mailing list

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125457)

2025-02-02 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/125457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125457)

2025-02-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Litera

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125457)

2025-02-02 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/125457 Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Literal migration

[clang] [CodeGen] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125456)

2025-02-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Litera

[clang] [CodeGen] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125456)

2025-02-02 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/125456 Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Literal migration

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,159 @@ +//===--- RedundantLookupCheck.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: Ap

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-02 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/125421 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

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

[clang] [compiler-rt] [Sanitizers] the access size (8 bytes) exceeds the max lock-free size (4 bytes) for 32-bit (PR #125388)

2025-02-02 Thread Wael Yehia via cfe-commits
@@ -338,6 +338,10 @@ void aix::Linker::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-lpthread"); } const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath()); + + if (Sanitize.hasAnySanitizer() && IsArch32Bit) { w2yehia

[clang] [compiler-rt] [Sanitizers] the access size (8 bytes) exceeds the max lock-free size (4 bytes) for 32-bit (PR #125388)

2025-02-02 Thread Wael Yehia via cfe-commits
@@ -239,6 +239,9 @@ append_list_if(SANITIZER_LIMIT_FRAME_SIZE -Wframe-larger-than=570 append_list_if(COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors SANITIZER_CFLAGS) +# Suppress -Watomic-alignment warnings by not treating them as errors ---

[clang] [llvm] [Hexagon] Set the default compilation target to V68 (PR #125239)

2025-02-02 Thread Brian Cain via cfe-commits
androm3da wrote: @iajbar can you add this change to the 21.0 release notes, since it's something that would impact users? https://github.com/llvm/llvm-project/pull/125239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [compiler-rt] [Sanitizers] the access size (8 bytes) exceeds the max lock-free size (4 bytes) for 32-bit (PR #125388)

2025-02-02 Thread Wael Yehia via cfe-commits
@@ -239,6 +239,9 @@ append_list_if(SANITIZER_LIMIT_FRAME_SIZE -Wframe-larger-than=570 append_list_if(COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors SANITIZER_CFLAGS) +# Suppress -Watomic-alignment warnings by not treating them as errors ---

[clang] [compiler-rt] [Sanitizers] the access size (8 bytes) exceeds the max lock-free size (4 bytes) for 32-bit (PR #125388)

2025-02-02 Thread Wael Yehia via cfe-commits
https://github.com/w2yehia edited https://github.com/llvm/llvm-project/pull/125388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

2025-02-02 Thread Owen Anderson via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -emit-llvm -std=c++20 -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s + +// COMDAT groups in ELF objects are not permitted to contain local symbols. While template parameter +// objects are normally emitted in COMDATs, we shouldn't do

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

2025-02-02 Thread Owen Anderson via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -emit-llvm -std=c++20 -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s resistor wrote: Done https://github.com/llvm/llvm-project/pull/125448 ___ cfe-commits mailing list cfe

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

2025-02-02 Thread Owen Anderson via cfe-commits
https://github.com/resistor updated https://github.com/llvm/llvm-project/pull/125448 >From fabd1f091d018e76d59777ce29a9d16ef6abb48f Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Mon, 3 Feb 2025 15:41:20 +1300 Subject: [PATCH] [clang] Do not emit template parameter objects as COMDATs when

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/125453 This patch makes it so the correct instantiation context is printed for diagnostics suppessed by template argument deduction. The context is saved along with the suppressed diagnostic, and when the declaratio

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Matheus Izvekov (mizvekov) Changes This patch makes it so the correct instantiation context is printed for diagnostics suppessed by template argument deduction. The context is saved along with the suppressed diagnostic, and when the decl

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

2025-02-02 Thread Owen Anderson via cfe-commits
@@ -3765,7 +3765,7 @@ ConstantAddress CodeGenModule::GetAddrOfTemplateParamObject( auto *GV = new llvm::GlobalVariable(getModule(), Init->getType(), /*isConstant=*/true, Linkage, Init, Name); setGVProperties(GV, TPO); - if (supportsC

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

2025-02-02 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -emit-llvm -std=c++20 -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s MaskRay wrote: Probably best to figure out where the primary test of the neighbor lines is and adds the extra test there. https://github.com/llvm

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

2025-02-02 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -emit-llvm -std=c++20 -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s + +// COMDAT groups in ELF objects are not permitted to contain local symbols. While template parameter +// objects are normally emitted in COMDATs, we shouldn't do

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

2025-02-02 Thread Fangrui Song via cfe-commits
@@ -3765,7 +3765,7 @@ ConstantAddress CodeGenModule::GetAddrOfTemplateParamObject( auto *GV = new llvm::GlobalVariable(getModule(), Init->getType(), /*isConstant=*/true, Linkage, Init, Name); setGVProperties(GV, TPO); - if (supportsC

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

2025-02-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Owen Anderson (resistor) Changes Per the ELF spec, section groups may only contain local symbols if those symbols are only referenced from within the section group. [1] In the case of template parameter objects, they can be referenced fro

[clang] [clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (PR #125448)

2025-02-02 Thread Owen Anderson via cfe-commits
https://github.com/resistor created https://github.com/llvm/llvm-project/pull/125448 Per the ELF spec, section groups may only contain local symbols if those symbols are only referenced from within the section group. [1] In the case of template parameter objects, they can be referenced from ou

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

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

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-02 Thread Matheus Izvekov via cfe-commits
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsLateTemplateParsed = ILT; } + bool isInstantiatedFromMemberTemplate() const { +return FunctionDeclBits.IsInstantiatedFromMemberTemplate; + } + void setInstantiatedFromMemberTempl

[clang] [clang-format] Hanlde qualified type name for `QualifierAlignment` (PR #125327)

2025-02-02 Thread Owen Pan via cfe-commits
@@ -412,6 +414,15 @@ const FormatToken *LeftRightQualifierAlignmentFixer::analyzeLeft( // The case `const long long volatile int` -> `const volatile long long int` // The case `long volatile long int const` -> `const volatile long long int` if (TypeToken->isTypeName(Lang

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-02 Thread Jason Rice via cfe-commits
ricejasonf wrote: @cor3ntin Sorry, I tried "Commit suggestion", but it didn't look like you can cast like that so I just reverted. https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-02 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf updated https://github.com/llvm/llvm-project/pull/125394 >From a323e058b2c8adf97f7f9a55a9187f74de9b8d17 Mon Sep 17 00:00:00 2001 From: Jason Rice Date: Sun, 2 Feb 2025 00:52:47 -0800 Subject: [PATCH 1/2] [Clang][P1061] Consolidate ResolvedUnexpandedPackExpr into F

[clang] [clang-format] Hanlde qualified type name for `QualifierAlignment` (PR #125327)

2025-02-02 Thread Owen Pan via cfe-commits
@@ -412,6 +414,15 @@ const FormatToken *LeftRightQualifierAlignmentFixer::analyzeLeft( // The case `const long long volatile int` -> `const volatile long long int` // The case `long volatile long int const` -> `const volatile long long int` if (TypeToken->isTypeName(Lang

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-02-02 Thread via cfe-commits
@@ -11220,6 +11220,333 @@ TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { Style); } +TEST_F(FormatTest, BreakBeforeTemplateCloser) { + FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp); + // Begin with tests covering the case where there is no constr

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-02-02 Thread via cfe-commits
https://github.com/leijurv updated https://github.com/llvm/llvm-project/pull/118046 >From 1caf823165b16f6701993d586df51d5cdbf0885e Mon Sep 17 00:00:00 2001 From: Leijurv Date: Fri, 29 Nov 2024 21:54:36 -0600 Subject: [PATCH 01/16] [clang-format] Add BreakBeforeTemplateClose option --- clang/d

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-02-02 Thread via cfe-commits
@@ -11220,6 +11220,333 @@ TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { Style); } +TEST_F(FormatTest, BreakBeforeTemplateCloser) { + FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp); + // Begin with tests covering the case where there is no constr

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-02-02 Thread Owen Pan via cfe-commits
@@ -11220,6 +11220,333 @@ TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { Style); } +TEST_F(FormatTest, BreakBeforeTemplateCloser) { + FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp); + // Begin with tests covering the case where there is no constr

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-02 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 d5a7a483a65f830a0c7a931781bc90046dc67ff4 b2b85fdbe11dce02c6ba842b5a4949b70c47207b --e

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-02 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf updated https://github.com/llvm/llvm-project/pull/125394 >From a323e058b2c8adf97f7f9a55a9187f74de9b8d17 Mon Sep 17 00:00:00 2001 From: Jason Rice Date: Sun, 2 Feb 2025 00:52:47 -0800 Subject: [PATCH 1/3] [Clang][P1061] Consolidate ResolvedUnexpandedPackExpr into F

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-02 Thread Jason Rice via cfe-commits
@@ -3492,10 +3492,13 @@ VarDecl *BindingDecl::getHoldingVar() const { return VD; } -llvm::ArrayRef BindingDecl::getBindingPackExprs() const { +llvm::ArrayRef BindingDecl::getBindingPackDecls() const { assert(Binding && "expecting a pack expr"); - auto *RP = cast(Binding)

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-02 Thread Jason Rice via cfe-commits
ricejasonf wrote: @Sirraide I did try it and the bug persists. The `LHS` is a RecoveryExpr, so I am not sure how to approach that. https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-02 Thread via cfe-commits
Sirraide wrote: Can you test if that also fixes #125165? https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] da2b415 - [clang] Add tracking source deduction guide for the explicitly-written

2025-02-02 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2025-02-02T23:06:25+01:00 New Revision: da2b415b19d178d6b250bb6468ed4a207860adf7 URL: https://github.com/llvm/llvm-project/commit/da2b415b19d178d6b250bb6468ed4a207860adf7 DIFF: https://github.com/llvm/llvm-project/commit/da2b415b19d178d6b250bb6468ed4a207860adf7.diff LO

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-02 Thread Nikolaos Chatzikonstantinou via cfe-commits
createyourpersonalaccount wrote: > > > From #123921, it seems that you only want the new option to work with > > > `--staged`, but should it also work with other options that may print a > > > list of filenames? > > > > > > I don't know; I only use `git clang-format` as in #123921 and I am no

[clang] [clang-format] Fix the indent of the ternary operator when AlignOperands and BreakBeforeTernaryOperators is specified. (PR #100860)

2025-02-02 Thread John Ericson via cfe-commits
Ericson2314 wrote: In Nix (github.com/nixos/nix) I am getting formatting like ```c++ auto variant = scheme == "auto" ? (StoreReference::Variant{Specified::Auto{}}) : (StoreReference::Variant{Specified::Specified{

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

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

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-02 Thread Matheus Izvekov via cfe-commits
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsLateTemplateParsed = ILT; } + bool isInstantiatedFromMemberTemplate() const { +return FunctionDeclBits.IsInstantiatedFromMemberTemplate; + } + void setInstantiatedFromMemberTempl

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within +a function. + +Examples + + +.. code-block:: c++ + +i

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-02 Thread Owen Pan via cfe-commits
owenca wrote: > > From #123921, it seems that you only want the new option to work with > > `--staged`, but should it also work with other options that may print a > > list of filenames? > > I don't know; I only use `git clang-format` as in #123921 and I am not > familiar with all its uses. I

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Oliver Stöneberg via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within +a function. + +Examples + + +.. code-block:: c++ + +i

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-02 Thread Nikolaos Chatzikonstantinou via cfe-commits
https://github.com/createyourpersonalaccount edited https://github.com/llvm/llvm-project/pull/123926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-02 Thread Nikolaos Chatzikonstantinou via cfe-commits
@@ -260,15 +265,13 @@ def main(): "Ignoring the following files (wrong extension, symlink, or " "ignored by clang-format):" ) -for filename in ignored_files: -print("%s" % filename) +print_f

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within +a function. + +Examples + + +.. code-block:: c++ + +i

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within +a function. + +Examples + + +.. code-block:: c++ + +i

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Oliver Stöneberg via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within +a function. + +Examples + + +.. code-block:: c++ + +i

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Balazs Benics via cfe-commits
steakhal wrote: > Could you please run this with `--enable-check-profile` to see how heavy it > is? I plan to re-run it on clang soon, and share the results. https://github.com/llvm/llvm-project/pull/125420 ___ cfe-commits mailing list cfe-commits@li

[clang] [nfc][analyzer] Add MemSpace trait to program state (PR #123003)

2025-02-02 Thread Balazs Benics via cfe-commits
steakhal wrote: I've pushed a couple of commits to sync this PR with what I had in mind. I hope you don't mind @Flandini. Please anyone do a thorough review. --- I've considered uplifiting a couple of the `VarRegion::getStackFrame()`, and similar `getStackFrame()` functions, because internall

[libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (PR #125412)

2025-02-02 Thread Yuriy Chernyshov via cfe-commits
https://github.com/georgthegreat updated https://github.com/llvm/llvm-project/pull/125412 >From 69307d52fc749c847da74e98624ce1c39f2fe2d9 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sun, 2 Feb 2025 14:35:53 +0100 Subject: [PATCH] Silence -Wunused-parameter warnings in Unwind-wasm.c --

[clang] [experimental] Detect return-stack-addr using CFG (PR #124133)

2025-02-02 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/124133 >From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Thu, 23 Jan 2025 15:47:39 + Subject: [PATCH 1/3] [experimental] Detect return-stack-addr using CFG --- .../A

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Oliver Stöneberg via cfe-commits
firewave wrote: Could you please run this with `--enable-check-profile` to see how heavy it is? https://github.com/llvm/llvm-project/pull/125420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within +a function. + +Examples + + +.. code-block:: c++ + +i

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Oliver Stöneberg via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within +a function. + +Examples + + +.. code-block:: c++ + +i

[clang] [Lex] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125380)

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

[clang] 09e7b40 - [libclang] Migrate away from PointerUnion::dyn_cast (NFC) (#125381)

2025-02-02 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-02-02T09:31:39-08:00 New Revision: 09e7b40bd3d7a1a2d9153912224bcf612954ead5 URL: https://github.com/llvm/llvm-project/commit/09e7b40bd3d7a1a2d9153912224bcf612954ead5 DIFF: https://github.com/llvm/llvm-project/commit/09e7b40bd3d7a1a2d9153912224bcf612954ead5.diff L

[clang] [libclang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125381)

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

[clang] 2767f4b - [Lex] Migrate away from PointerUnion::dyn_cast (NFC) (#125380)

2025-02-02 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-02-02T09:31:23-08:00 New Revision: 2767f4bf0d5a70aa990dbfb3341a1bc03effcdbd URL: https://github.com/llvm/llvm-project/commit/2767f4bf0d5a70aa990dbfb3341a1bc03effcdbd DIFF: https://github.com/llvm/llvm-project/commit/2767f4bf0d5a70aa990dbfb3341a1bc03effcdbd.diff L

[clang] 43b7124 - [AST] Migrate away from PointerUnion::dyn_cast (NFC) (#125379)

2025-02-02 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-02-02T09:31:06-08:00 New Revision: 43b7124c5749b3f3276adf1b869e623e163e230e URL: https://github.com/llvm/llvm-project/commit/43b7124c5749b3f3276adf1b869e623e163e230e DIFF: https://github.com/llvm/llvm-project/commit/43b7124c5749b3f3276adf1b869e623e163e230e.diff L

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125379)

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

[clang] [nfc][analyzer] Add MemSpace trait to program state (PR #123003)

2025-02-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/123003 ___ 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 performance-redundant-lookup check (PR #125420)

2025-02-02 Thread via cfe-commits
@@ -0,0 +1,159 @@ +//===--- RedundantLookupCheck.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: Ap

[clang] [Clang][TableGen] Use PointerType::get(Context) in MVE TableGen emitter (NFC) (PR #124782)

2025-02-02 Thread Mats Jun Larsen via cfe-commits
https://github.com/junlarsen updated https://github.com/llvm/llvm-project/pull/124782 >From bc77542fe58bdc94566a9a589039856de50617b0 Mon Sep 17 00:00:00 2001 From: Mats Jun Larsen Date: Wed, 29 Jan 2025 01:29:01 +0900 Subject: [PATCH] [Clang][TableGen] Use PointerType::get(Context) in MVE Tabl

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/125420 >From 78390b2af01fcd5acfbd2a313852962c873e5611 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 2 Feb 2025 17:35:39 +0100 Subject: [PATCH 1/6] [clang-tidy] Add performance-redundant-lookup check Finds r

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/125420 >From 78390b2af01fcd5acfbd2a313852962c873e5611 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 2 Feb 2025 17:35:39 +0100 Subject: [PATCH 1/5] [clang-tidy] Add performance-redundant-lookup check Finds r

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within +a function. + +Examples + + +.. code-block:: c++ + +i

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within +a function. + +Examples + + +.. code-block:: c++ + +i

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within +a function. + +Examples + + +.. code-block:: c++ + +i

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread via cfe-commits
@@ -0,0 +1,147 @@ +.. title:: clang-tidy - performance-redundant-lookup + +performance-redundant-lookup + + +This check warns about potential redundant container lookup operations within +a function. + +Examples + + +.. code-block:: c++ + +i

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/125420 >From 78390b2af01fcd5acfbd2a313852962c873e5611 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 2 Feb 2025 17:35:39 +0100 Subject: [PATCH 1/4] [clang-tidy] Add performance-redundant-lookup check Finds r

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

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

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-02 Thread Matheus Izvekov via cfe-commits
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsLateTemplateParsed = ILT; } + bool isInstantiatedFromMemberTemplate() const { +return FunctionDeclBits.IsInstantiatedFromMemberTemplate; + } + void setInstantiatedFromMemberTempl

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Joseph Huber (jhuber6) Changes Summary: Currently, `-Xarch_` is used to forward argument specially to certain toolchains. Currently, this is only supported by the Darwin toolchain. We want to be able to use this generically, and for offload

[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

2025-02-02 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/125421 Summary: Currently, `-Xarch_` is used to forward argument specially to certain toolchains. Currently, this is only supported by the Darwin toolchain. We want to be able to use this generically, and for offloading

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Balazs Benics (steakhal) Changes Finds redundant lookups to set|map containers. For example: `map.count(key) && map[key] < threshold` --- I've implemented this check in the Clang Static Analyzer, but it didn't really bring much valu

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Balazs Benics (steakhal) Changes Finds redundant lookups to set|map containers. For example: `map.count(key) && map[key] < threshold` --- I've implemented this check in the Clang Static Analyzer, but it didn't really bring mu

[clang-tools-extra] [clang-tidy] Add performance-redundant-lookup check (PR #125420)

2025-02-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/125420 Finds redundant lookups to set|map containers. For example: `map.count(key) && map[key] < threshold` --- I've implemented this check in the Clang Static Analyzer, but it didn't really bring much value compare

  1   2   >