[clang] [Clang][NFC] Avoid copies by using std::move (PR #146960)

2025-07-03 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/146960 Static analysis flagged this code as using copies when we could use move instead. I used a temporary in some cases instead of an explicit move. >From 672514ff2ab201ea9d3098f4a94251155533ce55 Mon Sep 17 00:00:00

[clang] [Clang] Allow vanilla C function symbol name to be used in __attribute__((alias)) when -funique-internal-linkage-names is specified (PR #145652)

2025-07-03 Thread via cfe-commits
https://github.com/HighW4y2H3ll updated https://github.com/llvm/llvm-project/pull/145652 >From 9a29dd6fa3f28bf507f047a22597f8510bd096b3 Mon Sep 17 00:00:00 2001 From: h2h Date: Tue, 24 Jun 2025 23:24:32 -0700 Subject: [PATCH 1/3] [Clang] Allow vanilla C function symbol name to be used in __att

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

2025-07-03 Thread Michael Spencer via cfe-commits
@@ -880,6 +880,37 @@ TEST(MinimizeSourceToDependencyDirectivesTest, EXPECT_EQ(pp_eof, Directives[22].Kind); } +TEST(MinimizeSourceToDependencyDirectivesTest, + TestFixedBugThatReportUnterminatedDirectiveFalsely) { + SmallVector Out; + SmallVector Tokens; + SmallVector

[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 updated https://github.com/llvm/llvm-project/pull/146830 >From 9eb58438d2b4061ad7a6bdbd1db82a5fd4043948 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Thu, 3 Jul 2025 00:19:52 -0700 Subject: [PATCH 1/4] [clang-tidy] Add new check: `modernize-use-concise-pr

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

2025-07-03 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,171 @@ +// The driver never checks to implicitly enable the explicit module build +// support unless at least two input files are provided. +// To trigger the C++20 module usage check, we always pass a second dummy file +// as input. +// TODO: Remove -fmodules everywhe

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

2025-07-03 Thread Michael Spencer via cfe-commits
@@ -4414,6 +4590,34 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args, handleArguments(C, Args, Inputs, Actions); + if (Args.hasFlag(options::OPT_fmodules_driver, + options::OPT_fno_modules_driver, false)) { +Diags.Report(diag::remark

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

2025-07-03 Thread Finn Plummer via cfe-commits
@@ -274,11 +286,23 @@ TEST(HLSLRootSignatureTest, NoneRootFlagsDump) { } TEST(HLSLRootSignatureTest, AllRootFlagsDump) { - RootFlags Flags = RootFlags::ValidFlags; + using llvm::dxbc::RootFlags; + auto ValidRootFlags = RootFlags::AllowInputAssemblerInputLayout | +

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

2025-07-03 Thread Michael Spencer via cfe-commits
@@ -577,6 +577,19 @@ def err_drv_reduced_module_output_overrided : Warning< "please consider use '-fmodule-output=' to specify the output file for reduced BMI explicitly">, InGroup>; +def remark_fmodules_driver_enabled : Remark< + "support for explicit module builds enab

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

2025-07-03 Thread Michael Spencer via cfe-commits
@@ -4403,6 +4411,174 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args, } } +static void skipWhitespace(const char *&Ptr) { + while (isWhitespace(*Ptr)) +++Ptr; +} + +// Returns the length of EOL, either 0 (no end-of-line), 1 (\n) or 2 (\r\n). +stati

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

2025-07-03 Thread Finn Plummer via cfe-commits
https://github.com/inbelic deleted 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 Finn Plummer via cfe-commits
@@ -274,11 +286,23 @@ TEST(HLSLRootSignatureTest, NoneRootFlagsDump) { } TEST(HLSLRootSignatureTest, AllRootFlagsDump) { - RootFlags Flags = RootFlags::ValidFlags; + using llvm::dxbc::RootFlags; + auto ValidRootFlags = RootFlags::AllowInputAssemblerInputLayout | +

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

2025-07-03 Thread via cfe-commits
Author: Changpeng Fang Date: 2025-07-03T13:49:34-07:00 New Revision: eda3161c35659824358b7d8ad4071dd3c38d4854 URL: https://github.com/llvm/llvm-project/commit/eda3161c35659824358b7d8ad4071dd3c38d4854 DIFF: https://github.com/llvm/llvm-project/commit/eda3161c35659824358b7d8ad4071dd3c38d4854.diff

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

2025-07-03 Thread Changpeng Fang via cfe-commits
https://github.com/changpeng closed 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-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

2025-07-03 Thread Victor Chernyakin via cfe-commits
@@ -0,0 +1,105 @@ +//===--- UseConcisePreprocessorDirectivesCheck.cpp - clang-tidy ---===// +// +// 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-scan-deps] Fix "unterminated conditional directive" bug (PR #146645)

2025-07-03 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. https://github.com/llvm/llvm-project/pull/146645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-03 Thread via cfe-commits
Author: Eli Friedman Date: 2025-07-03T13:44:38-07:00 New Revision: 2aa0f0a3bd541278b04efcc717e7aa94ef4c1308 URL: https://github.com/llvm/llvm-project/commit/2aa0f0a3bd541278b04efcc717e7aa94ef4c1308 DIFF: https://github.com/llvm/llvm-project/commit/2aa0f0a3bd541278b04efcc717e7aa94ef4c1308.diff

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

2025-07-03 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed 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] [clang-scan-deps] Fix "unterminated conditional directive" bug (PR #146645)

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

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

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

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

2025-07-03 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] [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: > As a sanity check it would be nice to have a testcase that actually produces > some diagnostics. I add `debug.ExprInspection` to detect if a simple member(`int b`)

[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] 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 created https://github.com/llvm/llvm-project/pull/146910 This is the `CodeGenOptions` counterpart to https://github.com/llvm/llvm-project/pull/146766. >From 12825e992f8e7c8c9d50e7738e94f7d3770fd356 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 3 Jul 202

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

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jan Svoboda (jansvoboda11) Changes This is the `CodeGenOptions` counterpart to https://github.com/llvm/llvm-project/pull/146766. --- Patch is 68.79 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pu

[clang] 23104a7 - [CIR] Add nothrow attribute to the call operation (#145178)

2025-07-03 Thread via cfe-commits
Author: Sirui Mu Date: 2025-07-03T22:54:15+08:00 New Revision: 23104a74e79f208d467830058111fd883dfcb489 URL: https://github.com/llvm/llvm-project/commit/23104a74e79f208d467830058111fd883dfcb489 DIFF: https://github.com/llvm/llvm-project/commit/23104a74e79f208d467830058111fd883dfcb489.diff LOG:

[clang] [CIR] Add nothrow attribute to the call operation (PR #145178)

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

[clang] 5df748d - [Sema] Remove an unnecessary cast (NFC) (#146808)

2025-07-03 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-07-03T08:35:55-07:00 New Revision: 5df748dd329ea5590f9dcc8e643413d26554be00 URL: https://github.com/llvm/llvm-project/commit/5df748dd329ea5590f9dcc8e643413d26554be00 DIFF: https://github.com/llvm/llvm-project/commit/5df748dd329ea5590f9dcc8e643413d26554be00.diff L

[clang] [Sema] Remove an unnecessary cast (NFC) (PR #146808)

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

[clang] [llvm] [llvm-objcopy][libObject] Add RISC-V big-endian support (PR #146913)

2025-07-03 Thread Djordje Todorovic via cfe-commits
https://github.com/djtodoro created https://github.com/llvm/llvm-project/pull/146913 Add support for big-endian RISC-V ELF files: - Add riscv32be/riscv64be target architectures to Triple - Support elf32-bigriscv and elf64-bigriscv output targets in llvm-objcopy - Update ELFObjectFile to ha

[clang] [llvm] [llvm-objcopy][libObject] Add RISC-V big-endian support (PR #146913)

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Djordje Todorovic (djtodoro) Changes Add support for big-endian RISC-V ELF files: - Add riscv32be/riscv64be target architectures to Triple - Support elf32-bigriscv and elf64-bigriscv output targets in llvm-objcopy - Update ELFO

[clang] [llvm] [llvm-objcopy][libObject] Add RISC-V big-endian support (PR #146913)

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Djordje Todorovic (djtodoro) Changes Add support for big-endian RISC-V ELF files: - Add riscv32be/riscv64be target architectures to Triple - Support elf32-bigriscv and elf64-bigriscv output targets in llvm-objcopy - Update ELFObjectFi

[clang] a244907 - [clang] Use range-based for loops (NFC) (#146811)

2025-07-03 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-07-03T08:36:03-07:00 New Revision: a244907922354ead70182002af1d10067bd2b8b6 URL: https://github.com/llvm/llvm-project/commit/a244907922354ead70182002af1d10067bd2b8b6 DIFF: https://github.com/llvm/llvm-project/commit/a244907922354ead70182002af1d10067bd2b8b6.diff L

[clang] [clang] Use range-based for loops (NFC) (PR #146811)

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

[clang] [llvm] [RISCV] Add big-endian support to RISC-V backend (PR #146534)

2025-07-03 Thread Djordje Todorovic via cfe-commits
@@ -48,62 +48,64 @@ class Triple { enum ArchType { UnknownArch, -arm,// ARM (little endian): arm, armv.*, xscale -armeb, // ARM (big endian): armeb -aarch64,// AArch64 (little endian): aarch64 -aarch64_be, // AArch64 (big

[clang] [llvm] [RISCV] Add big-endian support to RISC-V backend (PR #146534)

2025-07-03 Thread Djordje Todorovic via cfe-commits
@@ -48,62 +48,64 @@ class Triple { enum ArchType { UnknownArch, -arm,// ARM (little endian): arm, armv.*, xscale -armeb, // ARM (big endian): armeb -aarch64,// AArch64 (little endian): aarch64 -aarch64_be, // AArch64 (big

[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
@@ -1304,6 +1304,13 @@ checkExprLifetimeImpl(Sema &SemaRef, const InitializedEntity *InitEntity, if (LK == LK_FullExpression) return; + if (LK == LK_Extended && SemaRef.getLangOpts().CPlusPlus23) { mrcvtl wrote: Yes, we can. We just need to check also

[clang] [Modules] fix assert in hasInitWithSideEffects (PR #146468)

2025-07-03 Thread Henrik G. Olsson via cfe-commits
https://github.com/hnrklssn updated https://github.com/llvm/llvm-project/pull/146468 >From c7d7419e13ec4f8951b76fcae5570bba772dc4dd Mon Sep 17 00:00:00 2001 From: "Henrik G. Olsson" Date: Mon, 30 Jun 2025 21:26:19 -0700 Subject: [PATCH] [Modules] Record side effect info in EvaluatedStmt All de

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

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 h,cpp,c,inc -- clang/bindings/python/tests/cindex/INPUTS/a.i

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

2025-07-03 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: We hit the > Invalid CXChildVisitResult! assert in `CIndex.cpp`, which is marked `llvm_unreachable()`... the function covers all three variants of the `CXChildVisitResult` enum. @Endilll I'm hitting supposedly unreachable code, only on this one platform apparently... if y

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

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

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

2025-07-03 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum created https://github.com/llvm/llvm-project/pull/146931 This reverts commit 2532bde0388980ac7e299b02bc554e6fde6c686e. >From cd10ae347a4c640d5e74d25825966e51a63091c9 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 3 Jul 2025 19:30:05 +0200 Subject: [PAT

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

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-github-workflow Author: Jannick Kremer (DeinAlptraum) Changes This reverts commit 2532bde0388980ac7e299b02bc554e6fde6c686e. --- Full diff: https://github.com/llvm/llvm-project/pull/146931.diff 40 Files Affected: - (modified

[clang] [Modules] fix assert in hasInitWithSideEffects (PR #146468)

2025-07-03 Thread Henrik G. Olsson via cfe-commits
https://github.com/hnrklssn updated https://github.com/llvm/llvm-project/pull/146468 >From 39fa1a4610cf14d6288abab07f25c7f735c62508 Mon Sep 17 00:00:00 2001 From: "Henrik G. Olsson" Date: Mon, 30 Jun 2025 21:26:19 -0700 Subject: [PATCH] [Modules] Record side effect info in EvaluatedStmt All de

[clang] [Modules] fix assert in hasInitWithSideEffects (PR #146468)

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,h -- clang/test/Modules/var-init-side-effects-modulemap.

[clang] [Modules] fix assert in hasInitWithSideEffects (PR #146468)

2025-07-03 Thread Henrik G. Olsson via cfe-commits
hnrklssn wrote: @ChuanqiXu9 After investigating the test failures for my previous fix I realised I'd misunderstood `EvaluatedStmt`. That fix caused test failures because it essentially ignored `EvaluatedStmt` initializers if they didn't originate in a deserialized AST and were known to have si

[clang-tools-extra] [clangd] added const and constexpr (PR #143193)

2025-07-03 Thread via cfe-commits
JohnFinn wrote: @ChuanqiXu9 https://github.com/llvm/llvm-project/pull/143193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC][OpenMP] Add tests for mapping pointers and their dereferences. (PR #146934)

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,c -- clang/test/OpenMP/target_map_both_pointer_pointee_c

[clang] [llvm] [NFC][OpenMP] Add tests for mapping pointers and their dereferences. (PR #146934)

2025-07-03 Thread Abhinav Gaba via cfe-commits
@@ -0,0 +1,83 @@ +// RUN: %libomptarget-compilexx-run-and-check-generic + +#include +#include + +int x[10]; + +void f1() { + int *p; + p = &x[0]; + p[0] = 111; + p[1] = 222; + p[2] = 333; + p[3] = 444; + +#pragma omp target enter data map(to : p) +#pragma omp target enter

[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 updated https://github.com/llvm/llvm-project/pull/146891 >From 9f61909419939491c12384f471df05a504068054 Mon Sep 17 00:00:00 2001 From: Abhinav Gaba Date: Wed, 2 Jul 2025 00:32:33 -0700 Subject: [PATCH 1/2] [NFC][Clang] Refactor mapinfo generation for captured var

[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/8] [analyzer] Avoid unnecessary super region invalidation in `CStrin

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

2025-07-03 Thread via cfe-commits
Author: vabridgers Date: 2025-07-03T09:08:00-05:00 New Revision: c71bbd50a10d733dc066db8f83638f9454c9705d URL: https://github.com/llvm/llvm-project/commit/c71bbd50a10d733dc066db8f83638f9454c9705d DIFF: https://github.com/llvm/llvm-project/commit/c71bbd50a10d733dc066db8f83638f9454c9705d.diff LO

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

2025-07-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/146782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-07-03 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Since we’re on to C++ support now, here’s one more fun case: > > ```c++ > class A {}; A a; > class B : typeof(A) {}; > class C : typeof(a) {}; > ``` Good test cases, but let's handle C++ separately to keep the patch reasonable? https://github.com/llvm/llvm-project/pull/1

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

2025-07-03 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/146782 >From 50c6fcb2a1167b65255d2edce9ef34789b85a7a5 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 2 Jul 2025 16:22:48 +0200 Subject: [PATCH 1/3] Cache the Offset for LastFileIDLookup. --- clang/include/clang/

[clang] [clang-tools-extra] [clang][modules] Serialize `CodeGenOptions` (PR #146422)

2025-07-03 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: I put up https://github.com/llvm/llvm-project/pull/146766 and https://github.com/llvm/llvm-project/pull/146910. Will rebase this PR on top of those once those get approved & merged. https://github.com/llvm/llvm-project/pull/146422 ___

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

2025-07-03 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-s390x-linux-lnt` running on `systemz-1` while building `.github,clang` at step 7 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/136/builds/4462 Here is the relevant piece of th

[clang] [llvm] [llvm-objcopy][libObject] Add RISC-V big-endian support (PR #146913)

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 c,cpp,h -- clang/test/Driver/frame-pointer-elim.c llvm/inclu

[clang] [llvm] [RISCV] Add big-endian support to RISC-V backend (PR #146534)

2025-07-03 Thread Djordje Todorovic via cfe-commits
djtodoro wrote: > llvm-objcopy and libObject changes look fine to me. If you split the > llvm-objcopy changes into a separate PR, I'd be happy to approve directly. Done as https://github.com/llvm/llvm-project/pull/146913. I will rebase this PR on top of that one. https://github.com/llvm/llvm-p

[clang] [llvm] [llvm-objcopy][libObject] Add RISC-V big-endian support (PR #146913)

2025-07-03 Thread Djordje Todorovic via cfe-commits
https://github.com/djtodoro updated https://github.com/llvm/llvm-project/pull/146913 >From a3b50d1a95f4ae76af98e25502a7bdb950592d38 Mon Sep 17 00:00:00 2001 From: Djordje Todorovic Date: Thu, 3 Jul 2025 14:03:14 +0200 Subject: [PATCH] [llvm-objcopy][libObject] Add RISC-V big-endian support Add

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

2025-07-03 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: I noticed there is a problem with __builtin_sycl_unique_stable_name and sycl_kernel_etnry_point attribute. If I add this wrapping of __builtin_sycl_unique_stable_name calls AND sycl_kernel_entry_point attribute, the strings disappear from the IR. They are in here https://godb

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

2025-07-03 Thread via cfe-commits
Author: Corentin Jabot Date: 2025-07-03T20:59:18+03:00 New Revision: 994501abe75c2a2d244785c0d0cf177858ac6eaf URL: https://github.com/llvm/llvm-project/commit/994501abe75c2a2d244785c0d0cf177858ac6eaf DIFF: https://github.com/llvm/llvm-project/commit/994501abe75c2a2d244785c0d0cf177858ac6eaf.diff

[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 closed https://github.com/llvm/llvm-project/pull/146857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC][OpenMP] Add tests for mapping pointers and their dereferences. (PR #146934)

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

[clang] [OpenCL] Add declarations for version 1.1 of cl_intel_subgroups_short (PR #146647)

2025-07-03 Thread Michal Paszkowski via cfe-commits
https://github.com/michalpaszkowski approved this pull request. @Maetveis LGTM! Thanks for the PR! https://github.com/llvm/llvm-project/pull/146647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [llvm] [NFC][OpenMP] Add tests for mapping pointers and their dereferences. (PR #146934)

2025-07-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Abhinav Gaba (abhinavgaba) Changes The output of the compile-and-run tests is incorrect. These will be used for reference in future commits that resolve the issues. Also updated the existing clang LIT test, target_map_both_pointer_pointee

[clang] [OpenCL] Add decls for cl_intel_subgroups_char, cl_intel_subgroups_long (PR #146655)

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/146655 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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] [Clang] Correctly handle allocations in the condition of a `if constexpr` (PR #146890)

2025-07-03 Thread Erich Keane 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()) && erichkeane wrote: `Cond` could still be i

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

2025-07-03 Thread Erich Keane 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 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: Good catch! https://gith

[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] [analyzer] Add support for consteval in ConditionBRVisitor::VisitTerminator (PR #146859)

2025-07-03 Thread Balazs Benics via cfe-commits
steakhal wrote: > Hey, could you add a LIT test that fails before your changes but passes after? Merge it once you are good. The added test should crash the analyzer without the fix, [see](https://godbolt.org/z/jxTMnGEY7). https://github.com/llvm/llvm-project/pull/146859 __

[clang] [Draft] Summary Based Analysis Prototype (PR #144224)

2025-07-03 Thread Balazs Benics via cfe-commits
steakhal wrote: FYI I really wish to come back to this PR, but I'm really busy. https://github.com/llvm/llvm-project/pull/144224 ___ 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/11] [analyzer] Avoid unnecessary super region invalidation in `CStr

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

2025-07-03 Thread via cfe-commits
flovent wrote: Oh, sorry about that. It seems an error node will be generated when emitting `alpha.unix.cstring.OutOfBounds` warning, so rest of code will not be analyzed. https://github.com/llvm/llvm-project/pull/146212 ___ cfe-commits mailing list c

[clang] 77f0f81 - [Sema][ObjC] Treat unknown selector messages as unrecoverable errors under ARC (#146803)

2025-07-03 Thread via cfe-commits
Author: Akira Hatanaka Date: 2025-07-03T10:01:08-07:00 New Revision: 77f0f812b4195bfde3b8d2ddb4b85f78f41a628f URL: https://github.com/llvm/llvm-project/commit/77f0f812b4195bfde3b8d2ddb4b85f78f41a628f DIFF: https://github.com/llvm/llvm-project/commit/77f0f812b4195bfde3b8d2ddb4b85f78f41a628f.diff

[clang] [Sema][ObjC] Treat unknown selector messages as unrecoverable errors under ARC (PR #146803)

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

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

2025-07-03 Thread via cfe-commits
https://github.com/tcottin updated https://github.com/llvm/llvm-project/pull/140498 >From 8fadd8d51fa3d96c7fb82b9d749ef3f35441ac64 Mon Sep 17 00:00:00 2001 From: Tim Cottin Date: Mon, 19 May 2025 06:26:36 + Subject: [PATCH 1/4] [clangd] Improve Markup Rendering --- clang-tools-extra/clang

[clang] [llvm] [AArch64] Add support for -mcpu=gb10. (PR #146515)

2025-07-03 Thread David Green via cfe-commits
https://github.com/davemgreen edited https://github.com/llvm/llvm-project/pull/146515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] [OpenMP] New OpenMP 6.0 self_maps clause - CodeGen (PR #134131)

2025-07-03 Thread via cfe-commits
https://github.com/Ritanya-B-Bharadwaj updated https://github.com/llvm/llvm-project/pull/134131 >From 617df09463f864c2df022ed43b84eec396b9d618 Mon Sep 17 00:00:00 2001 From: Ritanya B Bharadwaj Date: Wed, 2 Apr 2025 13:03:03 -0500 Subject: [PATCH 1/2] [OpenMP] CodeGen support for self_maps ---

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

2025-07-03 Thread via cfe-commits
@@ -9,6 +9,7 @@ #ifndef FORTRAN_OPTIMIZER_CODEGEN_CODEGEN_H #define FORTRAN_OPTIMIZER_CODEGEN_CODEGEN_H +#include "flang/Frontend/CodeGenOptions.h" jeanPerier wrote: Not requesting to do that here, but I feel the CodeGenOptions should be defined in Codegen

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

2025-07-03 Thread via cfe-commits
https://github.com/jeanPerier approved this pull request. Thanks! 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 via cfe-commits
https://github.com/jeanPerier 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] [clang] Add option for -nolibc in Driver/ToolChains/Baremetal.cpp (PR #145700)

2025-07-03 Thread William Huynh via cfe-commits
https://github.com/saturn691 updated https://github.com/llvm/llvm-project/pull/145700 >From 97c87ceb781eee0a04bd93299a341e03cbe68ddd Mon Sep 17 00:00:00 2001 From: William Huynh Date: Wed, 25 Jun 2025 14:25:22 +0100 Subject: [PATCH 1/5] [clang] Add option for -nolibc in Driver/ToolChains/Barem

[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 warning: ``` RUN: at line 1 has no command after substitutions ``` Is because the test looks for the wrong target to be enabled, this will be fixed by: https://github.com/llvm/llvm-project/pull/146869 It's not the cause of the failure. https://github.com/llvm/llvm-proj

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

2025-07-03 Thread Vlad Serebrennikov via cfe-commits
@@ -922,7 +922,7 @@ namespace cwg667 { // cwg667: 8 struct B { ~B() = delete; }; union C { B b; }; - static_assert(!__is_trivially_destructible(C), ""); + static_assert(!__is_trivially_destructible(C), ""); // cxx26-error {{failed}} Endilll wrote: I thi

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

2025-07-03 Thread Vlad Serebrennikov via cfe-commits
@@ -23,8 +24,8 @@ int n; // - X is a union-like class that has a variant member with a non-trivial // default constructor, -union Deleted1a { UserProvidedDefCtor u; }; // expected-note {{default constructor of 'Deleted1a' is implicitly deleted because variant field 'u' has a

[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
https://github.com/mcbarton updated https://github.com/llvm/llvm-project/pull/146786 >From d528fe6474cf233ed024a1479ede12545e59b4c2 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbar...@users.noreply.github.com> Date: Wed, 2 Jul 2025 22:17:30 +0100 Subject: [PATCH] Add __attribute__((visib

[libclc] 85d09de - [libclc] Add prepare- targets (#146700)

2025-07-03 Thread via cfe-commits
Author: Fraser Cormack Date: 2025-07-03T08:30:33+01:00 New Revision: 85d09de5fa19a32bbcc400928d55f9d633077640 URL: https://github.com/llvm/llvm-project/commit/85d09de5fa19a32bbcc400928d55f9d633077640 DIFF: https://github.com/llvm/llvm-project/commit/85d09de5fa19a32bbcc400928d55f9d633077640.diff

[libclc] [libclc] Add prepare- targets (PR #146700)

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

[libclc] [libclc] Add prepare- targets (PR #146700)

2025-07-03 Thread Fraser Cormack via cfe-commits
@@ -356,55 +356,72 @@ function(add_libclc_builtin_set) set( builtins_link_lib $ ) + # For SPIR-V targets we diverage at this point and generate SPIR-V using the + # llvm-spirv tool. if( ARG_ARCH STREQUAL spirv OR ARG_ARCH STREQUAL spirv64 ) -set( spv_suffix ${ARG_

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

2025-07-03 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/146645 >From b9c3c4e0eca567937e59b2ae21f805d8156f7204 Mon Sep 17 00:00:00 2001 From: Ziqing Luo Date: Wed, 2 Jul 2025 15:46:37 +0800 Subject: [PATCH 1/3] [clang-scan-deps] Fix "unterminated conditional directive"

[clang] [llvm] [AArch64] Add support for -mcpu=gb10. (PR #146515)

2025-07-03 Thread David Green via cfe-commits
https://github.com/davemgreen edited https://github.com/llvm/llvm-project/pull/146515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add support of Zibi experimental extension (PR #127463)

2025-07-03 Thread Boyao Wang via cfe-commits
https://github.com/BoyaoWang430 updated https://github.com/llvm/llvm-project/pull/127463 >From aea8133a1fe38791bad4a45e6dcc53d9fe05f771 Mon Sep 17 00:00:00 2001 From: wangboyao Date: Thu, 3 Jul 2025 16:08:15 +0800 Subject: [PATCH] [RISCV][MC] Add MC support of Zibi experimental extension This

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

2025-07-03 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed 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/cfe-commits

[clang] [Clang] [Diagnostics] Simplify filenames that contain '..' (PR #143520)

2025-07-03 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > My expectation would be that if I specify a header filter I'm not going to > use weird paths like a/b/../foo.h, but just a/foo.h because that is where > foo.h lives. What about symlinks though? Would you expect that passing `path/to/file` fails because `path` is a symlin

[clang] [C23][Parser] Diagnostic for attribute declaration where statement is required (PR #146224)

2025-07-03 Thread via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c2x -verify %s yronglin wrote: c2x-fallthrough2.c was reverted, we don't need it in current implementation, but I change c2x to c23 in c2x-fallthrough.c https://github.com/llvm/llvm-project/pull/146224 ___

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

2025-07-03 Thread via cfe-commits
https://github.com/yronglin approved this pull request. Thanks, LGTM! https://github.com/llvm/llvm-project/pull/146394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23][Parser] Diagnostic for attribute declaration where statement is required (PR #146224)

2025-07-03 Thread via cfe-commits
@@ -7246,337 +7248,339 @@ class Parser : public CodeCompletionHandler { ParseStatementOrDeclaration(StmtVector &Stmts, ParsedStmtContext StmtCtx, SourceLocation *TrailingElseLoc = nullptr); - StmtResult ParseStatementOrDeclarationAfterAttribute

[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/5] [C23] Fix typeof handling in enum declarations We have

<    1   2   3   4   5   6   >