[clang] 2a09523 - [clang] Add diagnostic for unresolved using declaration that shadows template parameters (#131328)

2025-03-14 Thread via cfe-commits
Author: NewSigma Date: 2025-03-14T15:30:01+01:00 New Revision: 2a09523480fc8320c4039e91592d99120e9ae6e7 URL: https://github.com/llvm/llvm-project/commit/2a09523480fc8320c4039e91592d99120e9ae6e7 DIFF: https://github.com/llvm/llvm-project/commit/2a09523480fc8320c4039e91592d99120e9ae6e7.diff LOG:

[clang-tools-extra] [clang-tidy] Fixed bugprone-non-zero-enum-to-bool-conversion (PR #131407)

2025-03-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/131407 Improved bugprone-non-zero-enum-to-bool-conversion check to ignore enums without enumerators and enums with bool as underlying type. Fixes #130762 >From f54b035af44fca80ac52e3661680d50fff5b64e5 Mon Sep 17 00:

[clang-tools-extra] [clang-tidy] Fixed bugprone-non-zero-enum-to-bool-conversion (PR #131407)

2025-03-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Piotr Zegar (PiotrZSL) Changes Improved bugprone-non-zero-enum-to-bool-conversion check to ignore enums without enumerators and enums with bool as underlying type. Fixes #130762 --- Full diff: https://github.com/llvm/llvm-project/pu

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-03-14 Thread via cfe-commits
choikwa wrote: > Are you trying to do an IR lowering? It'd probably make more sense to handle > that in LLVM than clang, but I guess Matt would be the expert there. I had considered it but it has the issue of name aliasing since it just appears as an external call in LLVM after it's emitted by

[clang] [C++20][Modules] Prevent premature call to PassInterestingDeclsToConsumer() within FinishedDeserializing(). (PR #129982)

2025-03-14 Thread Richard Smith via cfe-commits
zygoloid wrote: Thank you! I can imagine figuring out what was wrong here was not easy! https://github.com/llvm/llvm-project/pull/129982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Prevent premature call to PassInterestingDeclsToConsumer() within FinishedDeserializing(). (PR #129982)

2025-03-14 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. https://github.com/llvm/llvm-project/pull/129982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC] clean ReleaseNotes.rst (PR #130626)

2025-03-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/130626 >From 7aed54659acfc32a041cb71dd865d76c6bf44c0e Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 10 Mar 2025 18:54:53 +0300 Subject: [PATCH] [clang-tidy] NFS-clean release notes --- clang-tools-extra/d

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-14 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/129939 >From 23debaf2084f953e60847b8f0814c5d1ee27c726 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 4 Mar 2025 09:53:56 -0800 Subject: [PATCH 01/13] extra scalar vector overloads for clamp --- .../lib/Headers/h

[clang] [C++20][Modules] Prevent premature call to PassInterestingDeclsToConsumer() within FinishedDeserializing(). (PR #129982)

2025-03-14 Thread Michael Park via cfe-commits
mpark wrote: > Thanks, the explanation and code change makes sense to me. ❤️ > Should this bugfix have a release note? I've added a couple of bullet points in the release notes. Please let me know if this is along the lines of what's expected. https://github.com/llvm/llvm-project/pull/129982

[clang] [clang][DependencyScanning] Track modules that resolve from sysroot. (PR #130634)

2025-03-14 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida updated https://github.com/llvm/llvm-project/pull/130634 >From aca254a154489fda68292f6d06a866ae7011a7f6 Mon Sep 17 00:00:00 2001 From: Cyndy Ishida Date: Mon, 10 Mar 2025 09:06:32 -0700 Subject: [PATCH 1/4] [clang][DependencyScanning] Track modules that resolve f

[clang] [clang][DependencyScanning] Track modules that resolve from sysroot. (PR #130634)

2025-03-14 Thread Cyndy Ishida via cfe-commits
@@ -843,7 +864,7 @@ void ModuleDepCollectorPP::addModuleDep( !MDC.isPrebuiltModule(Import)) { cyndyishida wrote: Added a test for this, modified from the working patch. https://github.com/llvm/llvm-project/pull/130634/files#diff-06c3b647f63ed03628260e6d

[clang] [clang] Add value_type attr, use it to add noalias when pass-by-value. (PR #95004)

2025-03-14 Thread Erich Keane via cfe-commits
@@ -9242,3 +9242,15 @@ Declares that a function potentially allocates heap memory, and prevents any pot of ``nonallocating`` by the compiler. }]; } + +def ValueTypeDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``value_type`` attribute can be u

[clang] Warn about virtual methods in `final` classes (PR #131188)

2025-03-14 Thread via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wunnecessary-virtual-specifier %s + +struct Foo final { + Foo() = default; + virtual ~Foo() = default; // expected-warning {{virtual method}} + virtual Foo& operator=(Foo& other) = default; // ex

[clang] [clang][modules] Fix filesystem races in `ModuleManager` (PR #131354)

2025-03-14 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/131354 The `ModuleManager` uses `FileEntry` objects to uniquely identify module files. This requires first consulting the `FileManager` (and therefore the file system) when loading PCM files. This is problematic,

[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

2025-03-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/130297 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 86329ba - [HLSL] Remove old resource annotations (#130338)

2025-03-14 Thread via cfe-commits
Author: Helena Kotas Date: 2025-03-14T10:12:01-07:00 New Revision: 86329ba4d904bb895d5d840c523dde9ddf0ded8e URL: https://github.com/llvm/llvm-project/commit/86329ba4d904bb895d5d840c523dde9ddf0ded8e DIFF: https://github.com/llvm/llvm-project/commit/86329ba4d904bb895d5d840c523dde9ddf0ded8e.diff

[clang] [llvm] [HLSL] Remove HLSLResource attribute (PR #130342)

2025-03-14 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/130342 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-03-14 Thread via cfe-commits
https://github.com/choikwa updated https://github.com/llvm/llvm-project/pull/129347 >From 2b45fac1d2c21f064fa8bb8690fc70a44fcfc851 Mon Sep 17 00:00:00 2001 From: Kevin Choi Date: Fri, 28 Feb 2025 16:52:03 -0600 Subject: [PATCH] [AMDGPU][clang] provide device implementation for __builtin_logb a

[clang] [MS][clang] Add support for vector deleting destructors (PR #126240)

2025-03-14 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: Reduced linkage failure reproducer (can be reduced further, I'm sure), it consists of 4 files t.h: ``` #include struct Base { Base() {} virtual ~Base() {} }; struct ClassA : public Base { inline ClassA(); virtual ~ClassA(){} ; }; inline ClassA::ClassA() {} vo

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-03-14 Thread Leon Clark via cfe-commits
@@ -3398,6 +3399,101 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// If `I` is a load instruction, used only by shufflevector instructions with +// poison values, attempt to shrink the load to only the lanes being used. +bool VectorCombi

[clang] [clang-tools-extra] [clang][modules] Introduce new `ModuleCache` interface (PR #131193)

2025-03-14 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/131193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Constant Expressions inside of GCC' asm strings (PR #131003)

2025-03-14 Thread via cfe-commits
@@ -328,20 +328,20 @@ void StmtProfiler::VisitGCCAsmStmt(const GCCAsmStmt *S) { VisitStmt(S); ID.AddBoolean(S->isVolatile()); ID.AddBoolean(S->isSimple()); - VisitStringLiteral(S->getAsmString()); + VisitExpr(S->getAsmStringExpr()); cor3ntin wrote: #13

[clang] [clang] Add value_type attr, use it to add noalias when pass-by-value. (PR #95004)

2025-03-14 Thread Erich Keane via cfe-commits
@@ -1972,6 +1972,16 @@ def TrivialABI : InheritableAttr { let SimpleHandler = 1; } +def ValueType : InheritableAttr { + // This attribute does not have a C [[]] spelling because it requires the + // CPlusPlus language option. + let Spellings = [Clang<"value_type", 0>]; +

[clang] [clang] Add value_type attr, use it to add noalias when pass-by-value. (PR #95004)

2025-03-14 Thread Erich Keane via cfe-commits
@@ -9242,3 +9242,15 @@ Declares that a function potentially allocates heap memory, and prevents any pot of ``nonallocating`` by the compiler. }]; } + +def ValueTypeDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``value_type`` attribute can be u

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -0,0 +1,27 @@ +=== +Analysis Statistics +=== + +CSA enjoys two facilities to collect statistics: per translation unit and per entry point. +We use llvm/ADT/Statistic.h for numbers describing the entire translation unit (TU). +We use clang/Stati

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-03-14 Thread via cfe-commits
https://github.com/choikwa updated https://github.com/llvm/llvm-project/pull/129347 >From 0377e854b4cf6edc1bf09302761995418c2258b7 Mon Sep 17 00:00:00 2001 From: Kevin Choi Date: Fri, 28 Feb 2025 16:52:03 -0600 Subject: [PATCH] [AMDGPU][clang] provide device implementation for __builtin_logb a

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-03-14 Thread via cfe-commits
https://github.com/choikwa updated https://github.com/llvm/llvm-project/pull/129347 >From 2dcd7f9e49189493240cded925d61e9df7c34c8d Mon Sep 17 00:00:00 2001 From: Kevin Choi Date: Fri, 28 Feb 2025 16:52:03 -0600 Subject: [PATCH] [AMDGPU][clang] provide device implementation for __builtin_logb a

[clang] [llvm] [HLSL] Remove old resource annotations (PR #130338)

2025-03-14 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-aarch64-quick` running on `linaro-clang-aarch64-quick` while building `clang,llvm` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/65/builds/13788 Here is the relevan

[clang] [clang][driver][NFC] Remove else after return (PR #131182)

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

[clang] [CIR] Upstream initial support for unary op (PR #131369)

2025-03-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Andy Kaylor (andykaylor) Changes This adds support for the cir.unary operation. --- Patch is 40.74 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/131369.diff 11 Files Affected: - (modified

[clang] [Clang] Remove use of 'temporary' toolchains for offload deduction (PR #131332)

2025-03-14 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/131332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-03-14 Thread Leon Clark via cfe-commits
@@ -3398,6 +3399,101 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// If `I` is a load instruction, used only by shufflevector instructions with +// poison values, attempt to shrink the load to only the lanes being used. +bool VectorCombi

[clang] Move const qualification of array to its elements (PR #131366)

2025-03-14 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/131366 Const-qualification of an array caused by constexpr specifier can produce QualType, where the const qualifier is set both as fast qualifier and as a qualifier of the array element type. It can result in a comp

[clang] [llvm] [HLSL] Remove old resource annotations (PR #130338)

2025-03-14 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/130338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-14 Thread Deric C. via cfe-commits
https://github.com/Icohedron updated https://github.com/llvm/llvm-project/pull/131070 >From 81196e016dbf1209637dd13315efff7eac461d42 Mon Sep 17 00:00:00 2001 From: Icohedron Date: Fri, 14 Mar 2025 00:24:26 + Subject: [PATCH 1/3] Implement ResMayNotAlias DXIL shader flag analysis --- clang

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
@@ -35,9 +35,10 @@ class DivZeroChecker : public Checker> { public: /// This checker class implements several user facing checkers enum CheckKind { CK_DivideZero, CK_TaintedDivChecker, CK_NumCheckKinds }; - bool ChecksEnabled[CK_NumCheckKinds] = {false}; - CheckerNameRef

[clang] [CIR] Upstream basic support for sizeof and alignof (PR #130847)

2025-03-14 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper closed https://github.com/llvm/llvm-project/pull/130847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MS][clang] Add support for vector deleting destructors (PR #126240)

2025-03-14 Thread Reid Kleckner via cfe-commits
rnk wrote: I think the `.SCOV$M` section globals should be in the `??_EClassA@@UEAAPEXI@Z` comdat group. I think sanitizer coverage (sancov) is one of the lesser-used sanitizers here, and it may lack some sophistication when it comes to comdat groups. I wasn't aware of this creative use of `bl

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-14 Thread Deric C. via cfe-commits
https://github.com/Icohedron edited https://github.com/llvm/llvm-project/pull/131070 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Implement Shader Flags Analysis for ResMayNotAlias (PR #131070)

2025-03-14 Thread Deric C. via cfe-commits
https://github.com/Icohedron edited https://github.com/llvm/llvm-project/pull/131070 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream initial support for unary op (PR #131369)

2025-03-14 Thread Erich Keane via cfe-commits
@@ -568,6 +568,128 @@ mlir::LogicalResult CIRToLLVMGlobalOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMUnaryOpLowering::matchAndRewrite( +cir::UnaryOp op, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rewriter) const { +

[clang] [CIR] Upstream initial support for unary op (PR #131369)

2025-03-14 Thread Erich Keane via cfe-commits
@@ -92,6 +92,222 @@ class ScalarExprEmitter : public StmtVisitor { mlir::Value VisitCastExpr(CastExpr *E); + // Unary Operators. + mlir::Value VisitUnaryPostDec(const UnaryOperator *e) { +LValue lv = cgf.emitLValue(e->getSubExpr()); +return emitScalarPrePostIncDe

[clang] [CIR] Upstream initial support for unary op (PR #131369)

2025-03-14 Thread Erich Keane via cfe-commits
@@ -92,6 +92,222 @@ class ScalarExprEmitter : public StmtVisitor { mlir::Value VisitCastExpr(CastExpr *E); + // Unary Operators. + mlir::Value VisitUnaryPostDec(const UnaryOperator *e) { +LValue lv = cgf.emitLValue(e->getSubExpr()); +return emitScalarPrePostIncDe

[clang] [CIR] Upstream initial support for unary op (PR #131369)

2025-03-14 Thread Erich Keane via cfe-commits
@@ -468,6 +468,55 @@ def BrOp : CIR_Op<"br", }]; } +//===--===// +// UnaryOp +//===--===// + +def UnaryOpKind_Inc : I32EnumAttrCase<"Inc"

[clang] [clang] Avoid doing C++20 aggregate init during copy-initialization (PR #131320)

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

[clang] [clang] Avoid doing C++20 aggregate init during copy-initialization (PR #131320)

2025-03-14 Thread via cfe-commits
@@ -6714,7 +6714,8 @@ void InitializationSequence::InitializeFrom(Sema &S, OverloadCandidateSet::iterator Best; OverloadingResult OR = getFailedCandidateSet().BestViableFunction( S, Kind.getLocation(), Best); -if (OR != OverloadingResult::OR_

[clang] [CIR] Upstream initial support for unary op (PR #131369)

2025-03-14 Thread Erich Keane via cfe-commits
@@ -468,6 +468,55 @@ def BrOp : CIR_Op<"br", }]; } +//===--===// +// UnaryOp +//===--===// + +def UnaryOpKind_Inc : I32EnumAttrCase<"Inc"

[clang] [clang][DependencyScanning] Track modules that resolve from sysroot. (PR #130634)

2025-03-14 Thread Cyndy Ishida via cfe-commits
@@ -739,6 +748,12 @@ ModuleDepCollectorPP::handleTopLevelModule(const Module *M) { MDC.ScanInstance.getASTReader()->visitInputFileInfos( *MF, /*IncludeSystem=*/true, [&](const serialization::InputFileInfo &IFI, bool IsSystem) { +if (MD.IsInSysroot) { +

[clang] [CIR] Upstream initial support for unary op (PR #131369)

2025-03-14 Thread Andy Kaylor via cfe-commits
@@ -468,6 +468,55 @@ def BrOp : CIR_Op<"br", }]; } +//===--===// +// UnaryOp +//===--===// + +def UnaryOpKind_Inc : I32EnumAttrCase<"Inc"

[clang] [HLSL] Make sure `isSigned` flag is set on target type for `TypedBuffer` resources with signed int vectors (PR #130223)

2025-03-14 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/130223 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Fuchsia] Support PGO (PR #128680)

2025-03-14 Thread Paul Kirth via cfe-commits
@@ -165,33 +175,57 @@ endif() set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "") set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "") -set(_FUCHSIA_BOOTSTRAP_TARGETS - check-all - check-clang - check-lld - check-llvm - check-polly - llvm-config - clang-test-depends - lld-test-

[clang] [Fuchsia] Support PGO (PR #128680)

2025-03-14 Thread Paul Kirth via cfe-commits
@@ -165,33 +175,57 @@ endif() set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "") set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "") -set(_FUCHSIA_BOOTSTRAP_TARGETS - check-all - check-clang - check-lld - check-llvm - check-polly - llvm-config - clang-test-depends - lld-test-

[clang] [CIR] Upstream initial support for unary op (PR #131369)

2025-03-14 Thread Andy Kaylor via cfe-commits
@@ -165,6 +165,54 @@ LValue CIRGenFunction::emitDeclRefLValue(const DeclRefExpr *e) { return LValue(); } +LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { + UnaryOperatorKind op = e->getOpcode(); + + // __extension__ doesn't affect lvalue-ness. + if (op

[clang-tools-extra] [clangd] Use `SymbolName` to represent Objective-C selectors (PR #82061)

2025-03-14 Thread David Goldman via cfe-commits
@@ -35,6 +35,56 @@ struct RenameOptions { bool RenameVirtual = true; }; +/// A name of a symbol that should be renamed. +/// +/// Symbol's name can be composed of multiple strings. For example, Objective-C +/// methods can contain multiple argument labels: +/// +/// \code +/

[clang] e9fc768 - [CIR] Upstream basic support for sizeof and alignof (#130847)

2025-03-14 Thread via cfe-commits
Author: Amr Hesham Date: 2025-03-14T19:12:27+01:00 New Revision: e9fc7683a54d9e5233cff5d016d6f2cdcaf2b2c3 URL: https://github.com/llvm/llvm-project/commit/e9fc7683a54d9e5233cff5d016d6f2cdcaf2b2c3 DIFF: https://github.com/llvm/llvm-project/commit/e9fc7683a54d9e5233cff5d016d6f2cdcaf2b2c3.diff LO

[clang] [CIR] Upstream initial support for unary op (PR #131369)

2025-03-14 Thread Erich Keane via cfe-commits
@@ -165,6 +165,54 @@ LValue CIRGenFunction::emitDeclRefLValue(const DeclRefExpr *e) { return LValue(); } +LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { + UnaryOperatorKind op = e->getOpcode(); + + // __extension__ doesn't affect lvalue-ness. + if (op

[clang-tools-extra] [clang-tidy] Add an option to treat warnings as errors (PR #128221)

2025-03-14 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Nit: specific in the commit message title that this is about clang-tidy-diff.py. Otherwise it seems you are adding warnings as errors to clang-tidy itself. https://github.com/llvm/llvm-project/pull/128221 ___ cfe-commits mailing

[clang-tools-extra] [clangd] Use `SymbolName` to represent Objective-C selectors (PR #82061)

2025-03-14 Thread David Goldman via cfe-commits
@@ -605,12 +607,12 @@ findAllSelectorPieces(llvm::ArrayRef Tokens, auto PieceCount = SelectorPieces.size(); if (PieceCount < NumArgs && isMatchingSelectorName(Tok, Tokens[Index + 1], SM, - Sel.getNameForSlot(PieceCount))) {

[clang] [HLSL] Make sure `isSigned` flag is set on target type for `TypedBuffer` resources with signed int vectors (PR #130223)

2025-03-14 Thread Helena Kotas via cfe-commits
hekota wrote: > LGTM for DXIL. Is there a plan to do this with SPIR-V too? SPIR-V is generating different target type and it does not seem to have the 'signed' flag: See https://github.com/llvm/llvm-project/blob/fbf0276b6a7a7a4508c373cf87fc349569652659/clang/lib/CodeGen/Targets/SPIR.cpp#L396

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-03-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127061 >From a76ee008bdb87655da465e21d09c840edecc2b1b Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 13 Feb 2025 15:24:09 +0200 Subject: [PATCH 1/2] [Clang] emit -Wunused-variable warning for unused structur

[clang] [clang] Add value_type attr, use it to add noalias when pass-by-value. (PR #95004)

2025-03-14 Thread James Y Knight via cfe-commits
@@ -9242,3 +9242,15 @@ Declares that a function potentially allocates heap memory, and prevents any pot of ``nonallocating`` by the compiler. }]; } + +def ValueTypeDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``value_type`` attribute can be u

[clang] Warn about virtual methods in `final` classes (PR #131188)

2025-03-14 Thread Hans Wennborg via cfe-commits
https://github.com/zmodem commented: Code and test lgtm, but I think we should consider enabling it by default. https://github.com/llvm/llvm-project/pull/131188 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-14 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor edited https://github.com/llvm/llvm-project/pull/130690 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-14 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,100 @@ +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir -DCIR_ONLY %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-14 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. LGTM with one very minor nit https://github.com/llvm/llvm-project/pull/130690 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][DependencyScanning] Track modules that resolve from sysroot. (PR #130634)

2025-03-14 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/130634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Optimize Cache Insertion with try_emplace for Reduced Lookups (PR #131402)

2025-03-14 Thread Ayush Pareek via cfe-commits
https://github.com/ayushpareek2003 created https://github.com/llvm/llvm-project/pull/131402 for the functions- insertEntryForFilename() , insertRealPathForFilename() Replaced `Cache.insert()` with `Cache.try_emplace()` to reduce redundant lookups Improved efficiency by avoiding unnecessary co

[clang] [clang] Allow constexpr-unknown values pre C++23 (PR #129646)

2025-03-14 Thread Eli Friedman via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: efriedma-quic wrote: Reduced testcase for the microsoft-abi-member-pointers.cpp failure: ``` constinit int &b = b; ``` This should produce an error; clang -std=c++23 currently accepts it. https://github.com/llvm/llvm-project/pull/129646 _

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -0,0 +1,162 @@ +// EntryPointStats.h - Tracking statistics per entry point --*- C++ -*-// necto wrote: Fixed a93cac41b87d [NFC] Fix header comment widths https://github.com/llvm/llvm-project/pull/131175 ___ cfe-com

[clang] Optimize Cache Insertion with try_emplace for Reduced Lookups (PR #131402)

2025-03-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ayush Pareek (ayushpareek2003) Changes for the functions- insertEntryForFilename() , insertRealPathForFilename() Replaced `Cache.insert()` with `Cache.try_emplace()` to reduce redundant lookups Improved efficiency by avoiding unnecessary

[clang-tools-extra] [clang-tidy][NFC] clean ReleaseNotes.rst (PR #130626)

2025-03-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/130626 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Allow constexpr-unknown values pre C++23 (PR #129646)

2025-03-14 Thread Eli Friedman via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: efriedma-quic wrote: The other test changes look mostly okay, but worth investigating to see if we can improve the diagnostic notes for illegal uses of constexpr-unknown variables. https://github.com/llvm/llvm-project/pull/129646 _

[clang] befb52d - [Clang] Remove use of 'temporary' toolchains for offload deduction (#131332)

2025-03-14 Thread via cfe-commits
Author: Joseph Huber Date: 2025-03-14T11:08:31-05:00 New Revision: befb52db94cc63558981baac5e58d86ed2ec1f37 URL: https://github.com/llvm/llvm-project/commit/befb52db94cc63558981baac5e58d86ed2ec1f37 DIFF: https://github.com/llvm/llvm-project/commit/befb52db94cc63558981baac5e58d86ed2ec1f37.diff

[clang] [clang][DependencyScanning] Track modules that resolve from sysroot. (PR #130634)

2025-03-14 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir edited https://github.com/llvm/llvm-project/pull/130634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Avoid doing C++20 aggregate init during copy-initialization (PR #131320)

2025-03-14 Thread via cfe-commits
@@ -6714,7 +6714,8 @@ void InitializationSequence::InitializeFrom(Sema &S, OverloadCandidateSet::iterator Best; OverloadingResult OR = getFailedCandidateSet().BestViableFunction( S, Kind.getLocation(), Best); -if (OR != OverloadingResult::OR_

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [lldb] [llvm] [compiler-rt] Disable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON on AIX. (PR #131200)

2025-03-14 Thread Alexander Richardson via cfe-commits
arichardson wrote: > > Wouldn't it be more maintainable to just force the value to OFF for AIX > > where the `option()` is defined? > > Unfortunately, the cmake command line option `-D > LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON` overrides the `option()` in the cmake > file. Sorry if this was no

[clang] [llvm] [RISCV] Add Zilsd and Zclsd Extensions (PR #131094)

2025-03-14 Thread via cfe-commits
https://github.com/dong-miao updated https://github.com/llvm/llvm-project/pull/131094 >From bcdf9641037507b855a20a8ba5d26b127dd248e8 Mon Sep 17 00:00:00 2001 From: dong-miao Date: Sat, 4 Jan 2025 17:53:58 +0800 Subject: [PATCH 01/11] Update RISCVSystemOperands.td --- llvm/lib/Target/RISCV/RIS

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/131175 >From 6b6d80d42d40d5917622cbc2bc0f2a454c34eca3 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Thu, 13 Mar 2025 18:42:39 +0100 Subject: [PATCH 1/2] [analyzer] Introduce per-entry-point statistics MIME-Ve

[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

2025-03-14 Thread Carlos Alberto Enciso via cfe-commits
@@ -2518,6 +2518,59 @@ StringRef CGDebugInfo::getVTableName(const CXXRecordDecl *RD) { return internString("_vptr$", RD->getNameAsString()); } +// Emit symbol for the debugger that points to the vtable address for +// the given class. The symbol is named as '_vtable$'. +//

[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

2025-03-14 Thread Carlos Alberto Enciso via cfe-commits
@@ -2518,6 +2518,59 @@ StringRef CGDebugInfo::getVTableName(const CXXRecordDecl *RD) { return internString("_vptr$", RD->getNameAsString()); } +// Emit symbol for the debugger that points to the vtable address for +// the given class. The symbol is named as '_vtable$'. +//

[clang] [llvm] [RISCV][MC] Implement MC for Base P extension (PR #123271)

2025-03-14 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 9b83ffb5c609290b5b457a2038ee663beaf795ab 12cb98d08cc3dc1a68f7f386638d08efd76e243c --e

[clang] [Clang] Introduce FunctionParmPackDecl for expanded lambda captures (PR #107995)

2025-03-14 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @cor3ntin I thought introducing a new Decl node only to ensure the invariance of the protocol of TransformDecl() seemed a bit waste, but I don't know if there's a better approach, so I left it as a draft. Do we have this issue surfaced recently other than the original one? htt

[clang] [clang] Fix handling of certain new-expression corner cases (PR #131295)

2025-03-14 Thread via cfe-commits
https://github.com/offsetof created https://github.com/llvm/llvm-project/pull/131295 * Fix array bound not being deduced from the initializer when the new-expression does not directly contain the array declarator (e.g. because a typedef is used) * Fix initialization of character arrays from pa

[clang] [Clang] Introduce FunctionParmPackDecl for expanded lambda captures (PR #107995)

2025-03-14 Thread via cfe-commits
cor3ntin wrote: > Do we have this issue surfaced recently other than the original one? https://github.com/llvm/llvm-project/issues/18873#issuecomment-2723970382 https://github.com/llvm/llvm-project/pull/107995 ___ cfe-commits mailing list cfe-commits@

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,162 @@ +// EntryPointStats.h - Tracking statistics per entry point -*- 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: Apache-2.0

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: Thanks for contributing infrastructural improvements like this; these will be helpful in the analyzer development. Overall I'm satisfied with the idea of this commit; but I marked a few typos and stylistic suggestions in inline comments. https://github.

[clang] [Format] Do not crash on non-null terminated strings (PR #131299)

2025-03-14 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > It would be useful to have a repro or a stack trace here. In particular, in > `SourceManagerForFile`, `RequiresNullTerminator` is `false`, so the assert > should _not_ fire on a non-null terminated file The repro is attached to the commit. Here is the full stack trace:

[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Balazs Benics via cfe-commits
@@ -353,6 +353,12 @@ ANALYZER_OPTION(bool, DisplayCTUProgress, "display-ctu-progress", "the analyzer's progress related to ctu.", false) +ANALYZER_OPTION( +StringRef, DumpSEStatsToCSV, "dump-se-stats-to-csv", steakhal wrote

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -485,16 +485,60 @@ class Call { } // end eval namespace class CheckerBase : public ProgramPointTag { - CheckerNameRef Name; + /// A single checker class (i.e. a subclass o

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -116,6 +116,19 @@ class CheckerNameRef { operator StringRef() const { return Name; } }; +/// A single checker class (and its singleton instance) can act as the +/// implem

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -190,23 +203,38 @@ class CheckerManager { // Checker registration. //======// - /// Used to registe

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -190,23 +203,38 @@ class CheckerManager { // Checker registration. //======// - /// Used to registe

[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -35,9 +35,10 @@ class DivZeroChecker : public Checker> { public: /// This checker class implements several user facing checkers enum CheckKind { CK_DivideZero, CK_Tainte

[clang] [clang] Avoid doing C++20 aggregate init during copy-initialization (PR #131320)

2025-03-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (offsetof) Changes Fixes #88089 --- Full diff: https://github.com/llvm/llvm-project/pull/131320.diff 2 Files Affected: - (modified) clang/lib/Sema/SemaInit.cpp (+2-1) - (modified) clang/test/CXX/dcl.decl/dcl.init/dcl.init.general/

[clang] [clang-tools-extra] [llvm] [clang] WIP: Improved Context Declaration tracking (PR #107942)

2025-03-14 Thread Younan Zhang via cfe-commits
zyn0217 wrote: A quick note that we want to test with this patch - [ ] https://github.com/llvm/llvm-project/issues/51315 - [ ] https://github.com/llvm/llvm-project/issues/127421 - [ ] https://github.com/llvm/llvm-project/issues/126550 - [ ] https://github.com/llvm/llvm-project/issues/120503 h

[clang] [sanitizer][CFI] Add support to build CFI with sanitize-coverage (PR #131296)

2025-03-14 Thread Maxim Zhukov via cfe-commits
https://github.com/Mephistophiles ready_for_review https://github.com/llvm/llvm-project/pull/131296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add support for absl nullability macros (PR #130346)

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

[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

2025-03-14 Thread Pavel Labath via cfe-commits
labath wrote: IIUC, your debugger parses all of debug info upfront and builds up a vtable pointer->class DIE map. That's not something we would want to do in lldb, but I think we could still make use of this by first searching for the type using the name from the vtable (like we do now) and th

[clang] [sanitizer][CFI] Add support to build CFI with sanitize-coverage (PR #131296)

2025-03-14 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] [sanitizer][CFI] Add support to build CFI with sanitize-coverage (PR #131296)

2025-03-14 Thread Maxim Zhukov via cfe-commits
https://github.com/Mephistophiles created https://github.com/llvm/llvm-project/pull/131296 Added ability to build together with -fsanitize=cfi and -fsanitize-coverage=trace-cmp at the same time. >From d9d8e52c91a8c8132d3f5384838bea0bc51a64e3 Mon Sep 17 00:00:00 2001 From: Maxim Zhukov Date: F

<    1   2   3   4   >