[libclc] [libclc] Make library output directories explicit (PR #146833)

2025-07-03 Thread Fraser Cormack via cfe-commits
@@ -120,14 +120,15 @@ function(link_bc) endif() add_custom_command( -OUTPUT ${ARG_TARGET}.bc -COMMAND ${llvm-link_exe} ${link_flags} -o ${ARG_TARGET}.bc ${LINK_INPUT_ARG} +OUTPUT ${LIBCLC_ARCH_OBJFILE_DIR}/${ARG_TARGET}.bc +COMMAND ${llvm-link_exe} ${link_

[clang] [analyzer] Avoid unnecessary super region invalidation in `CStringChecker` (PR #146212)

2025-07-03 Thread via cfe-commits
@@ -2223,16 +2223,81 @@ void CStringChecker::evalStrcpyCommon(CheckerContext &C, const CallEvent &Call, Result = lastElement; } +// For bounded method, amountCopied take the minimum of two values, +// for ConcatFnKind::strlcat: +// amountCopied = min (

[clang] [analyzer] Add support for consteval in ConditionBRVisitor::VisitTerminator (PR #146859)

2025-07-03 Thread Imad Aldij via cfe-commits
https://github.com/imdj updated https://github.com/llvm/llvm-project/pull/146859 >From 1077e164158965e824097542dc4c3ecc8821d6dc Mon Sep 17 00:00:00 2001 From: Imad Aldij Date: Thu, 3 Jul 2025 13:50:55 +0300 Subject: [PATCH 1/3] Add support for consteval if in ConditionBRVisitor --- clang/lib/S

[clang] [analyzer] Avoid unnecessary super region invalidation in `CStringChecker` (PR #146212)

2025-07-03 Thread via cfe-commits
https://github.com/flovent updated https://github.com/llvm/llvm-project/pull/146212 >From 9da53c788fc01cd3fc2dd4c178b836035b5d380b Mon Sep 17 00:00:00 2001 From: flovent Date: Sat, 28 Jun 2025 20:58:43 +0800 Subject: [PATCH 1/6] [analyzer] Avoid unnecessary super region invalidation in `CStrin

[clang] d805707 - [clang][test] Correct UNSUPPORTED syntax in print-ranges.cpp

2025-07-03 Thread David Spickett via cfe-commits
Author: David Spickett Date: 2025-07-03T13:36:30Z New Revision: d805707ee435fbe83440ceaf0eb515bf1d536f01 URL: https://github.com/llvm/llvm-project/commit/d805707ee435fbe83440ceaf0eb515bf1d536f01 DIFF: https://github.com/llvm/llvm-project/commit/d805707ee435fbe83440ceaf0eb515bf1d536f01.diff LOG

[libclc] [libclc] Make library output directories explicit (PR #146833)

2025-07-03 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/146833 >From 27ede3bfae2776deef2dfce803a5f500bf0c7278 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 3 Jul 2025 09:24:59 +0100 Subject: [PATCH 1/2] [libclc] Make library output directories explicit These

[clang] [llvm] [HIPSTDPAR] Add support for globals (PR #146813)

2025-07-03 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/146813 >From d98e3785a144ada9881cdbe24c86f273850eca20 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Thu, 3 Jul 2025 02:02:04 +0100 Subject: [PATCH 1/4] Add support for true globals. --- llvm/lib/Transforms/HipStdPa

[clang] [clang] Refactor `CodeGenOptions` to specify AST effect as X macro arg (PR #146910)

2025-07-03 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/146910 >From 12825e992f8e7c8c9d50e7738e94f7d3770fd356 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 3 Jul 2025 07:31:00 -0700 Subject: [PATCH 1/2] [clang] Refactor `CodeGenOptions` to specify AST effect a

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

2025-07-03 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. https://github.com/llvm/llvm-project/pull/144611 ___ 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-07-03 Thread Sander de Smalen via cfe-commits
@@ -2261,6 +2261,23 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) { } } } + +if (auto *VT = Ty->getAs(); +VT && FD && +(VT->getVectorKind() == VectorKind::SveFixedLengthData || + VT->getVectorKind()

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

2025-07-03 Thread Sander de Smalen via cfe-commits
@@ -2261,6 +2261,21 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) { } } } + +if (auto *VT = Ty->getAs(); +VT && FD && +(VT->getVectorKind() == VectorKind::SveFixedLengthData || + VT->getVectorKind()

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

2025-07-03 Thread Sander de Smalen via cfe-commits
@@ -2261,6 +2261,23 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) { } } } + +if (auto *VT = Ty->getAs(); +VT && FD && +(VT->getVectorKind() == VectorKind::SveFixedLengthData || + VT->getVectorKind()

[clang] [clang-tools-extra] [clang-tidy] EndSourceFile() for preprocessor before diagnostic client (PR #145784)

2025-07-03 Thread Dave Bartolomeo via cfe-commits
https://github.com/dbartol updated https://github.com/llvm/llvm-project/pull/145784 >From 0be65986e1e2adf973a032936afa9cf48841055b Mon Sep 17 00:00:00 2001 From: Dave Bartolomeo Date: Wed, 25 Jun 2025 17:45:50 -0400 Subject: [PATCH 1/4] EndSourceFile() for preprocessor before diagnostic client

[clang] [CIR] Upstream UnaryDeref support for ComplexType (PR #146757)

2025-07-03 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/146757 >From 255b4ee2e630d446351244934b06733e5a3e9358 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Wed, 2 Jul 2025 20:48:36 +0200 Subject: [PATCH] [CIR] Upstream UnaryDeref support for ComplexType --- clang

[clang] [llvm] [win][aarch64] Always reserve frame pointers for Arm64 Windows (PR #146582)

2025-07-03 Thread Daniel Paoliello via cfe-commits
@@ -518,6 +518,27 @@ bool AArch64FrameLowering::hasFPImpl(const MachineFunction &MF) const { return false; } +/// Should the Frame Pointer be reserved for the current function? +bool AArch64FrameLowering::isFPReserved(const MachineFunction &MF) const { + const TargetMachin

[clang] [NFC][Clang][OpenMP] Refactor mapinfo generation for captured vars (PR #146891)

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Abhinav Gaba (abhinavgaba) Changes The refactored code would allow creating multiple member-of maps for the same captured var, which would be useful for changes like https://github.com/llvm/llvm-project/pull/145454. --- Full diff: https:

[clang] [NFC][Clang][OpenMP] Refactor mapinfo generation for captured vars (PR #146891)

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Abhinav Gaba (abhinavgaba) Changes The refactored code would allow creating multiple member-of maps for the same captured var, which would be useful for changes like https://github.com/llvm/llvm-project/pull/145454. --- Full diff

[clang] e93a346 - [CIR] Upstream SubstNonTypeTemplateParmExpr support for ComplexType (#146755)

2025-07-03 Thread via cfe-commits
Author: Amr Hesham Date: 2025-07-03T17:50:21+02:00 New Revision: e93a34662f1471c17f2afa7461ec71bf7913b984 URL: https://github.com/llvm/llvm-project/commit/e93a34662f1471c17f2afa7461ec71bf7913b984 DIFF: https://github.com/llvm/llvm-project/commit/e93a34662f1471c17f2afa7461ec71bf7913b984.diff LO

[clang] [CIR] Upstream SubstNonTypeTemplateParmExpr support for ComplexType (PR #146755)

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

[clang] [analyzer] Avoid unnecessary super region invalidation in `CStringChecker` (PR #146212)

2025-07-03 Thread via cfe-commits
https://github.com/flovent updated https://github.com/llvm/llvm-project/pull/146212 >From 9da53c788fc01cd3fc2dd4c178b836035b5d380b Mon Sep 17 00:00:00 2001 From: flovent Date: Sat, 28 Jun 2025 20:58:43 +0800 Subject: [PATCH 01/10] [analyzer] Avoid unnecessary super region invalidation in `CStr

[clang] 59d641a - [CIR] Upstream support for SubstNonTypeTemplateParmExpr (#146751)

2025-07-03 Thread via cfe-commits
Author: Amr Hesham Date: 2025-07-03T17:50:00+02:00 New Revision: 59d641a2dab475f6ab0ab1308b1d6dd641dccb6a URL: https://github.com/llvm/llvm-project/commit/59d641a2dab475f6ab0ab1308b1d6dd641dccb6a DIFF: https://github.com/llvm/llvm-project/commit/59d641a2dab475f6ab0ab1308b1d6dd641dccb6a.diff LO

[clang] [NFC][Clang][OpenMP] Refactor mapinfo generation for captured vars (PR #146891)

2025-07-03 Thread Abhinav Gaba via cfe-commits
https://github.com/abhinavgaba ready_for_review https://github.com/llvm/llvm-project/pull/146891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for SubstNonTypeTemplateParmExpr (PR #146751)

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

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-03 Thread Barry Revzin via cfe-commits
https://github.com/brevzin updated https://github.com/llvm/llvm-project/pull/146815 >From 40290a957b6f349a9b670193c8bc699d8eb7d373 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Fri, 27 Jun 2025 17:29:45 -0500 Subject: [PATCH 1/6] [P3074] Implementing part of trivial unions --- clang/lib/A

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-03 Thread Barry Revzin via cfe-commits
https://github.com/brevzin updated https://github.com/llvm/llvm-project/pull/146815 >From 40290a957b6f349a9b670193c8bc699d8eb7d373 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Fri, 27 Jun 2025 17:29:45 -0500 Subject: [PATCH 1/7] [P3074] Implementing part of trivial unions --- clang/lib/A

[clang] [analyzer] Avoid unnecessary super region invalidation in `CStringChecker` (PR #146212)

2025-07-03 Thread via cfe-commits
@@ -0,0 +1,106 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s flovent wrote: > Added `alpha.unix.cstring` and `unix.cstring` to testcase, > `alpha.unix.cstring` makes a difference, in line 66, if `size` is equal to > `dest`'s size, `alpha.uni

[clang] [Clang][AArch64] Remove redundant tune args to the backend (PR #146896)

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 Author: Tomer Shafir (tomershafir) Changes This change removes unnecessary tune args to the AArch64 backend. The AArch64 backend automatically handles `tune-cpu` and adds the necessar y features based on the models from TableGen. It fol

[clang] [Clang][AArch64] Remove redundant tune args to the backend (PR #146896)

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Tomer Shafir (tomershafir) Changes This change removes unnecessary tune args to the AArch64 backend. The AArch64 backend automatically handles `tune-cpu` and adds the necessar y features based on the models from TableGen. It follow

[clang] [Clang][AArch64] Remove redundant tune args to the backend (PR #146896)

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Tomer Shafir (tomershafir) Changes This change removes unnecessary tune args to the AArch64 backend. The AArch64 backend automatically handles `tune-cpu` and adds the necessar y features based on the models from TableGen. It follows this

[clang] [Clang][AArch64] Remove redundant tune args to the backend (PR #146896)

2025-07-03 Thread Tomer Shafir via cfe-commits
https://github.com/tomershafir ready_for_review https://github.com/llvm/llvm-project/pull/146896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang][OpenMP] Refactor mapinfo generation for captured vars (PR #146891)

2025-07-03 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 HEAD~1 HEAD --extensions cpp -- clang/lib/CodeGen/CGOpenMPRuntime.cpp ``

[clang] [llvm] [win][aarch64] Always reserve frame pointers for Arm64 Windows (PR #146582)

2025-07-03 Thread David Spickett via cfe-commits
DavidSpickett wrote: The actual error is the same as seen elsewhere: ``` $ /home/david.spickett/build-llvm-aarch64/bin/flang --target=aarch64-pc-windows-msvc -Werror ../llvm-project/flang/test/Semantics/windows.f90 flang-21: warning: unable to find a Visual Studio installation; try running Cla

[clang] [clang] SourceManager: Cache offsets for LastFileIDLookup to speed up getFileID (PR #146782)

2025-07-03 Thread Haojian Wu via cfe-commits
@@ -832,13 +835,11 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const { unsigned LessIndex = 0; // upper bound of the search range. unsigned GreaterIndex = LocalSLocEntryTable.size(); - if (LastFileIDLookup.ID >= 0) { -// Use the LastFi

[clang] [NFC][Clang][OpenMP] Refactor mapinfo generation for captured vars (PR #146891)

2025-07-03 Thread Abhinav Gaba via cfe-commits
@@ -8727,11 +8733,13 @@ class MappableExprsHandler { } } - /// Generate the base pointers, section pointers, sizes, map types, and - /// mappers associated to a given capture (all included in \a CombinedInfo). - void generateInfoForCapture(const CapturedStmt::Capture

[clang] [NFC][Clang][OpenMP] Refactor mapinfo generation for captured vars (PR #146891)

2025-07-03 Thread Abhinav Gaba via cfe-commits
@@ -8826,6 +8830,51 @@ class MappableExprsHandler { return (HasPresent && !HasPresentR) || (HasAllocs && !HasAllocsR); }); +auto GenerateInfoForComponentLists = +[&](ArrayRef DeclComponentLists, +bool IsEligibleForTargetParamFlag) { +

[clang] [clang][dataflow] Handle when `this` refers to a different location (PR #146900)

2025-07-03 Thread Jan Voung via cfe-commits
https://github.com/jvoung created https://github.com/llvm/llvm-project/pull/146900 When `this` is under a CXXDefaultInitExpr. E.g., struct S { int x; int y = this->x; }; struct R { int foo() { // `this` for `a` refers to an R, but `this` // for `x` refers to an S. return S{this

[clang] [Clang] Correctly handle allocations in the condition of a `if constexpr` (PR #146890)

2025-07-03 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/146890 >From c138801c212f69f4dee83c7516e0e77eb876a9f0 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Thu, 3 Jul 2025 14:26:59 +0200 Subject: [PATCH 1/2] [Clang] Correctly handle allocations in the condition of a

[clang] [Clang] Correctly handle allocations in the condition of a `if constexpr` (PR #146890)

2025-07-03 Thread Corentin Jabot via cfe-commits
@@ -20629,6 +20629,9 @@ Sema::ConditionResult Sema::ActOnCondition(Scope *S, SourceLocation Loc, case ConditionKind::ConstexprIf: Cond = CheckBooleanCondition(Loc, SubExpr, true); +assert(isa(Cond.get()) && cor3ntin wrote: Actually the assert was i

[clang] [Clang] Correctly handle allocations in the condition of a `if constexpr` (PR #146890)

2025-07-03 Thread Corentin Jabot via cfe-commits
@@ -1931,15 +1931,13 @@ Parser::ParseCXXCondition(StmtResult *InitStmt, SourceLocation Loc, return ParseCXXCondition(nullptr, Loc, CK, MissingOK); } -ExprResult Expr = [&] { - EnterExpressionEvaluationContext Eval( - Actions, Sema::ExpressionEvalua

[clang] [Clang] Correctly handle allocations in the condition of a `if constexpr` (PR #146890)

2025-07-03 Thread Erich Keane via cfe-commits
@@ -20643,10 +20641,12 @@ Sema::ConditionResult Sema::ActOnCondition(Scope *S, SourceLocation Loc, {SubExpr}, PreferredConditionType(CK)); if (!Cond.get()) return ConditionError(); - } - if (!isa(Cond.get())) + } else if (Cond.isUsabl

[clang] [analyzer] Avoid unnecessary super region invalidation in `CStringChecker` (PR #146212)

2025-07-03 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: According to the CI Checks, one of your testcases is failing: https://github.com/llvm/llvm-project/actions/runs/16055061425?pr=146212 > error: 'expected-warning' diagnostics expected but not seen: File /home/gha/actions-runner/_work/llvm-project/llvm-pr

[clang] [C23] Fix typeof handling in enum declarations (PR #146394)

2025-07-03 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/146394 >From 94cd71d65fe27cdde0c39416a0e2e709af98ed0c Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 30 Jun 2025 13:26:57 -0400 Subject: [PATCH 1/7] [C23] Fix typeof handling in enum declarations We have

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

2025-07-03 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/7] [AArch64] Add option -msve-streaming-vector-bits= . Th

[clang] [Sema] Fix lifetime extension for temporaries in range-based for loops in C++23 (PR #145164)

2025-07-03 Thread Marco Vitale via cfe-commits
mrcvtl wrote: > There are some test failures in the presubmit checks, you probably need to > update these tests. Yes, indeed. For example, in `AST/ast-dump-for-range-lifetime.cpp` we move from: `-MaterializeTemporaryExpr {{.*}} 'C':'P2718R0::C' xvalue extended by Var {{.*}} '__range1' 'C &&'`

[clang] [llvm] [clang][python][test] Move python binding tests to lit framework (PR #146844)

2025-07-03 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: No idea why it blew up on that particular s390x buildbot. @AaronBallman Any ideas? https://github.com/llvm/llvm-project/pull/146844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [clang-format] Propagate `LeadingEmptyLinesAffected` when joining lines (PR #146761)

2025-07-03 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. Please wait a few days, or until another approval. https://github.com/llvm/llvm-project/pull/146761 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [OpenCL] Add decls for cl_intel_subgroup_local_block_io (PR #146656)

2025-07-03 Thread Michal Paszkowski via cfe-commits
https://github.com/michalpaszkowski approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/146656 ___ 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-07-03 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/8] [AArch64] Add option -msve-streaming-vector-bits= . Th

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

2025-07-03 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/9] [AArch64] Add option -msve-streaming-vector-bits= . Th

[clang] [llvm] AMDGPU: Implement tensor load and store instructions for gfx1250 (PR #146636)

2025-07-03 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. https://github.com/llvm/llvm-project/pull/146636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test] Avoid some C++14 warnings in discrim-union.cpp (PR #146829)

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes Before this patch, we emitted a bunch of irrelevant (to this test) warnings: ``` ../clang/test/SemaCXX/discrim-union.cpp:49:24: warning: 'constexpr' non-static member function will not be implicitly 'const'

[clang] [clang-scan-deps] Fix "unterminated conditional directive" bug (PR #146645)

2025-07-03 Thread Ziqing Luo via cfe-commits
ziqingluo-90 wrote: > The logic added in #143950 also handles line splices with 0 trailing > whitespace characters, so this code is now redundant. (When removing it, the > test run fine too.) > > Should removing this code be a separate PR? Done https://github.com/llvm/llvm-project/pull/14664

[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra @llvm/pr-subscribers-clang-tidy Author: Victor Chernyakin (localspook) Changes Closes #132561. This is a check that rewrites `#if`s and `#elif`s like so: ```cpp #if defined(MEOW) // -> #ifdef MEOW #if !defined(MEOW) // -> #ifndef ME

[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

2025-07-03 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/146830 Closes #132561. This is a check that rewrites `#if`s and `#elif`s like so: ```cpp #if defined(MEOW) // -> #ifdef MEOW #if !defined(MEOW) // -> #ifndef MEOW ``` And, since C23 and C++23: ```cpp #elif def

[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

2025-07-03 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] [Sema] Fix lifetime extension for temporaries in range-based for loops in C++23 (PR #145164)

2025-07-03 Thread Haojian Wu via cfe-commits
@@ -1304,6 +1304,13 @@ checkExprLifetimeImpl(Sema &SemaRef, const InitializedEntity *InitEntity, if (LK == LK_FullExpression) return; + if (LK == LK_Extended && SemaRef.getLangOpts().CPlusPlus23) { hokein wrote: Is the `LK == LK_Extended` check necess

[clang] [llvm] Add __attribute__((visibility("default"))) attribute to certain symbols to stop them being hidden when linking clangInterpreter library to other libraries during Emscripten build (PR #1

2025-07-03 Thread Nikita Popov via cfe-commits
nikic wrote: > Also, this is separate to the issue to making a Windows Shared library issue > here #109483 (this purely based on your comment that ' the annotation effort > hasn't progressed to them yet') That same work also enables building libLLVM/libclang with `-fvisibilty=hidden`, which i

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-03 Thread via cfe-commits
Hanwen-ece wrote: Dear Shunsuke, Thank you for your thoughtful response and for sharing your approach to complex division optimization. We encountered similar performance issues while analyzing SPEC2017 workloads, particularly in the handling of complex arithmetic, and were motivated to propo

[clang] [Sema] Fix lifetime extension for temporaries in range-based for loops in C++23 (PR #145164)

2025-07-03 Thread Haojian Wu via cfe-commits
https://github.com/hokein commented: There are some test failures in the presubmit checks, you probably need to update these tests. https://github.com/llvm/llvm-project/pull/145164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[libclc] [libclc] Declare workitem built-ins in clc, move ptx-nvidiacl workitem built-ins into clc (PR #144333)

2025-07-03 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > > I am seeing unresolved CLC functions in `nvptx--.bc` and `nvptx64--.bc`. I > > think it's because we're now building things like `get_num_groups` for > > `nvptx`/`nvptx64`, whereas previously they were not being built for those > > targets. We're also not building `__clc

[clang] [clang-tools-extra] [clang][CodeComplete] skip explicit obj param in SignatureHelp (PR #146649)

2025-07-03 Thread Mythreya Kuricheti via cfe-commits
https://github.com/MythreyaK updated https://github.com/llvm/llvm-project/pull/146649 >From 7f8581f01c3c25363b77100635c6df7223badba3 Mon Sep 17 00:00:00 2001 From: Mythreya Kuricheti Date: Wed, 2 Jul 2025 01:26:25 -0700 Subject: [PATCH 1/2] [clang][CodeComplete] skip explicit obj param in Sign

[clang] [llvm] Add __attribute__((visibility("default"))) attribute to certain symbols to stop them being hidden when linking clangInterpreter library to other libraries during Emscripten build (PR #1

2025-07-03 Thread via cfe-commits
mcbarton wrote: > > Also, this is separate to the issue to making a Windows Shared library > > issue here #109483 (this purely based on your comment that ' the annotation > > effort hasn't progressed to them yet') > > That same work also enables building libLLVM/libclang with > `-fvisibilty=h

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-03 Thread Kiran Chandramohan via cfe-commits
@@ -1023,12 +1023,12 @@ defm offload_uniform_block : BoolFOption<"offload-uniform-block", BothFlags<[], [ClangOption], " that kernels are launched with uniform block sizes (default true for CUDA/HIP and false otherwise)">>; def fcomplex_arithmetic_EQ : Joined<["-"], "fcomp

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-03 Thread Kiran Chandramohan via cfe-commits
@@ -0,0 +1,35 @@ +! Test lowering of complex division according to options + +! REQUIRES: flang-supports-f128-math +! RUN: bbc -complex-range=full -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,FULL +! RUN: bbc -complex-range=improved -emit-hlfir %s -o - | FileCheck %s

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-03 Thread Kiran Chandramohan via cfe-commits
@@ -595,6 +595,30 @@ void Flang::addOffloadOptions(Compilation &C, const InputInfoList &Inputs, addOpenMPHostOffloadingArgs(C, JA, Args, CmdArgs); } +static std::string ComplexRangeKindToStr(LangOptions::ComplexRangeKind Range) { + switch (Range) { + case LangOptions::Com

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-03 Thread Kiran Chandramohan via cfe-commits
https://github.com/kiranchandramohan edited https://github.com/llvm/llvm-project/pull/146641 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-03 Thread Kiran Chandramohan via cfe-commits
https://github.com/kiranchandramohan approved this pull request. LG. Thanks for all the work and experiments here. Couple of nit/trivial comments. https://github.com/llvm/llvm-project/pull/146641 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-03 Thread Kiran Chandramohan via cfe-commits
@@ -1066,8 +1066,16 @@ struct BinaryOp(loc, lhs, rhs)}; kiranchandramohan wrote: Nit: braces https://github.com/llvm/llvm-project/pull/146641 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [llvm] [win][aarch64] Always reserve frame pointers for Arm64 Windows (PR #146582)

2025-07-03 Thread David Truby via cfe-commits
@@ -518,6 +518,27 @@ bool AArch64FrameLowering::hasFPImpl(const MachineFunction &MF) const { return false; } +/// Should the Frame Pointer be reserved for the current function? +bool AArch64FrameLowering::isFPReserved(const MachineFunction &MF) const { + const TargetMachin

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

2025-07-03 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > @efriedma-quic was kind enough to have a call where we discussed this a bit > more. I'll update tomorrow with a potential way forward, for the group's > consideration. Following up, here's a possible approach to making progress, broken down in phases, (@efriedma-quic can corr

[clang] [NFC][clang] Fix CodeGenSYCL::unique_stable_name_windows_diff test (PR #146854)

2025-07-03 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann requested changes to this pull request. https://github.com/llvm/llvm-project/pull/146854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang] Fix CodeGenSYCL::unique_stable_name_windows_diff test (PR #146854)

2025-07-03 Thread Tom Honermann via cfe-commits
@@ -1,19 +1,19 @@ // RUN: %clang_cc1 -triple spir64-unknown-unknown-sycldevice -aux-triple x86_64-pc-windows-msvc -fsycl-is-device -disable-llvm-passes -fsycl-is-device -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE=addrspace(1) ' -// RUN: %clang_cc1 -triple x86_64-pc-windows-

[clang] [NFC][clang] Fix CodeGenSYCL::unique_stable_name_windows_diff test (PR #146854)

2025-07-03 Thread Tom Honermann via cfe-commits
@@ -1,19 +1,19 @@ // RUN: %clang_cc1 -triple spir64-unknown-unknown-sycldevice -aux-triple x86_64-pc-windows-msvc -fsycl-is-device -disable-llvm-passes -fsycl-is-device -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE=addrspace(1) ' -// RUN: %clang_cc1 -triple x86_64-pc-windows-

[clang] [NFC][clang] Fix CodeGenSYCL::unique_stable_name_windows_diff test (PR #146854)

2025-07-03 Thread Tom Honermann via cfe-commits
@@ -1,19 +1,19 @@ // RUN: %clang_cc1 -triple spir64-unknown-unknown-sycldevice -aux-triple x86_64-pc-windows-msvc -fsycl-is-device -disable-llvm-passes -fsycl-is-device -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE=addrspace(1) ' tahonermann wrote: The redun

[clang] [NFC][clang] Fix CodeGenSYCL::unique_stable_name_windows_diff test (PR #146854)

2025-07-03 Thread Tom Honermann via cfe-commits
@@ -1,19 +1,19 @@ // RUN: %clang_cc1 -triple spir64-unknown-unknown-sycldevice -aux-triple x86_64-pc-windows-msvc -fsycl-is-device -disable-llvm-passes -fsycl-is-device -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE=addrspace(1) ' -// RUN: %clang_cc1 -triple x86_64-pc-windows-

[clang] [NFC][clang] Fix CodeGenSYCL::unique_stable_name_windows_diff test (PR #146854)

2025-07-03 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon ready_for_review https://github.com/llvm/llvm-project/pull/146854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang] Fix CodeGenSYCL::unique_stable_name_windows_diff test (PR #146854)

2025-07-03 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon updated https://github.com/llvm/llvm-project/pull/146854 >From 9a640eefb5d27a65f236b5f7df1398bdf1bcc017 Mon Sep 17 00:00:00 2001 From: "Podchishchaeva, Mariya" Date: Thu, 3 Jul 2025 03:46:41 -0700 Subject: [PATCH 1/2] [NFC][clang] Fix CodeGenSYCL::unique_stable_nam

[clang] [NFC][clang] Fix CodeGenSYCL::unique_stable_name_windows_diff test (PR #146854)

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mariya Podchishchaeva (Fznamznon) Changes The test checks x86 target in fsycl-is-device mode. x86 is not a valid offloading target and IMO test meant to check fsycl-is-host mode to make sure host invocations of __builtin_sycl_unique_stabl

[clang] [Clang] Fix evaluation context of lambdas appearing in discarded statements (PR #146857)

2025-07-03 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/146857 >From 4ee72df191e9792be38195b00b0f6422de3a767a Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Thu, 3 Jul 2025 13:00:46 +0200 Subject: [PATCH 1/2] [Clang] Fix evaluation context of lambdas appearing in dis

[clang] [analyzer] Avoid unnecessary super region invalidation in `CStringChecker` (PR #146212)

2025-07-03 Thread via cfe-commits
https://github.com/flovent updated https://github.com/llvm/llvm-project/pull/146212 >From 9da53c788fc01cd3fc2dd4c178b836035b5d380b Mon Sep 17 00:00:00 2001 From: flovent Date: Sat, 28 Jun 2025 20:58:43 +0800 Subject: [PATCH 1/5] [analyzer] Avoid unnecessary super region invalidation in `CStrin

[clang] [C23] Fix typeof handling in enum declarations (PR #146394)

2025-07-03 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/146394 >From 94cd71d65fe27cdde0c39416a0e2e709af98ed0c Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 30 Jun 2025 13:26:57 -0400 Subject: [PATCH 1/6] [C23] Fix typeof handling in enum declarations We have

[clang] [analyzer] Avoid unnecessary super region invalidation in `CStringChecker` (PR #146212)

2025-07-03 Thread via cfe-commits
@@ -2223,16 +2223,81 @@ void CStringChecker::evalStrcpyCommon(CheckerContext &C, const CallEvent &Call, Result = lastElement; } +// For bounded method, amountCopied take the minimum of two values, +// for ConcatFnKind::strlcat: +// amountCopied = min (

[clang] [clang] SourceManager: Cache offsets for LastFileIDLookup to speed up getFileID (PR #146782)

2025-07-03 Thread Erich Keane via cfe-commits
@@ -849,7 +850,12 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const { FileID Res = FileID::get(int(GreaterIndex)); // Remember it. We have good locality across FileID lookups. LastFileIDLookup = Res; - NumLinearScans += Nu

[clang] [clang] SourceManager: Cache offsets for LastFileIDLookup to speed up getFileID (PR #146782)

2025-07-03 Thread Erich Keane via cfe-commits
@@ -832,13 +835,11 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const { unsigned LessIndex = 0; // upper bound of the search range. unsigned GreaterIndex = LocalSLocEntryTable.size(); - if (LastFileIDLookup.ID >= 0) { -// Use the LastFi

[clang] [analyzer] Add support for consteval in ConditionBRVisitor::VisitTerminator (PR #146859)

2025-07-03 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,8 @@ +// RUN: %clang_analyze_cc1 -std=c++23 -analyzer-checker=core -verify %s + +void test_consteval() { + if consteval { +int *ptr = nullptr; +*ptr = 42; // expected-warning{{Dereference of null pointer (loaded from variable 'ptr')}} + } +}

[clang] [analyzer] Avoid unnecessary super region invalidation in `CStringChecker` (PR #146212)

2025-07-03 Thread via cfe-commits
flovent wrote: > Also please follow the [Coding > Standard](https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly) > and use `UpperCamelCase` variables for variables (including ones that store > lambda functions), while `lowerCamelCase` is for metho

[clang] [clang][analyzer] Fix the false positive ArgInitializedness warning on unnamed bit-field (PR #145066)

2025-07-03 Thread Balazs Benics via cfe-commits
@@ -2122,8 +2122,21 @@ SVal RegionStoreManager::getBindingForField(RegionBindingsConstRef B, if (const std::optional &V = B.getDirectBinding(R)) return *V; - // If the containing record was initialized, try to get its constant value. + // UnnamedBitField is always Und

[clang] [clang][analyzer] Fix the false positive ArgInitializedness warning on unnamed bit-field (PR #145066)

2025-07-03 Thread via cfe-commits
@@ -2122,8 +2122,21 @@ SVal RegionStoreManager::getBindingForField(RegionBindingsConstRef B, if (const std::optional &V = B.getDirectBinding(R)) return *V; - // If the containing record was initialized, try to get its constant value. + // UnnamedBitField is always Und

[clang] [llvm] [analyzer] Correct Z3 test cases, fix exposed crashes (PR #146597)

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

[clang] [CIR] Bit manipulation builtin functions (PR #146529)

2025-07-03 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/146529 >From c00abbed243cf4048317031c3abde185a050a2d4 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 1 Jul 2025 21:26:23 +0800 Subject: [PATCH] [CIR] Bit manipulation builtin functions This patch adds CIR support

[clang] [Clang][AArch64] Remove redundant tune args to the backend (PR #146896)

2025-07-03 Thread Tomer Shafir via cfe-commits
https://github.com/tomershafir created https://github.com/llvm/llvm-project/pull/146896 This change removes unnecessary tune args to the AArch64 backend. The AArch64 backend automatically handles `tune-cpu` and adds the necessary features based on the models from TableGen. >From 47da7044807f1

[clang] [C23] Fix typeof handling in enum declarations (PR #146394)

2025-07-03 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > > ```c++ > > > > typeof(int){} x; // Probably parsed as typeof(int{}) > > > > ``` > > > > > > > > > Actually, I’m not sure what we think this is supposed to be; I haven’t > > > checked. > > > > > > Actually, that’s just a compound literal; I forgot we supported thos

[clang] [analyzer] Avoid unnecessary super region invalidation in `CStringChecker` (PR #146212)

2025-07-03 Thread via cfe-commits
@@ -0,0 +1,106 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s flovent wrote: Added `alpha.unix.cstring` and `unix.cstring` to testcase, `alpha.unix.cstring` makes a difference, in line 66, if `size` is equal to `dest`'s size, `alpha.unix.cstri

[clang] [analyzer] Avoid unnecessary super region invalidation in `CStringChecker` (PR #146212)

2025-07-03 Thread via cfe-commits
https://github.com/flovent updated https://github.com/llvm/llvm-project/pull/146212 >From 9da53c788fc01cd3fc2dd4c178b836035b5d380b Mon Sep 17 00:00:00 2001 From: flovent Date: Sat, 28 Jun 2025 20:58:43 +0800 Subject: [PATCH 1/9] [analyzer] Avoid unnecessary super region invalidation in `CStrin

[clang] [clang][analyzer] Fix the false positive ArgInitializedness warning on unnamed bit-field (PR #145066)

2025-07-03 Thread via cfe-commits
@@ -2122,8 +2122,21 @@ SVal RegionStoreManager::getBindingForField(RegionBindingsConstRef B, if (const std::optional &V = B.getDirectBinding(R)) return *V; - // If the containing record was initialized, try to get its constant value. + // UnnamedBitField is always Und

[clang] [llvm] Add __attribute__((visibility("default"))) attribute to certain symbols to stop them being hidden when linking clangInterpreter library to other libraries during Emscripten build (PR #1

2025-07-03 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: I think that it might be better to wait on this change until we do this properly. In the mean time, the workaround would be to use `-fvisibility=default`. If you want to help with the annotations to make clang build as a DSO, I think that @andrurogerz would welcome the help. Bu

[clang] [llvm] [NFC][HLSL][DirectX] Let `HLSLRootSignature` reuse the `dxbc` defined enums (PR #145986)

2025-07-03 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. looks good, one more comment about using enum values rather than bit patterns in a test https://github.com/llvm/llvm-project/pull/145986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [llvm] [NFC][HLSL][DirectX] Let `HLSLRootSignature` reuse the `dxbc` defined enums (PR #145986)

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

[clang] [llvm] [NFC][HLSL][DirectX] Let `HLSLRootSignature` reuse the `dxbc` defined enums (PR #145986)

2025-07-03 Thread Justin Bogner via cfe-commits
@@ -56,7 +56,7 @@ TEST(HLSLRootSignatureTest, DescriptorUAVClauseDump) { Clause.NumDescriptors = 3298; Clause.Space = 932847; Clause.Offset = 1; - Clause.Flags = DescriptorRangeFlags::ValidFlags; + Clause.Flags = llvm::dxbc::DescriptorRangeFlags(0x1000f); --

[clang] [CIR] Upstream __builtin_creal for ComplexType (PR #146927)

2025-07-03 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper created https://github.com/llvm/llvm-project/pull/146927 Upstream `__builtin_creal` support for ComplexType https://github.com/llvm/llvm-project/issues/141365 >From 518f6ee1e10319f12eac78c675e082a6fbeebb33 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Thu,

  1   2   3   4   5   6   >