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

2025-03-14 Thread via cfe-commits
cor3ntin 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. This looks like a reasonable approach to me https://github.com/llv

[clang] [clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

2025-03-14 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: I've rebased on latest main now and intend to land it as soon as the CI checks pass. Let me know if I should do any last-minute changes before that! Thank you all for the review :) https://github.com/llvm/llvm-project/pull/128150 __

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

2025-03-14 Thread Devon Loehr via cfe-commits
@@ -0,0 +1,27 @@ +// 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) = defau

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

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

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

2025-03-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (offsetof) Changes * 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 parenth

[clang] [Clang][CodeGen] Do not set inbounds flag for struct GEP with null base pointers (PR #130734)

2025-03-14 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/130734 >From 02065e86c63ab3fbdefd2ce6e963ffeec96e6a24 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 11 Mar 2025 16:20:08 +0800 Subject: [PATCH 1/3] [Clang][CodeGen] Do not set inbounds flag for struct GEP wi

[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: We

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

2025-03-14 Thread via cfe-commits
dong-miao wrote: When I tested with `sudo ninja - C build check lvm` locally, there were two testing errors that I couldn't solve. For rv32zclsd-valid. s, errors may occur during the disassembly process because the test file does not report errors when I remove Check-ASM-AND-OBJ. [Error reco

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

2025-03-14 Thread Carlos Alberto Enciso via cfe-commits
CarlosAlbertoEnciso wrote: @Michael137, @dwblaikie Thanks for your feedback. https://github.com/llvm/llvm-project/pull/130255 ___ 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 Carlos Alberto Enciso via cfe-commits
CarlosAlbertoEnciso wrote: > What sort of features are you picturing building with this? > Automatic type promotion: when displaying an object through a base pointer the debugger wants to still be able to show the object’s state. https://github.com/llvm/llvm-project/pull/130255 ___

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

2025-03-14 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `arc-builder` running on `arc-worker` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/3/builds/13089 Here is the relevant piece of

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

2025-03-14 Thread Carlos Alberto Enciso via cfe-commits
CarlosAlbertoEnciso wrote: > The DWARF currently provides access to the vtable location for /instances/ of > the class, so curious what the distinction/need is for doing this from the > class, without instances? > > > Previously, this had to be done by searching for ELF symbols with matching

[clang] [clang] Fix a segfault when M is a nullptr (PR #130712)

2025-03-14 Thread via cfe-commits
@@ -0,0 +1,35 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: split-file %s %t + +// There are two requirements here to result in the owner of a macro being null. +// 1) There must be a configuration mismatch between a header and a file it depends on +// 2) -fmodules-local-s

[clang] [clang] Fix a segfault when M is a nullptr (PR #130712)

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/130712

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

2025-03-14 Thread Carlos Alberto Enciso via cfe-commits
CarlosAlbertoEnciso wrote: > The DWARF currently provides access to the vtable location for /instances/ of > the class, so curious what the distinction/need is for doing this from the > class, without instances? > The need to be done for the class is to give the debugger extra information ab

[clang] [RISCV][Sema] Add feature check for target attribute to VSETVL intrinsics (PR #126064)

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

[clang] [Clang][CodeGen] Do not set inbounds flag in `EmitMemberDataPointerAddress` when the base pointer is null (PR #130952)

2025-03-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yingwei Zheng (dtcxzyw) Changes See also https://github.com/llvm/llvm-project/pull/130734 for the original motivation. This pattern (`container_of`) is also widely used by real-world programs. Examples: https://github.com/llvm/llvm-projec

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

2025-03-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-directx @llvm/pr-subscribers-clang-driver Author: Deric C. (Icohedron) Changes Fixes #112270 Completed ACs: - `-res-may-alias` clang-dxc command-line option added - It inserts and sets a module metadata flag `dx.resmayalias` to 1 - Shader flag

[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 updated https://github.com/llvm/llvm-project/pull/131296 >From d9d8e52c91a8c8132d3f5384838bea0bc51a64e3 Mon Sep 17 00:00:00 2001 From: Maxim Zhukov Date: Fri, 14 Mar 2025 12:12:25 +0300 Subject: [PATCH 1/2] [sanitizer][CFI] Add support to build CFI with saniti

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

2025-03-14 Thread Ilya Biryukov 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] [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] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- EntryPointStats.cpp --===// +// +// 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: Apach

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

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ARM][Clang] Make `+nosimd` functional for AArch32 Targets (PR #130623)

2025-03-14 Thread David Green via cfe-commits
davemgreen wrote: NEON is never mandatory AFAIU in the architecture (FP too). We might assume it to be present though, as I believe it comes from the default -mfpu. (For example FK_CRYPTO_NEON_FP_ARMV8 from armv8-a). Using something like this: https://godbolt.org/z/EKEMsaMdW. If I take this p

[clang-tools-extra] e4a8969 - [clang-tidy] Avoid processing declarations in system headers (#128150)

2025-03-14 Thread via cfe-commits
Author: Carlos Galvez Date: 2025-03-14T13:16:17+01:00 New Revision: e4a8969e56572371201863594b3a549de2e23f32 URL: https://github.com/llvm/llvm-project/commit/e4a8969e56572371201863594b3a549de2e23f32 DIFF: https://github.com/llvm/llvm-project/commit/e4a8969e56572371201863594b3a549de2e23f32.diff

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

2025-03-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/130985 ___ 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 new check bugprone-capture-this-by-field (PR #130297)

2025-03-14 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,36 @@ +.. title:: clang-tidy - bugprone-capturing-this-in-member-variable + +bugprone-capturing-this-in-member-variable +== + +Finds lambda captures that capture the ``this`` pointer and store it as class +members without handle t

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

2025-03-14 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,36 @@ +.. title:: clang-tidy - bugprone-capturing-this-in-member-variable + +bugprone-capturing-this-in-member-variable +== + +Finds lambda captures that capture the ``this`` pointer and store it as class +members without handle t

[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/7] [NFC][analyzer] Framework for multipart chec

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

2025-03-14 Thread via cfe-commits
https://github.com/offsetof 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] Add diagnostic for unresolved using declaration that shadows template parameters (PR #131328)

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

[clang] [clang] Fix inaccurate wording of warn_second_arg_of_va_start_not_last_named_param (PR #131238)

2025-03-14 Thread Erich Keane via cfe-commits
@@ -4893,7 +4893,7 @@ bool Sema::BuiltinVAStart(unsigned BuiltinID, CallExpr *TheCall) { if (!SecondArgIsLastNamedArgument) Diag(TheCall->getArg(1)->getBeginLoc(), - diag::warn_second_arg_of_va_start_not_last_named_param); erichkeane wrote: I w

[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 requested changes to this pull request. I try to use it. The matcher for single and multiple is unclear. It can give more clear matcher results. ``` AST_MATCHER_P(CompoundStmt, hasMultiple, ast_matchers::internal::Matcher, InnerMatcher) { size_t Cnt

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

2025-03-14 Thread Donát Nagy via cfe-commits
@@ -116,6 +116,19 @@ class CheckerNameRef { operator StringRef() const { return Name; } }; +/// A single checker class (and its singleton instance) can act as the +/// implementation of several (user-facing or modeling) checker parts that +/// have shared state and logic, bu

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

2025-03-14 Thread Donát Nagy 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] [clang] Fix darwin-related tests' REQUIRES annotation (PR #130138)

2025-03-14 Thread Lucas Duarte Prates via cfe-commits
https://github.com/pratlucas updated https://github.com/llvm/llvm-project/pull/130138 >From 38416f49595abf2e36ac017523504fc198c7acdb Mon Sep 17 00:00:00 2001 From: Lucas Prates Date: Thu, 6 Mar 2025 16:10:40 + Subject: [PATCH 1/2] [clang] Fix darwin-related tests' REQUIRES annotation The t

[clang] [Tooling] Avoid repeated hash lookups (NFC) (PR #131264)

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

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

2025-03-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/131166 >From 92e26f7fd99774ea9716389d3108547dbb878f90 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 13 Mar 2025 12:24:18 -0400 Subject: [PATCH 1/7] [C23] Add __builtin_c23_va_start This builtin is suppo

[clang] [clang] Fix darwin-related tests' REQUIRES annotation (PR #130138)

2025-03-14 Thread Lucas Duarte Prates via cfe-commits
pratlucas wrote: > I am ok with the fix but it will be good to update the REQUIRES to cover > MacOSX target as well. I've updated the annotations to cover MacOSX too. https://github.com/llvm/llvm-project/pull/130138 ___ cfe-commits mailing list cfe-c

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -2750,7 +2759,7 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { std::vector ArgElemTypes; std::vector Args; llvm::BitVector ResultTypeRequiresCast; - llvm::BitVector ResultRegIsFlagReg; + std::vector ResultRegIsFlagReg; uweigand wrote: Agai

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -12118,12 +12117,13 @@ void SelectionDAGBuilder::lowerWorkItem(SwitchWorkListItem W, Value *Cond, SDValue CondLHS = getValue(Cond); EVT VT = CondLHS.getValueType(); SDLoc DL = getCurSDLoc(); +SDValue Cond; SDValue Or = DAG.getNode(

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -2601,7 +2601,7 @@ EmitAsmStores(CodeGenFunction &CGF, const AsmStmt &S, const llvm::ArrayRef ResultRegDests, const llvm::ArrayRef ResultRegQualTys, const llvm::BitVector &ResultTypeRequiresCast, - const llvm::BitVector

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -2621,9 +2621,18 @@ EmitAsmStores(CodeGenFunction &CGF, const AsmStmt &S, if ((i < ResultRegIsFlagReg.size()) && ResultRegIsFlagReg[i]) { // Target must guarantee the Value `Tmp` here is lowered to a boolean // value. - llvm::Constant *Two = llvm::Consta

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -1228,6 +1238,7 @@ class TargetInfo : public TransferrableTargetInfo, std::string &/*SuggestedModifier*/) const { return true; } + uweigand wrote: This shouldn't be here. https://github.com/llvm/llvm-project/pull/125970 _

[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 6ecbeba21b4d9e2309b0468a90387e7c890ce109 Mon Sep 17 00:00:00 2001 From: Imad Aldij Date: Fri, 14 Mar 2025 17:58:07 +0200 Subject: [PATCH] [Clang] Rename SecondArgIsLastNamedArgument for clarity and consistenc

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

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 841f4637a078ce9adc5ef45f533a43bf7fbc7fc7 3f4932668ba8b8f74136dc297f98f0f9494da90e --e

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -756,7 +768,11 @@ class SystemZTargetLowering : public TargetLowering { SDValue combineINT_TO_FP(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineBSWAP(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineBR_CCMASK(SDNode *N, DAGCombinerInfo &DCI) const; + std

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -8030,7 +8077,431 @@ SDValue SystemZTargetLowering::combineBSWAP( return SDValue(); } +// Combine IPM sequence for flag output operands. +static bool combineSRL_IPM_CCMask(SDValue &CCReg, int &CCValid, int &CCMask) { + // Convert CCVal to CCMask and update it along with

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -24,6 +24,7 @@ #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/IntrinsicsS390.h" +#include "llvm/IR/PatternMatch.h" uweigand wrote: Is this really still necessary? https://github.com/llvm/llvm-project/pull/125970 __

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -8113,10 +8583,151 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) { CCReg = IPM->getOperand(0); return true; } - uweigand wrote: These shouldn't be here. https://github.com/llvm/llvm-project/pull/125970 _

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -8113,10 +8583,151 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) { CCReg = IPM->getOperand(0); return true; } - return false; } +std::optional +SystemZTargetLowering::combineSELECT_CC_CCIPMMask(SDNode *N, +

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -8030,7 +8077,431 @@ SDValue SystemZTargetLowering::combineBSWAP( return SDValue(); } +// Combine IPM sequence for flag output operands. +static bool combineSRL_IPM_CCMask(SDValue &CCReg, int &CCValid, int &CCMask) { + // Convert CCVal to CCMask and update it along with

[clang] Avoid Assertion Failure Using -fcs-profile-generate with distributed thin-lto (PR #129736)

2025-03-14 Thread Nuri Amari via cfe-commits
@@ -6,7 +6,7 @@ ; RUN: opt -thinlto-bc -o %t.o %s ; RUN: %clang_cc1 -triple x86_64-grtev4-linux-gnu \ -; RUN: -fthinlto-index=%S/Inputs/thinlto-distributed-backend-skip.bc \ +; RUN: -fthinlto-index=%S/../Inputs/thinlto-distributed-backend-skip.bc \ NuriAma

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -2757,6 +2797,21 @@ static unsigned CCMaskForCondCode(ISD::CondCode CC) { #undef CONV } +static unsigned CCMaskForSystemZCCVal(unsigned CC) { uweigand wrote: I don't think this is needed, this is simply `1 << (3 - CC)` or something. You have similar code

[clang] Avoid Assertion Failure Using -fcs-profile-generate with distributed thin-lto (PR #129736)

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

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -98,6 +98,15 @@ bool SystemZTargetInfo::validateAsmConstraint( case 'T': // Likewise, plus an index Info.setAllowsMemory(); return true; + case '@': +// CC condition changes. +if (StringRef(Name) == "@cc") { + Name += 2; + Info.setAllowsRegister(

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -1188,6 +1190,14 @@ class TargetInfo : public TransferrableTargetInfo, TiedOperand = N; // Don't copy Name or constraint string. } + +// CC range can be set by target. SystemZ sets it to 4. It is 2 by default. uweigand wrote: Comment is

[clang] [llvm] Add support for flag output operand "=@cc" for SystemZ. (PR #125970)

2025-03-14 Thread Ulrich Weigand via cfe-commits
@@ -8030,7 +8077,431 @@ SDValue SystemZTargetLowering::combineBSWAP( return SDValue(); } +// Combine IPM sequence for flag output operands. +static bool combineSRL_IPM_CCMask(SDValue &CCReg, int &CCValid, int &CCMask) { + // Convert CCVal to CCMask and update it along with

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

2025-03-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/130297 >From 8ef214f6c78d710dbd9c74b06c7c637baf93e527 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 8 Mar 2025 00:03:39 +0800 Subject: [PATCH 01/10] [clang-tidy] Add new check bugprone-capture-this-by-fie

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

2025-03-14 Thread via cfe-commits
https://github.com/juru1234 updated https://github.com/llvm/llvm-project/pull/128221 >From cd56aabf6f9ceaddf487379edf88279b1a7f7b66 Mon Sep 17 00:00:00 2001 From: Julian Ruess Date: Fri, 21 Feb 2025 20:42:46 +0100 Subject: [PATCH] [clang-tidy] Add an option to treat warnings as errors This pat

[clang] [clang][analyzer] Add BugReporterVisitor messages for non-null fixed pointer (PR #129557)

2025-03-14 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/129557 From 8006fde8ad615dffcaf38bc017b58d6bbed59ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 3 Mar 2025 17:57:19 +0100 Subject: [PATCH 1/4] [clang][analyzer] Add BugReporterVisito

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

2025-03-14 Thread via cfe-commits
cor3ntin wrote: I don't think this resolves the original issue. Part of the problem is that we are missing a diagnostic saying the implicit constructor is deleted. https://github.com/llvm/llvm-project/pull/131320 ___ cfe-commits mailing list cfe-com

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

2025-03-14 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited 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] [clang] Fix inaccurate wording of warn_second_arg_of_va_start_not_last_named_param (PR #131238)

2025-03-14 Thread via cfe-commits
github-actions[bot] wrote: @imdj Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build, yo

[clang] b436206 - [clang] Fix inaccurate wording of warn_second_arg_of_va_start_not_last_named_param (#131238)

2025-03-14 Thread via cfe-commits
Author: Imad Aldij Date: 2025-03-14T09:50:40-04:00 New Revision: b43620661d16c78c9fc5d4c1cfdb5340157c13e1 URL: https://github.com/llvm/llvm-project/commit/b43620661d16c78c9fc5d4c1cfdb5340157c13e1 DIFF: https://github.com/llvm/llvm-project/commit/b43620661d16c78c9fc5d4c1cfdb5340157c13e1.diff LO

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

2025-03-14 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur approved this pull request. LGTM 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] [clang][docs] Reflect the implementation status for P2280R4 (PR #127166)

2025-03-14 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127166 >From a2fc3d0550ab22e1a4273dc2debfda23df7cad6f Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 14 Feb 2025 14:03:23 +0800 Subject: [PATCH 1/4] [clang][docs] Fix DR staus for P2280R4 P2280R4 is offi

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

2025-03-14 Thread Erich Keane via cfe-commits
https://github.com/erichkeane 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-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

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

2025-03-14 Thread Erich Keane 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()); erichkeane wrote: T

[clang] [clang] Remove usage of llvm-spirv in clang LIT tests (PR #131158)

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

[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 updated https://github.com/llvm/llvm-project/pull/131296 >From e9f6a1ce9bcef9deb698469bc8860632fd1cb3c7 Mon Sep 17 00:00:00 2001 From: Maxim Zhukov Date: Fri, 14 Mar 2025 12:12:25 +0300 Subject: [PATCH] [sanitizer][CFI] Add support to build CFI with sanitize-c

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

2025-03-14 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/95004 >From c3b6943c236990c9f0ba363b4335b3c0e048ef2c Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 10 Jun 2024 16:54:02 +0100 Subject: [PATCH 1/2] [clang] Add value_type attr, use it to add noalias when pass-by-

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

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

2025-03-14 Thread Ben Langmuir via cfe-commits
@@ -0,0 +1,44 @@ +//===--===// +// +// 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: Apac

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

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

2025-03-14 Thread Donát Nagy 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] [C2y] Claim conformance to WG14 N3460 (PR #131196)

2025-03-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/131196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [Coverage] Fix region termination for GNU statement expressions (PR #130976)

2025-03-14 Thread Justin Cady via cfe-commits
https://github.com/justincady updated https://github.com/llvm/llvm-project/pull/130976 >From 6f3557780d06d6a2b1a7f315c49a3ad533d821e5 Mon Sep 17 00:00:00 2001 From: Justin Cady Date: Wed, 12 Mar 2025 11:23:19 -0400 Subject: [PATCH 1/2] [Coverage] Fix region termination for GNU statement expres

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

2025-03-14 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,79 @@ +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s + +unsigned char cxxstaticcast_0(unsigned int x) { + return static_cast(x); +} + +// CHECK: cir.func @cxxstaticcast_0 +// C

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

2025-03-14 Thread Björn Schäpers via cfe-commits
@@ -2031,6 +2031,7 @@ class SourceManagerForFile { // The order of these fields are important - they should be in the same order // as they are created in `createSourceManagerForFile` so that they can be // deleted in the reverse order as they are created. + std::string

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

2025-03-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (NewSigma) Changes Fix #129411 --- Full diff: https://github.com/llvm/llvm-project/pull/131328.diff 3 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (+1) - (modified) clang/lib/Sema/SemaDeclCXX.cpp (+4) - (modified) cl

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

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

[clang] [clang-tools-extra] [clang][dataflow] For bugprone-unchecked-optional-access report range (PR #131055)

2025-03-14 Thread Jan Voung via cfe-commits
jvoung wrote: Ah yes! Added an expectation annotation for ranges and a test case. https://github.com/llvm/llvm-project/pull/131055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[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/5] [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
https://github.com/CarlosAlbertoEnciso updated https://github.com/llvm/llvm-project/pull/130255 >From 4bd0c48e12114301d8b81e9abe59e538684a6f71 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Enciso Date: Tue, 25 Feb 2025 09:23:24 + Subject: [PATCH 1/2] [DebugInfo] Add symbol for debugger with

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

[clang] [OffloadBundler] Expose function to parse compressed bundle headers (PR #130284)

2025-03-14 Thread Juan Manuel Martinez Caamaño via cfe-commits
@@ -1121,13 +1122,116 @@ CompressedOffloadBundle::compress(llvm::compression::Params P, llvm::StringRef(FinalBuffer.data(), FinalBuffer.size())); } +// Use packed structs to avoid padding, such that the structs map the serialized +// format. +LLVM_PACKED_START +union R

[clang] [Tooling] Avoid repeated hash lookups (NFC) (PR #131264)

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

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

2025-03-14 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/131263 ___ 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
@@ -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] [clang] Fix darwin-related tests' REQUIRES annotation (PR #130138)

2025-03-14 Thread Lucas Duarte Prates via cfe-commits
@@ -18,7 +18,7 @@ // RUN: c-index-test -test-load-source local %s -include %t.clang.h -fmodules -fmodules-cache-path=%t.mcp -Xclang -triple -Xclang x86_64-apple-darwin | FileCheck %s // FIXME: Still fails on at least some linux boxen. -// REQUIRES: system-darwin +// REQUIRES

[clang] 4acfeaf - [Tooling] Avoid repeated hash lookups (NFC) (#131264)

2025-03-14 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-03-14T07:20:54-07:00 New Revision: 4acfeafd8fa46f22e449b24a49c128a312f900fb URL: https://github.com/llvm/llvm-project/commit/4acfeafd8fa46f22e449b24a49c128a312f900fb DIFF: https://github.com/llvm/llvm-project/commit/4acfeafd8fa46f22e449b24a49c128a312f900fb.diff L

[clang] [clang][docs] Reflect the implementation status for P2280R4 (PR #127166)

2025-03-14 Thread Vlad Serebrennikov via cfe-commits
@@ -1,6 +1,8 @@ // RUN: %clang_cc1 -std=c++23 -verify=expected,nointerpreter %s // RUN: %clang_cc1 -std=c++23 -verify %s -fexperimental-new-constant-interpreter +// FIXME: P2280R4 should be backported. Run this in C++11 and later modes. Endilll wrote: On top

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

2025-03-14 Thread Arseniy Zaostrovnykh 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", necto wrote:

[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] [analyzer] Introduce per-entry-point statistics (PR #131175)

2025-03-14 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -0,0 +1,201 @@ +//===- EntryPointStats.cpp --===// +// +// 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: Apach

<    1   2   3   4   >