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

2025-03-14 Thread Devon Loehr via cfe-commits
https://github.com/DKLoehr updated https://github.com/llvm/llvm-project/pull/131188 >From fbd474fb5ae3adeaf1644a4d44e916e4d7c66395 Mon Sep 17 00:00:00 2001 From: Devon Loehr Date: Thu, 13 Mar 2025 17:34:27 + Subject: [PATCH 1/4] Initial warning commit --- clang/include/clang/Basic/Diagnos

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

2025-03-14 Thread Balazs Benics 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] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/130985 From 895b6947690ec51d8e8bccfa09420afae4449343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Mon, 3 Mar 2025 15:33:44 +0100 Subject: [PATCH 1/9] [NFC][analyzer] Framework for multipart chec

[clang] [Clang] Rename SecondArgIsLastNamedArgument for clarity and consistency (PR #131346)

2025-03-14 Thread Imad Aldij via cfe-commits
imdj wrote: cc: @erichkeane https://github.com/llvm/llvm-project/pull/131346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[clang] [Clang] Rename SecondArgIsLastNamedArgument for clarity and consistency (PR #131346)

2025-03-14 Thread Imad Aldij via cfe-commits
https://github.com/imdj updated https://github.com/llvm/llvm-project/pull/131346 >From 3b2f0f906d24b812f1806540f88b0668198dfa42 Mon Sep 17 00:00:00 2001 From: Imad Aldij Date: Fri, 14 Mar 2025 17:51:34 +0200 Subject: [PATCH] [Clang] Rename SecondArgIsLastNamedArgument for clarity Update the var

[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] [NFC][analyzer] Framework for multipart checkers (PR #130985)

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/130985 From 895b6947690ec51d8e8bccfa09420afae4449343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Mon, 3 Mar 2025 15:33:44 +0100 Subject: [PATCH 01/10] [NFC][analyzer] Framework for multipart ch

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

2025-03-14 Thread Donát Nagy via cfe-commits
@@ -190,23 +203,38 @@ class CheckerManager { // Checker registration. //======// - /// Used to register checkers. - /// All arguments are automatically passed through to the checker - /// constructor.

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

2025-03-14 Thread Devon Loehr 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] Warn about virtual methods in `final` classes (PR #131188)

2025-03-14 Thread Vlad Serebrennikov 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][NFC] Rename SecondArgIsLastNamedArgument for clarity and consistency (PR #131346)

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

[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/9] [analyzer] Introduce per-entry-point statistics MIME-Ve

[clang] [C23] Add __builtin_c23_va_start (PR #131166)

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

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

2025-03-14 Thread Björn Schäpers via cfe-commits
@@ -29096,6 +29096,17 @@ TEST_F(FormatTest, BreakBeforeClassName) { "ArenaSafeUniquePtr {};"); } +TEST_F(FormatTest, DoesNotCrashOnNonNullTerminatedStringRefs) { + llvm::StringRef TwoLines = "namespace foo {}\n" + "namespace bar

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

2025-03-14 Thread Björn Schäpers via cfe-commits
@@ -2382,14 +2382,20 @@ size_t SourceManager::getDataStructureSizes() const { SourceManagerForFile::SourceManagerForFile(StringRef FileName, StringRef Content) { + // We copy to `std::string` for Context instead of StringRef because

[clang] [clang][RISCV] Rename variable name in SemaRISCV. NFC (PR #131261)

2025-03-14 Thread Brandon Wu via cfe-commits
https://github.com/4vtomat created https://github.com/llvm/llvm-project/pull/131261 None >From 9aa7f5bfd6afed1059cc53806b29d544105a8f8a Mon Sep 17 00:00:00 2001 From: Brandon Wu Date: Thu, 13 Mar 2025 19:57:29 -0700 Subject: [PATCH] [clang][RISCV] Rename variable name in SemaRISCV. NFC --- c

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

2025-03-14 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov created https://github.com/llvm/llvm-project/pull/131299 The `format` API receives a StringRef, but crashes whenever it is non-null-terminated with the corresponding assertion: ``` FormatTests: llvm/lib/Support/MemoryBuffer.cpp:53: void llvm::MemoryBuffer::init

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

2025-03-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Ilya Biryukov (ilya-biryukov) Changes The `format` API receives a StringRef, but crashes whenever it is non-null-terminated with the corresponding assertion: ``` FormatTests: llvm/lib/Support/MemoryBuffer.cpp:53: void llvm::MemoryB

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

2025-03-14 Thread Devon Loehr 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] Avoid doing C++20 aggregate init during copy-initialization (PR #131320)

2025-03-14 Thread via cfe-commits
https://github.com/cor3ntin commented: This change needs a release note. Please add an entry to `clang/docs/ReleaseNotes.rst` in the section the most adapted to the change, and referencing any Github issue this change fixes. Thanks! https://github.com/llvm/llvm-project/pull/131320

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

2025-03-14 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed 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] Warn about virtual methods in `final` classes (PR #131188)

2025-03-14 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM, thanks! Please give some time for @zmodem to also review https://github.com/llvm/llvm-project/pull/131188 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

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

2025-03-14 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir commented: I have a similar concern to @jansvoboda11 that we probably need to check the invocation paths as well. > I would think that if ModuleDepCollector only found dependency inputs that > resolve to sysroot locations, the command line for building the spec

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

2025-03-14 Thread Ben Langmuir via cfe-commits
@@ -835,6 +850,13 @@ void ModuleDepCollectorPP::addAllSubmoduleDeps( }); } +void ModuleDepCollectorPP::addClangModule(const Module *M, const ModuleID ID, benlangmuir wrote: How about something like "addOneModuleDep"? If find it hard to guess from the name

[clang] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

2025-03-14 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 created https://github.com/llvm/llvm-project/pull/131374 NotNullConstraint is used to check both null and non-null of a pointer. So the name, which was created originally for just checking non-nullness, becomes less suitable. The same reason applies to `NotNull

[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][modules][deps] Add mutex as an alternative to file lock (PR #129751)

2025-03-14 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/129751 >From 5aef4afc8ec98ea93459dfa0ac19fd972472e38a Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 12 Mar 2025 10:20:16 -0700 Subject: [PATCH] [clang][deps] Implement efficient in-process `ModuleCache` -

[clang] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

2025-03-14 Thread Ziqing Luo via cfe-commits
@@ -1165,7 +1165,7 @@ ProgramStateRef StdLibraryFunctionsChecker::NotNullConstraint::apply( return State->assume(L, CannotBeNull); } -void StdLibraryFunctionsChecker::NotNullConstraint::describe( +void StdLibraryFunctionsChecker::NullnessConstraint::describe( Descripti

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

2025-03-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. LGTM for DXIL. Is there a plan to do this with SPIR-V too? https://github.com/llvm/llvm-project/pull/130223 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[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] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

2025-03-14 Thread Ziqing Luo via cfe-commits
@@ -436,9 +436,9 @@ class StdLibraryFunctionsChecker llvm::raw_ostream &Out) const override; ValueConstraintPtr negate() const override { - NotNullBufferConstraint Tmp(*this); + BufferNullnessConstraint Tmp(*this); Tmp.Cannot

[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] [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 a1448c6ded1ee42677125b3c3dfdf24148eb12a0 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] [clang][modules][deps] Add mutex as an alternative to file lock (PR #129751)

2025-03-14 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/129751 >From 7dadb10f4e63e419a230270b5f26a145d7015ae7 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 12 Mar 2025 10:20:16 -0700 Subject: [PATCH] [clang][deps] Implement efficient in-process `ModuleCache` -

[clang] [clang][modules][deps] Add mutex as an alternative to file lock (PR #129751)

2025-03-14 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 deleted https://github.com/llvm/llvm-project/pull/129751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CIR] Add missing dependency on MLIR headers (PR #131057)

2025-03-14 Thread via cfe-commits
https://github.com/darkbuck updated https://github.com/llvm/llvm-project/pull/131057 >From 255050e6d1e3ebbf25b30c17a10be14d29e5dae7 Mon Sep 17 00:00:00 2001 From: Michael Liao Date: Tue, 4 Mar 2025 12:47:24 -0500 Subject: [PATCH] [clang][CIR] Add missing dependency on MLIR headers - Add depend

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #120223)

2025-03-14 Thread Shafik Yaghmour via cfe-commits
shafik wrote: It looks like this is linked to: https://github.com/llvm/llvm-project/issues/131410 and it is not clear to me the diagnostic in these cases makes a lot of sense or at least the motivation does not feel strong to me. This new approach feels evolutionary to me and if this was the

[clang] [flang] [llvm] [NFC][AMDGPU] Replace more direct arch comparison with isAMDGCN() (PR #131379)

2025-03-14 Thread Shilei Tian via cfe-commits
https://github.com/shiltian created https://github.com/llvm/llvm-project/pull/131379 This is an extension of #131357. Hopefully this would be the last one. >From 59bc234d4a5c343e093417150688a3231a230961 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Fri, 14 Mar 2025 15:06:30 -0400 Subject: [

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

2025-03-14 Thread Donát Nagy via cfe-commits
@@ -485,16 +485,60 @@ class Call { } // end eval namespace class CheckerBase : public ProgramPointTag { - CheckerNameRef Name; + /// A single checker class (i.e. a subclass of `CheckerBase`) can implement + /// multiple user-facing checkers that have separate names and can

[clang] [clang][modules][deps] Add mutex as an alternative to file lock (PR #129751)

2025-03-14 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: I rebased this on top of the other PRs I've recently landed. This is ready for another round of reviews. https://github.com/llvm/llvm-project/pull/129751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [clang] fix uefi target for aarch64 & x86_64 (PR #120632)

2025-03-14 Thread Tristan Ross via cfe-commits
https://github.com/RossComputerGuy updated https://github.com/llvm/llvm-project/pull/120632 >From e0d525f801f65588aa6b22a2827036a4c2d9c91c Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Thu, 19 Dec 2024 10:54:58 -0800 Subject: [PATCH 1/4] [clang] fix uefi data layout on x86 & aarch64 --- c

[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/23] Update RISCVSystemOperands.td --- llvm/lib/Target/RISCV/RIS

[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/24] Update RISCVSystemOperands.td --- llvm/lib/Target/RISCV/RIS

[clang] [clang] Fix UEFI Target info (PR #127290)

2025-03-14 Thread Tristan Ross via cfe-commits
RossComputerGuy wrote: Would this unblock #131376? https://github.com/llvm/llvm-project/pull/127290 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-03-14 Thread Craig Topper via cfe-commits
topperc wrote: This should fix your failures ``` diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp index 214378d4b554..59ab59703ac7 100644 --- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp +++ b/llvm/lib

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

2025-03-14 Thread Cyndy Ishida via cfe-commits
cyndyishida wrote: > I have a similar concern to @jansvoboda11 that we probably need to check the > invocation paths as well. > The situation this covers is how likely is it that the build system is going > to determine this needs to be rebuilt, and that happens (in most cases) > purely based

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

2025-03-14 Thread Ben Langmuir 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-tools-extra] 471f034 - [clang-tidy][NFC] clean ReleaseNotes.rst (#130626)

2025-03-14 Thread via cfe-commits
Author: Baranov Victor Date: 2025-03-14T23:31:50+01:00 New Revision: 471f034b1cdaaa7748719efb848684e5d2c6b923 URL: https://github.com/llvm/llvm-project/commit/471f034b1cdaaa7748719efb848684e5d2c6b923 DIFF: https://github.com/llvm/llvm-project/commit/471f034b1cdaaa7748719efb848684e5d2c6b923.diff

[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/25] Update RISCVSystemOperands.td --- llvm/lib/Target/RISCV/RIS

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

2025-03-14 Thread via cfe-commits
dong-miao wrote: > This should fix your failures > > ``` > diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp > b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp > index 214378d4b554..59ab59703ac7 100644 > --- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cp

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

2025-03-14 Thread via cfe-commits
dong-miao wrote: > commented Thanks for your help. I have successfully solved the problem. https://github.com/llvm/llvm-project/pull/131094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

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

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-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

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

<    1   2   3   4