[clang] [clang] Fix __builtin_mul_overflow for big _BitInts (PR #145497)

2025-06-24 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon created https://github.com/llvm/llvm-project/pull/145497 For long enough _BitInt types we use different types for memory, storing-loading and operations. Makes sure it is correct for mixed sign __builtin_mul_overflow cases. Using pointer element type as a result ty

[clang] [clang][RISCV] Fix crash on VLS calling convention (PR #145489)

2025-06-24 Thread Pengcheng Wang via cfe-commits
@@ -143,52 +143,82 @@ void __attribute__((riscv_vls_cc)) test_too_large(int32x64_t arg) {} // CHECK-LLVM: define dso_local riscv_vls_cc(256) void @test_too_large_256( noundef %arg.coerce) void __attribute__((riscv_vls_cc(256))) test_too_large_256(int32x64_t arg) {} -// CHECK

[clang] [clang][RISCV] Fix crash on VLS calling convention (PR #145489)

2025-06-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Brandon Wu (4vtomat) Changes This patch handle struct of fixed vector and struct of array of fixed vector correctly for VLS calling convention in EmitFunctionProlog, EmitFunctionEpilog and EmitCall. --- Full diff: https://github.

[clang] [analyzer] Enforce not making overly complicated symbols (PR #144327)

2025-06-24 Thread Balázs Benics via cfe-commits
@@ -46,7 +50,7 @@ class SymbolRegionValue : public SymbolData { friend class SymExprAllocator; SymbolRegionValue(SymbolID sym, const TypedValueRegion *r) - : SymbolData(SymbolRegionValueKind, sym), R(r) { + : SymbolData(ClassKind, sym), R(r) { ba

[clang] [win][clang] Align scalar deleting destructors with MSABI (PR #139566)

2025-06-24 Thread Mariya Podchishchaeva via cfe-commits
@@ -2886,6 +2887,16 @@ class CXXDestructorDecl : public CXXMethodDecl { return getCanonicalDecl()->OperatorDelete; } + const FunctionDecl *getOperatorGlobalDelete() const { +return getCanonicalDecl()->OperatorGlobalDelete; + } + + void setOperatorGlobalDelete(Func

[clang] [analyzer] Enforce not making overly complicated symbols (PR #144327)

2025-06-24 Thread Donát Nagy via cfe-commits
@@ -46,7 +50,7 @@ class SymbolRegionValue : public SymbolData { friend class SymExprAllocator; SymbolRegionValue(SymbolID sym, const TypedValueRegion *r) - : SymbolData(SymbolRegionValueKind, sym), R(r) { + : SymbolData(ClassKind, sym), R(r) { Na

[clang] [clang] Fix __builtin_mul_overflow for big _BitInts (PR #145497)

2025-06-24 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon edited https://github.com/llvm/llvm-project/pull/145497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] Atomic ops atoms (PR #141624)

2025-06-24 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/141624 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] Atomic ops atoms (PR #141624)

2025-06-24 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,162 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -x c++ -std=c++17 %s -debug-info-kind=line-tables-only -emit-llvm -o - -gno-column-info \ +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank +// RUN: %clang_cc1 -

[clang] [clang-format] Handle Trailing Whitespace After Line Continuation (P2223R2) (PR #145243)

2025-06-24 Thread Owen Pan via cfe-commits
@@ -1205,14 +1206,23 @@ static size_t countLeadingWhitespace(StringRef Text) { while (Cur < End) { if (isspace(Cur[0])) { ++Cur; -} else if (Cur[0] == '\\' && (Cur[1] == '\n' || Cur[1] == '\r')) { - // A '\' followed by a newline always escapes the newline,

[clang-tools-extra] [clangd] Improve Markup Rendering (PR #140498)

2025-06-24 Thread Maksim Ivanov via cfe-commits
https://github.com/emaxx-google edited https://github.com/llvm/llvm-project/pull/140498 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Enforce not making overly complicated symbols (PR #144327)

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

[clang] [NFC] Move areCompatibleSveTypes etc. from ASTContext to SemaARM. (PR #145429)

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

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-06-24 Thread Alex Voicu via cfe-commits
@@ -0,0 +1,157 @@ +//===- AMDGPUExpandFeaturePredicates.cpp - Feature Predicate Expander Pass ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-24 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann edited https://github.com/llvm/llvm-project/pull/140282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Expose simple access to child StorageLocation presence. (PR #145520)

2025-06-24 Thread Samira Bakon via cfe-commits
https://github.com/bazuzi closed https://github.com/llvm/llvm-project/pull/145520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-06-24 Thread Tom Honermann via cfe-commits
@@ -0,0 +1,54 @@ +// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -verify %s + +// Semantic tests for sycl_external attribute + +[[clang::sycl_external]] // expected-error {{'sycl_external' can only be applied to functions with external linkage}} +static void func1() {} + +name

[clang] [analyzer] Fix crash when modelling 'getline' function in checkers (PR #145229)

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

[clang] [analyzer] Enforce not making overly complicated symbols (PR #144327)

2025-06-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: Thanks @haoNoQ for this great idea and @balazs-benics-sonarsource for the quick implementation! I'm completely satisfied with the current direction of development on this PR -- using this fresh symbol type instead of `Unknown`s and `nullopt`s and early

[clang] [llvm] [LLVM][Clang] Add and enable strict mode for `getTrailingObjects` (PR #144930)

2025-06-24 Thread Rahul Joshi via cfe-commits
jurahul wrote: Sure: The first line of the description attempts to define it: > Under strict mode, the templated getTrailingObjects can be called only when > there is > 1 trailing types. I essentially used this strict mode to find all templated calls to `getTrailingObjects` that could be conv

[clang] [llvm] [PowerPC] Support for Packed BCD conversion builtins (PR #142723)

2025-06-24 Thread Lei Huang via cfe-commits
https://github.com/lei137 approved this pull request. LGTM with nit. https://github.com/llvm/llvm-project/pull/142723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for bitfields in unions (PR #145096)

2025-06-24 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes closed https://github.com/llvm/llvm-project/pull/145096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for __builtin_expect (PR #144726)

2025-06-24 Thread Sirui Mu via cfe-commits
@@ -2446,4 +2446,41 @@ def AssumeOp : CIR_Op<"assume"> { }]; } +//===--===// +// Branch Probability Operations +//===--===// + +def ExpectO

[clang] [analyzer] Fix crash when modelling 'getline' function in checkers (PR #145229)

2025-06-24 Thread Baranov Victor via cfe-commits
@@ -1518,14 +1518,19 @@ void MallocChecker::checkGetdelim(ProgramStateRef State, const CallEvent &Call, if (!CE) return; - const auto LinePtr = - getPointeeVal(Call.getArgSVal(0), State)->getAs(); - const auto Size = - getPointeeVal(Call.getArgSVal(1), State

[clang] [analyzer] Fix crash when modelling 'getline' function in checkers (PR #145229)

2025-06-24 Thread Baranov Victor via cfe-commits
@@ -1518,14 +1518,19 @@ void MallocChecker::checkGetdelim(ProgramStateRef State, const CallEvent &Call, if (!CE) return; - const auto LinePtr = - getPointeeVal(Call.getArgSVal(0), State)->getAs(); - const auto Size = - getPointeeVal(Call.getArgSVal(1), State

[clang] [analyzer] Fix crash when modelling 'getline' function in checkers (PR #145229)

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

[clang] [Clang] Allow explicit member specialization to differ from template declaration wrt constexpr (PR #145272)

2025-06-24 Thread Erich Keane via cfe-commits
erichkeane wrote: > This attempts to fix #26078. However I have couple of fundamental questions > with the 7.1.5 consexpr note "[ Note: An explicit specialization can differ > from the template declaration with respect to the constexpr specifier. — end > note ]" Current quote: https://eel.is/

[clang] [llvm] Non constant size and offset in DWARF (PR #141106)

2025-06-24 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. Yeah, let's just go with this as a single patch. Looking closer, in retrospect/for next time, perhaps this could've been a few smaller patches (I guess the strtuct, member, and bit field member are all separate except that they depend on

[clang] [llvm] Non constant size and offset in DWARF (PR #141106)

2025-06-24 Thread David Blaikie via cfe-commits
@@ -1301,4 +1301,33 @@ TEST(DIBuilder, CompositeTypes) { EXPECT_EQ(Enum->getTag(), dwarf::DW_TAG_enumeration_type); } +TEST(DIBuilder, DynamicOffsetAndSize) { + LLVMContext Ctx; + std::unique_ptr M(new Module("MyModule", Ctx)); dwblaikie wrote: Prefer `st

[clang] [analyzer] Fix crash when modelling 'getline' function in checkers (PR #145229)

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

[clang] [llvm] Non constant size and offset in DWARF (PR #141106)

2025-06-24 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie edited https://github.com/llvm/llvm-project/pull/141106 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Support for Packed BCD conversion builtins (PR #142723)

2025-06-24 Thread Lei Huang via cfe-commits
@@ -567,6 +567,12 @@ TARGET_BUILTIN(__builtin_altivec_vextsh2w, "V4SiV8Ss", "", "power9-vector") TARGET_BUILTIN(__builtin_altivec_vextsh2d, "V2SLLiV8Ss", "", "power9-vector") TARGET_BUILTIN(__builtin_altivec_vextsw2d, "V2SLLiV4Si", "", "power9-vector") +// P9 Binary-coded dec

[clang] [Clang] Allow explicit member specialization to differ from template declaration wrt constexpr (PR #145272)

2025-06-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: it would be great to track down the history of this (https://github.com/cplusplus/draft) to see what changed around this, in case there is more we have to think about. We ALSO might be able to move the tests into the CWG issues section (though likely,

[clang] [Clang] Allow explicit member specialization to differ from template declaration wrt constexpr (PR #145272)

2025-06-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/145272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Allow explicit member specialization to differ from template declaration wrt constexpr (PR #145272)

2025-06-24 Thread Erich Keane via cfe-commits
@@ -12163,6 +12163,23 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, } } + // C++11 [dcl.constexpr]p1: An explicit specialization of a constexpr erichkeane wrote: Update this to the latest wording please! it is actually no long

[clang] 418b409 - [CIR] Add support for member initialization from constructors (#144583)

2025-06-24 Thread via cfe-commits
Author: Andy Kaylor Date: 2025-06-24T10:05:48-07:00 New Revision: 418b409df8538bdf1b4865556607c220dc139fa8 URL: https://github.com/llvm/llvm-project/commit/418b409df8538bdf1b4865556607c220dc139fa8 DIFF: https://github.com/llvm/llvm-project/commit/418b409df8538bdf1b4865556607c220dc139fa8.diff L

[clang] [analyzer] Enforce not making overly complicated symbols (PR #144327)

2025-06-24 Thread Arseniy Zaostrovnykh via cfe-commits
necto wrote: > Should I measure the perf of this change? I think so, because the patch is substantially different. For example, the overly complex symbol tree is now preserved, even if it is apparently not traversed in its entirety any longer. That makes it not obvious if the initial performa

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-24 Thread Malavika Samak via cfe-commits
https://github.com/malavikasamak updated https://github.com/llvm/llvm-project/pull/143205 >From 52e4413ea1e701dfe0b24cf957a26bb72732f066 Mon Sep 17 00:00:00 2001 From: MalavikaSamak Date: Wed, 21 May 2025 16:06:44 -0700 Subject: [PATCH 01/11] Place holder message for sizeof operator in loops.

[clang] [Clang] Allow explicit member specialization to differ from template declaration wrt constexpr (PR #145272)

2025-06-24 Thread Erich Keane via cfe-commits
@@ -12163,6 +12163,23 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, } } + // C++11 [dcl.constexpr]p1: An explicit specialization of a constexpr + // function can differ from the template declaration with respect to + // the constexpr specifier

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-24 Thread Malavika Samak via cfe-commits
@@ -353,6 +372,22 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) { diag(E->getBeginLoc(), "suspicious usage of 'sizeof(char*)'; do you mean 'strlen'?") << E->getSourceRange(); + } else if (const auto *E = Result.Nodes.getNode

[clang] [Clang] Allow explicit member specialization to differ from template declaration wrt constexpr (PR #145272)

2025-06-24 Thread Erich Keane via cfe-commits
@@ -12163,6 +12163,23 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, } } + // C++11 [dcl.constexpr]p1: An explicit specialization of a constexpr + // function can differ from the template declaration with respect to + // the constexpr specifier

[clang] [llvm] [Clang][OpenMP] Capture mapped pointers on `target` by reference. (PR #145454)

2025-06-24 Thread Abhinav Gaba via cfe-commits
@@ -8811,8 +8829,19 @@ class MappableExprsHandler { ++EI; } } -llvm::stable_sort(DeclComponentLists, [](const MapData &LHS, - const MapData &RHS) { +llvm::stable_sort(DeclComponentLists, [VD](const MapData &L

[clang] [llvm] [Clang][OpenMP] Capture mapped pointers on `target` by reference. (PR #145454)

2025-06-24 Thread Alexey Bataev via cfe-commits
@@ -8811,8 +8829,19 @@ class MappableExprsHandler { ++EI; } } -llvm::stable_sort(DeclComponentLists, [](const MapData &LHS, - const MapData &RHS) { +llvm::stable_sort(DeclComponentLists, [VD](const MapData &L

[clang] Thread Safety Analysis: Warn when using negative reentrant capability (PR #141599)

2025-06-24 Thread Aaron Ballman via cfe-commits
@@ -7223,4 +7225,10 @@ class TestNegativeWithReentrantMutex { } }; +typedef int __attribute__((capability("role"), reentrant_capability)) ThreadRole; +ThreadRole FlightControl1, FlightControl2; +void dispatch_log(const char *msg) __attribute__((requires_capability(!FlightC

[clang] [Clang] Back out the source location workaround for CXXConstructExpr (PR #145260)

2025-06-24 Thread Erich Keane via cfe-commits
@@ -98,7 +98,36 @@ namespace { CXXCastPath BasePath; bool IsARCUnbridgedCast; -SourceRange OpRange; +struct OpRangeType { + SourceLocation Ranges[3]; erichkeane wrote: This is a strange variable name here... `Ranges` for a series of locat

[clang] [CIR] Fix NYI AAPCS bit-fields by skipping unsupported case (PR #145560)

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

[clang] [clang][scan-deps] Add option to disable caching stat failures (PR #144000)

2025-06-24 Thread Qinkun Bao via cfe-commits
qinkunbao wrote: Hi, I've reverted this PR according to https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy Please feel free to revise the patch and make the title Reland "..." provide a description of what broke and how it was fixed in the new version. https://github.com/llvm/

[clang] [llvm] Test 142948, please ignore (PR #144873)

2025-06-24 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/144873 >From 704d36bdd22efd4645feaf8988e918ccfdf641a5 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Thu, 5 Jun 2025 13:40:26 +0200 Subject: [PATCH 1/5] [clang][python][test] Move python binding tests to lit fr

[clang] [clang Dependency Scanning] Enhance File Caching Diagnostics (PR #144105)

2025-06-24 Thread Jan Svoboda via cfe-commits
@@ -220,13 +221,34 @@ class DependencyScanningFilesystemSharedCache { CacheShard &getShardForFilename(StringRef Filename) const; CacheShard &getShardForUID(llvm::sys::fs::UniqueID UID) const; - /// Visits all cached entries and re-stat an entry using FS if - /// it is ne

[clang] [NFC][Clang][Preprocessor] Refine the implementation of isNextPPTokenOneOf (PR #145546)

2025-06-24 Thread Erich Keane via cfe-commits
@@ -2304,7 +2304,8 @@ class Preprocessor { /// Check whether the next pp-token is one of the specificed token kind. this /// method should have no observable side-effect on the lexed tokens. - template bool isNextPPTokenOneOf() { + template + bool isNextPPTokenOneOf(t

[clang] Suppress noreturn warning if last statement in a function is a throw (PR #145166)

2025-06-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/145166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix crash when modelling 'getline' function in checkers (PR #145229)

2025-06-24 Thread Balazs Benics via cfe-commits
@@ -1518,14 +1518,19 @@ void MallocChecker::checkGetdelim(ProgramStateRef State, const CallEvent &Call, if (!CE) return; - const auto LinePtr = - getPointeeVal(Call.getArgSVal(0), State)->getAs(); - const auto Size = - getPointeeVal(Call.getArgSVal(1), State

[clang] [llvm] [HLSL][RootSignature] Add `hlsl-rootsig-ver` option to specify root signature version (PR #144813)

2025-06-24 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/144813 >From 6af81bb12430c28f22eba073a38abd7875a2e348 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 18 Jun 2025 21:47:31 + Subject: [PATCH 1/5] [HLSL][RootSignature] Add option to specify version of RootS

[clang] [llvm] [HLSL][RootSignature] Add `hlsl-rootsig-ver` option to specify root signature version (PR #144813)

2025-06-24 Thread Justin Bogner via cfe-commits
@@ -66,17 +66,17 @@ void addDxilValVersion(StringRef ValVersionStr, llvm::Module &M) { DXILValMD->addOperand(Val); } -void addRootSignature(ArrayRef Elements, +void addRootSignature(llvm::dxbc::RootSignatureVersion RootSigVer, + ArrayRef Elements,

[clang] [llvm] [HLSL][RootSignature] Add `hlsl-rootsig-ver` option to specify root signature version (PR #144813)

2025-06-24 Thread Justin Bogner via cfe-commits
@@ -5188,16 +5191,20 @@ class HLSLRootSignatureDecl final } HLSLRootSignatureDecl(DeclContext *DC, SourceLocation Loc, IdentifierInfo *ID, +llvm::dxbc::RootSignatureVersion Verison, bogner wrote: ```suggestion

[clang] [llvm] [HLSL][RootSignature] Add `hlsl-rootsig-ver` option to specify root signature version (PR #144813)

2025-06-24 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/144813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add `hlsl-rootsig-ver` option to specify root signature version (PR #144813)

2025-06-24 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. Looks good. A few minor comments below. https://github.com/llvm/llvm-project/pull/144813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [clang][dataflow] Expose simple access to child StorageLocation presence. (PR #145520)

2025-06-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis @llvm/pr-subscribers-clang Author: Samira Bakon (bazuzi) Changes `getChild` does not offer this knowledge, and a map lookup is significantly cheaper than iteration over `children()`. --- Full diff: https://github.com/llvm/llvm-project/pu

[clang] [Analysis] Avoid some warnings about exit from noreturn function (PR #144408)

2025-06-24 Thread Erich Keane via cfe-commits
@@ -399,6 +401,145 @@ static bool isNoexcept(const FunctionDecl *FD) { return false; } +/// Checks if the given variable, which is assumed to be a function pointer, is +/// initialized with a function having 'noreturn' attribute. +static bool isInitializedWithNoReturn(const

[clang] [llvm] [LLVM][Clang] Add and enable strict mode for `getTrailingObjects` (PR #144930)

2025-06-24 Thread Erich Keane via cfe-commits
erichkeane wrote: > Just to be precise, it's not the number of items but the number of trailing > types. I half expected the comment to make it a different function. I'll do > that Ah right, I was using 'items' to mean 'types' too, so we were clear there :) Sorry for my lack of precision. h

[clang] [llvm] [PowerPC] Add BCDCOPYSIGN and BCDSETSIGN Instruction Support (PR #144874)

2025-06-24 Thread Aditi Medhane via cfe-commits
@@ -515,6 +515,10 @@ TARGET_BUILTIN(__builtin_altivec_vctzh, "V8UsV8Us", "", "power9-vector") TARGET_BUILTIN(__builtin_altivec_vctzw, "V4UiV4Ui", "", "power9-vector") TARGET_BUILTIN(__builtin_altivec_vctzd, "V2ULLiV2ULLi", "", "power9-vector") +//P9 BCD builtins +TARGET_BUILT

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-06-24 Thread Alex Voicu via cfe-commits
@@ -0,0 +1,157 @@ +//===- AMDGPUExpandFeaturePredicates.cpp - Feature Predicate Expander Pass ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang-format] Handle Trailing Whitespace After Line Continuation (P2223R2) (PR #145243)

2025-06-24 Thread Naveen Seth Hanig via cfe-commits
https://github.com/naveen-seth edited https://github.com/llvm/llvm-project/pull/145243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Enforce not making overly complicated symbols (PR #144327)

2025-06-24 Thread Balázs Benics via cfe-commits
@@ -134,6 +137,101 @@ class SymbolConjured : public SymbolData { static constexpr bool classof(Kind K) { return K == ClassKind; } }; +/// A symbol representing the result of an expression that became too +/// complicated. In other words, its complexity would have surpassed t

[clang] [analyzer] Fix crash when modelling 'getline' function in checkers (PR #145229)

2025-06-24 Thread Baranov Victor via cfe-commits
vbvictor wrote: Also updated names of function in `MallocChecker` to match corresponding functions names in `UnixApiChecker` https://github.com/llvm/llvm-project/pull/145229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [Clang] Diagnose unsatisfied `std::is_assignable`. (PR #144836)

2025-06-24 Thread Erich Keane via cfe-commits
erichkeane wrote: > Thanks! Could I also have one of you merge this for me once everybody's > happy? 🙏 Ah, a little late in my day to be doing that (the 'click merge and take off' strat is one fraught with error :) ), but if no one else has by my morning, I'll do so. https://github.com/llvm/

[clang] [clang][Preprocessor] Handle the first pp-token in EnterMainSourceFile (PR #145244)

2025-06-24 Thread via cfe-commits
@@ -351,7 +351,7 @@ class Preprocessor { bool LastTokenWasAt = false; /// First pp-token in current translation unit. yronglin wrote: Good catch! Updated. https://github.com/llvm/llvm-project/pull/145244 ___ cf

[clang] [clang] Fix __builtin_mul_overflow for big _BitInts (PR #145497)

2025-06-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mariya Podchishchaeva (Fznamznon) Changes For long enough _BitInt types we use different types for memory, storing-loading and operations. Makes sure it is correct for mixed sign __builtin_mul_overflow cases. Using pointer element type as

[clang] [CIR] Restore the underscore in dso_local (PR #145551)

2025-06-24 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/145551 The CIR handling of `dso_local` for globals was upstreamed without the underscore, making it inconsistent with the incubator and LLVM IR. This change restores the underscore. >From f3927e3fd07cad46f183e4341

[clang] [X86] [clang] Add missing check line for diamondrapids (NFC) (PR #145542)

2025-06-24 Thread Evgenii Kudriashov via cfe-commits
https://github.com/e-kud edited https://github.com/llvm/llvm-project/pull/145542 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix __builtin_mul_overflow for big _BitInts (PR #145497)

2025-06-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Mariya Podchishchaeva (Fznamznon) Changes For long enough _BitInt types we use different types for memory, storing-loading and operations. Makes sure it is correct for mixed sign __builtin_mul_overflow cases. Using pointer element

[clang] [clang Dependency Scanning] Enhance File Caching Diagnostics (PR #144105)

2025-06-24 Thread Qiongsi Wu via cfe-commits
@@ -220,13 +221,34 @@ class DependencyScanningFilesystemSharedCache { CacheShard &getShardForFilename(StringRef Filename) const; CacheShard &getShardForUID(llvm::sys::fs::UniqueID UID) const; - /// Visits all cached entries and re-stat an entry using FS if - /// it is ne

[clang] [CIR] Add support for function linkage and visibility (PR #145600)

2025-06-24 Thread Erich Keane via cfe-commits
@@ -406,14 +406,34 @@ void CIRGenModule::emitGlobalFunctionDefinition(clang::GlobalDecl gd, /*DontDefer=*/true, ForDefinition); } + // Already emitted. + if (!funcOp.isDeclaration()) erichkeane wrote: So this was a little j

[clang] [CIR] Add support for function linkage and visibility (PR #145600)

2025-06-24 Thread Erich Keane via cfe-commits
@@ -170,6 +187,26 @@ static bool omitRegionTerm(mlir::Region &r) { return singleNonEmptyBlock && yieldsNothing(); } +void printVisibilityAttr(OpAsmPrinter &printer, + cir::VisibilityAttr &visibility) { + switch (visibility.getValue()) { + case cir::

[clang] [CIR] Add support for function linkage and visibility (PR #145600)

2025-06-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/145600 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Add option -msve-streaming-vector-bits= . (PR #144611)

2025-06-24 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/144611 >From c28804a471a9fe6be24479ffbfd7d4aa6c774125 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 17 Jun 2025 11:48:47 -0700 Subject: [PATCH 1/4] [AArch64] Add option -msve-streaming-vector-bits= . Th

[clang] [clang-format] Handle Trailing Whitespace After Line Continuation (P2223R2) (PR #145243)

2025-06-24 Thread Naveen Seth Hanig via cfe-commits
@@ -25768,6 +25768,29 @@ TEST_F(FormatTest, OperatorPassedAsAFunctionPtr) { verifyFormat("foo(operator, , -42);", Style); } +TEST_F(FormatTest, LineSpliceWithTrailingWhitespace) { + // Test that each sequence of a backslash (\) immediately followed by zero or + // more hor

[clang] [llvm] Pass TargetMachine from from Clang to `BitcodeWriter`and `ThinLTOBitcodeWriter` pass for thin and fat LTO respectively. (PR #143692)

2025-06-24 Thread Thomas Weißschuh via cfe-commits
t-8ch wrote: This does works for the compilation step, for me it isn't sufficient to link the resulting object file: ```sh $ clang -I ./include -c ./src/use_macro.c -flto # Fixed by this PR $ ld.lld use_macro.o ld.lld: error: :1:10: Could not find include file 'macro.s' .include "macro.s"

[clang] [llvm] [HLSL][DXIL] Implement `refract` intrinsic (PR #136026)

2025-06-24 Thread Sarah Spall via cfe-commits
@@ -16,88 +16,90 @@ namespace clang { SemaSPIRV::SemaSPIRV(Sema &S) : SemaBase(S) {} +/// Checks if the first `NumArgsToCheck` arguments of a function call are of +/// vector type. If any of the arguments is not a vector type, it emits a +/// diagnostic error and returns `tru

[clang] [clang-format] Handle Trailing Whitespace After Line Continuation (P2223R2) (PR #145243)

2025-06-24 Thread Naveen Seth Hanig via cfe-commits
@@ -1295,13 +1305,18 @@ FormatToken *FormatTokenLexer::getNextToken() { case '/': // The text was entirely whitespace when this loop was entered. Thus // this has to be an escape sequence. -assert(Text.substr(i, 2) == "\\\r" || Text.substr(i, 2) ==

[clang] e8976e9 - [clang][Preprocessor] Add peekNextPPToken, makes look ahead next token without side-effects (#143898)

2025-06-24 Thread via cfe-commits
Author: yronglin Date: 2025-06-24T18:55:21+08:00 New Revision: e8976e92f655f8c358081ffae01e10ea159cd37d URL: https://github.com/llvm/llvm-project/commit/e8976e92f655f8c358081ffae01e10ea159cd37d DIFF: https://github.com/llvm/llvm-project/commit/e8976e92f655f8c358081ffae01e10ea159cd37d.diff LOG:

[clang] [clang][Preprocessor] Handle the first pp-token in EnterMainSourceFile (PR #145244)

2025-06-24 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/145244 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][RISCV] Fix crash on VLS calling convention (PR #145489)

2025-06-24 Thread Brandon Wu via cfe-commits
@@ -143,52 +143,82 @@ void __attribute__((riscv_vls_cc)) test_too_large(int32x64_t arg) {} // CHECK-LLVM: define dso_local riscv_vls_cc(256) void @test_too_large_256( noundef %arg.coerce) void __attribute__((riscv_vls_cc(256))) test_too_large_256(int32x64_t arg) {} -// CHECK

[clang] [clang-tools-extra] [clang-tidy] `bugprone-unchecked-optional-access`: handle `BloombergLP::bdlb:NullableValue::makeValue` to prevent false-positives (PR #144313)

2025-06-24 Thread Baranov Victor via cfe-commits
@@ -985,6 +985,20 @@ auto buildTransferMatchSwitch() { isOptionalMemberCallWithNameMatcher(hasName("isNull")), transferOptionalIsNullCall) + // NullableValue::makeValue, NullableValue::makeValueInplace + // Only NullableValue has these methods, bu

[clang] [clang-tools-extra] [clang-tidy] `bugprone-unchecked-optional-access`: handle `BloombergLP::bdlb:NullableValue::makeValue` to prevent false-positives (PR #144313)

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

[clang] [llvm] [PowerPC] Add BCDCOPYSIGN and BCDSETSIGN Instruction Support (PR #144874)

2025-06-24 Thread Aditi Medhane via cfe-commits
https://github.com/AditiRM edited https://github.com/llvm/llvm-project/pull/144874 ___ 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 `readability-use-numeric-limits` (PR #127430)

2025-06-24 Thread via cfe-commits
earnol wrote: For C the macro constants from limits.h can be used: `UCHAR_MAX` instead of `std::numeric_limits::max()`. Please refer to https://en.cppreference.com/w/c/header/limits. Please also check compatibility requirement because list of available constants depends on the selected standa

[clang] [clang][analyzer] fix crash when modelling 'getline' function in checkers (PR #145229)

2025-06-24 Thread Baranov Victor via cfe-commits
vbvictor wrote: > I would prefer keeping this bugfix and that internal architectural > improvement in two separate commits if that isn't too much trouble. Yes, making `Signature` class should be a separate refactor change. I think we should come to a consensus in which checks (or a subset of f

[clang] [llvm] [Clang][OpenMP] Capture mapped pointers on `target` by reference. (PR #145454)

2025-06-24 Thread Alexey Bataev via cfe-commits
@@ -8811,8 +8829,19 @@ class MappableExprsHandler { ++EI; } } -llvm::stable_sort(DeclComponentLists, [](const MapData &LHS, - const MapData &RHS) { +llvm::stable_sort(DeclComponentLists, [VD](const MapData &L

[clang] [clang][analyzer] fix crash when modelling 'getline' function in checkers (PR #145229)

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

[clang] [clang-tools-extra] [flang] [libc] [libcxx] [lldb] [llvm] [mlir] Rsan (PR #145540)

2025-06-24 Thread via cfe-commits
Martin =?utf-8?q?Storsjö?= ,Hubert Tong ,Tom Stellard ,Tom Stellard ,Tom Stellard ,David Green ,Sam Tebbs , =?utf-8?q?Michał_Górny?= , =?utf-8?q?Michał_Górny?= ,Ben Langmuir ,Vitaly Buka ,Ben Langmuir ,Florian Hahn ,Tom Stellard ,Brad Smith ,Benjamin Maxwell ,Alexandros Lamprineas ,Tom Stel

[clang] [clang][analyzer] fix crash when modelling 'getline' function in checkers (PR #145229)

2025-06-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/145229 >From ba9f1edfc2ea1fb1e41366721ccbf795ec998707 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 23 Jun 2025 23:55:57 +0300 Subject: [PATCH 1/5] [clang][analyzer] fix crash when modelling 'getline' func

[clang] [analyzer][NFC] Make SymExpr::classof methods constexpr (PR #145526)

2025-06-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. https://github.com/llvm/llvm-project/pull/145526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-06-24 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,157 @@ +//===- AMDGPUExpandFeaturePredicates.cpp - Feature Predicate Expander Pass ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang] Check constexpr int->enum conversions consistently. (PR #143034)

2025-06-24 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: @erichkeane already added release note in #144407; please take a look to see if it makes sense. https://github.com/llvm/llvm-project/pull/143034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [clang][RISCV] Fix crash on VLS calling convention (PR #145489)

2025-06-24 Thread Craig Topper via cfe-commits
@@ -143,52 +143,82 @@ void __attribute__((riscv_vls_cc)) test_too_large(int32x64_t arg) {} // CHECK-LLVM: define dso_local riscv_vls_cc(256) void @test_too_large_256( noundef %arg.coerce) void __attribute__((riscv_vls_cc(256))) test_too_large_256(int32x64_t arg) {} -// CHECK

[clang] [HLSL][RootSignature] Enable resource range analysis for remaining `RootElement`s (PR #145109)

2025-06-24 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/145109 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix __builtin_mul_overflow for big _BitInts (PR #145497)

2025-06-24 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/145497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for member initialization from constructors (PR #144583)

2025-06-24 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/144583 >From 79e712f0f3bd9ff64308a8dc30fb48eff2fd1706 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Mon, 16 Jun 2025 16:39:15 -0700 Subject: [PATCH 1/3] [CIR] Add support for member initialization from construct

[clang] [X86] [clang] Add missing check line for diamondrapids (PR #145542)

2025-06-24 Thread Mikołaj Piróg via cfe-commits
https://github.com/mikolaj-pirog created https://github.com/llvm/llvm-project/pull/145542 As in title. Without it, the test doesn't check for dmr From ac887983c860a3f88a38a02ec308e543bdee9bbb Mon Sep 17 00:00:00 2001 From: "Pirog, Mikolaj Maciej" Date: Tue, 24 Jun 2025 18:10:04 +0200 Subject:

  1   2   3   4   5   >