[clang] [flang] [mlir] [mlir] Remove deprecated GEN_PASS_CLASSES. (PR #166904)

2025-11-06 Thread Michele Scuttari via cfe-commits
https://github.com/mscuttari approved this pull request. Leftover of mine, thank you for addressing it! https://github.com/llvm/llvm-project/pull/166904 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/list

[clang] [clang] Support constrained fp elementwise builtins (PR #166905)

2025-11-06 Thread Jakub Ficek via cfe-commits
https://github.com/ficol created https://github.com/llvm/llvm-project/pull/166905 Currently only __builtin_elementwise_sqrt emits contrained fp intrinsic and propagates fp options. This commit adds this support for the rest of elementwise builtins. >From 4e1ffa02e4493ba5c84f64e534909479a9acb3e

[clang] [llvm] [SelectionDAG] Fix assertion failure on inline asm register type mismatch (PR #166615)

2025-11-06 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang deleted https://github.com/llvm/llvm-project/pull/166615 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SelectionDAG] Fix assertion failure on inline asm register type mismatch (PR #166615)

2025-11-06 Thread Phoebe Wang via cfe-commits
@@ -1,13 +1,15 @@ // RUN: %clang_cc1 -verify -triple x86_64-unknown-unknown -emit-llvm-only %s +// RUN: %clang_cc1 -verify -triple x86_64-unknown-unknown -emit-llvm-only -fopenmp %s phoebewang wrote: `=omp` still missing https://github.com/llvm/llvm-project/pu

[clang] [llvm] [SelectionDAG] Fix assertion failure on inline asm register type mismatch (PR #166615)

2025-11-06 Thread Phoebe Wang via cfe-commits
@@ -1,13 +1,13 @@ // RUN: %clang_cc1 -verify -triple x86_64-unknown-unknown -emit-llvm-only %s +// RUN: %clang_cc1 -verify -triple x86_64-unknown-unknown -emit-llvm-only -fopenmp %s phoebewang wrote: `=omp` still missing https://github.com/llvm/llvm-project/pu

[clang-tools-extra] [clang-doc] remove indentation for preformatted text (PR #166672)

2025-11-06 Thread Erick Velez via cfe-commits
https://github.com/evelez7 updated https://github.com/llvm/llvm-project/pull/166672 >From 9cfef46989802cafe3b62759685b427afa8588f4 Mon Sep 17 00:00:00 2001 From: Erick Velez Date: Wed, 5 Nov 2025 16:24:22 -0800 Subject: [PATCH] [clang-doc] remove indentation for preformatted text Text that is

[clang] [flang] [mlir] [mlir] Remove deprecated GEN_PASS_CLASSES. (PR #166904)

2025-11-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-flang-fir-hlfir Author: Jacques Pienaar (jpienaar) Changes This was marked as deprecated in 2022, but as comment. Switch to error to make visible and stop generating. Will remove the error message in follow up, just felt this was easier for folks to un

[clang] [flang] [mlir] [mlir] Remove deprecated GEN_PASS_CLASSES. (PR #166904)

2025-11-06 Thread Jacques Pienaar via cfe-commits
https://github.com/jpienaar created https://github.com/llvm/llvm-project/pull/166904 This was marked as deprecated in 2022, but as comment. Switch to error to make visible and stop generating. Will remove the error message in follow up, just felt this was easier for folks to understand compila

[clang] [llvm] [SelectionDAG] Fix assertion failure on inline asm register type mismatch (PR #166615)

2025-11-06 Thread Ahmed Nour via cfe-commits
https://github.com/ahmednoursphinx updated https://github.com/llvm/llvm-project/pull/166615 >From 684e005c76d7db5500fb0925547b58327c993d84 Mon Sep 17 00:00:00 2001 From: ahmed Date: Wed, 5 Nov 2025 20:52:13 +0200 Subject: [PATCH 01/13] [SelectionDAG] Fix assertion failure on inline asm registe

[clang] [llvm] [SelectionDAG] Fix assertion failure on inline asm register type mismatch (PR #166615)

2025-11-06 Thread Phoebe Wang via cfe-commits
@@ -1,13 +1,13 @@ // RUN: %clang_cc1 -verify -triple x86_64-unknown-unknown -emit-llvm-only %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm-only -fopenmp %s phoebewang wrote: `-verify` is missing. https://github.com/llvm/llvm-project/pull/16661

[clang] [clang] Proofread *.rst (PR #166897)

2025-11-06 Thread Tim Gymnich via cfe-commits
https://github.com/tgymnich approved this pull request. https://github.com/llvm/llvm-project/pull/166897 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Proofread *.rst (PR #166897)

2025-11-06 Thread Matt Arsenault via cfe-commits
@@ -58,7 +58,7 @@ adopt, offering these properties that make it widely adoptable in practice: * It has a relatively low adoption cost. This document discusses the key designs of ``-fbounds-safety``. The document is -subject to be actively updated with a more detailed specific

[clang] [[gnu::weak]] disables constant evaluation of constexpr variables in C++14 (PR #166852)

2025-11-06 Thread via cfe-commits
https://github.com/hstk30-hw edited https://github.com/llvm/llvm-project/pull/166852 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Proofread *.rst (PR #166897)

2025-11-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes This patch is limited to single-word replacements to fix spelling and/or grammar to ease the review process. Punctuation and markdown fixes are specifically excluded. --- Full diff: https://github.com

[clang] [clang] Proofread *.rst (PR #166897)

2025-11-06 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/166897 This patch is limited to single-word replacements to fix spelling and/or grammar to ease the review process. Punctuation and markdown fixes are specifically excluded. >From df157419dd9f5f33b062e67dead55

[clang-tools-extra] [clang-tools-extra] Remove redundant declarations (NFC) (PR #166894)

2025-11-06 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/166894 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tools-extra] Remove redundant declarations (NFC) (PR #166894)

2025-11-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Kazu Hirata (kazutakahirata) Changes In C++17, static constexpr members are implicitly inline, so they no longer require an out-of-line definition. Identified with readability-redundant-declaration. --- Full diff: https://git

[clang-tools-extra] [clang-tools-extra] Remove redundant declarations (NFC) (PR #166894)

2025-11-06 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/166894 In C++17, static constexpr members are implicitly inline, so they no longer require an out-of-line definition. Identified with readability-redundant-declaration. >From d1c619a075f1bfab6250c7c4716ef81c55

[clang] [clang-tools-extra] [flang] [lldb] [llvm] [clang] Refactor option-related code from clangDriver into new clangOptions library (PR #163659)

2025-11-06 Thread Naveen Seth Hanig via cfe-commits
https://github.com/naveen-seth edited https://github.com/llvm/llvm-project/pull/163659 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [flang] [lldb] [llvm] [clang] Refactor option-related code from clangDriver into new clangOptions library (PR #163659)

2025-11-06 Thread Naveen Seth Hanig via cfe-commits
@@ -27,7 +27,6 @@ #include "clang/Basic/XRayInstr.h" #include "clang/Config/config.h" #include "clang/Driver/Driver.h" naveen-seth wrote: That does seem like the better solution! I've moved `GetResourcesPath()` into `clangOptions` in the follow up (#165277,

[clang] [Clang] Use ExtWarn for static local variable in extern inline function (fixes #39524) (PR #166332)

2025-11-06 Thread V S Susi Krishna via cfe-commits
https://github.com/Susikrishna updated https://github.com/llvm/llvm-project/pull/166332 >From 16414b96e0ca5ee44b0332bc387ecbd0046eacd4 Mon Sep 17 00:00:00 2001 From: Susikrishna Date: Tue, 4 Nov 2025 12:49:38 +0530 Subject: [PATCH 1/7] [Clang] Use ExtWarn for static local variable in extern in

[clang] [Clang] Use ExtWarn for static local variable in extern inline function (fixes #39524) (PR #166332)

2025-11-06 Thread via cfe-commits
https://github.com/Sirraide auto_merge_disabled https://github.com/llvm/llvm-project/pull/166332 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LifetimeSafety] Optimize fact storage with IDs and vector-based lookup (PR #165963)

2025-11-06 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-darwin` running on `doug-worker-3` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/23/builds/15335 Here is the

[clang-tools-extra] [clang-tidy][NFC] Add missing "Check" suffix to filenames in clang-tidy checks (PR #166889)

2025-11-06 Thread via cfe-commits
https://github.com/zeyi2 updated https://github.com/llvm/llvm-project/pull/166889 >From 3a8721888fa09815f68f18f7fbe39f5fa68f3758 Mon Sep 17 00:00:00 2001 From: mtx Date: Fri, 7 Nov 2025 12:27:39 +0800 Subject: [PATCH 1/2] [clang-tidy] Add missing "Check" suffix to checks --- .../clang-tidy/ce

[clang] [lld] [llvm] [WIP][IR][Constants] Change the semantic of `ConstantPointerNull` to represent an actual `nullptr` instead of a zero-value pointer (PR #166667)

2025-11-06 Thread Shilei Tian via cfe-commits
@@ -42,7 +42,7 @@ define amdgpu_kernel void @addrspacecast_flat_null_to_local(ptr addrspace(1) %ou ; CHECK-NEXT:PAD ; CHECK-NEXT:ALU clause starting at 4: ; CHECK-NEXT: MOV * T0.X, literal.x, -; CHECK-NEXT:-1(nan), 0(0.00e+00) +; CHECK-NEXT:0(0.00e+

[clang-tools-extra] [clang-tidy][NFC] Add missing "Check" suffix to filenames in clang-tidy checks (PR #166889)

2025-11-06 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code linter clang-tidy found issues in your code. :warning: You can test this locally with the following command: ```bash git diff -U0 origin/main...HEAD -- clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp clang-tools-extra/clang-tidy/cppc

[clang] [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (PR #165789)

2025-11-06 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-riscv-rva23-evl-vec-2stage` running on `rise-clang-riscv-rva23-evl-vec-2stage` while building `clang` at step 4 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/132/builds/3341 Here

[clang] [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (PR #165789)

2025-11-06 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux-bootstrap-msan` running on `sanitizer-buildbot6` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/164/builds/15348 Here is the relev

[clang] [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (PR #165789)

2025-11-06 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux-bootstrap-ubsan` running on `sanitizer-buildbot9` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/85/builds/15388 Here is the rele

[clang] [LifetimeSafety] Optimize fact storage with IDs and vector-based lookup (PR #165963)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/165963 >From 0dafeb9fad277d1ae20cb712888e4bdc1b88ca51 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Sat, 1 Nov 2025 03:16:20 + Subject: [PATCH] Avoid using DenseMap for CFGBlock and program points --- .../Ana

[clang] [LifetimeSafety] Optimize fact storage with IDs and vector-based lookup (PR #165963)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/165963 >From 2f4af6fcb2d460c487e1ecc201c71be451b9bfdb Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Sat, 1 Nov 2025 03:16:20 + Subject: [PATCH] Avoid using DenseMap for CFGBlock and program points --- .../Ana

[clang] f8e9b89 - [CodeGen] Fix a warning

2025-11-06 Thread Kazu Hirata via cfe-commits
Author: Kazu Hirata Date: 2025-11-06T19:58:59-08:00 New Revision: f8e9b89ae07aebf09822b61f18966d2316e7b40e URL: https://github.com/llvm/llvm-project/commit/f8e9b89ae07aebf09822b61f18966d2316e7b40e DIFF: https://github.com/llvm/llvm-project/commit/f8e9b89ae07aebf09822b61f18966d2316e7b40e.diff L

[clang] feat: included support for is_constant builtin (PR #166832)

2025-11-06 Thread Sathwik Kodamarthi via cfe-commits
@@ -4052,6 +4093,44 @@ def CIR_ExpectOp : CIR_Op<"expect", [ }]; } +//===--===// +// IsConstantOp siddu0660 wrote: Thanks for mentioning the incubator ! I hadn’t come across that detail ear

[clang] [LifetimeSafety] Optimize fact storage with IDs and vector-based lookup (PR #165963)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/165963 >From 2dd60afa4c4aeae46e55390b99d228a8583c03c9 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Sat, 1 Nov 2025 03:16:20 + Subject: [PATCH] Avoid using DenseMap for CFGBlock and program points --- .../Ana

[clang] [BoundsSafety] Support late parsing for `counted_by` in type positions (PR #166491)

2025-11-06 Thread Henrik G. Olsson via cfe-commits
@@ -2325,13 +2328,16 @@ class Declarator { /// This function takes attrs by R-Value reference because it takes ownership /// of those attributes from the parameter. void AddTypeInfo(const DeclaratorChunk &TI, ParsedAttributes &&attrs, - SourceLocation En

[clang] [BoundsSafety] Support late parsing for `counted_by` in type positions (PR #166491)

2025-11-06 Thread Henrik G. Olsson via cfe-commits
@@ -102,111 +102,83 @@ struct on_pointer_anon_count { //== // __sized_by_or_null on struct member pointer in type attribute position //=

[clang] [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (PR #165789)

2025-11-06 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux-bootstrap-hwasan` running on `sanitizer-buildbot12` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/55/builds/19715 Here is the re

[clang] f29955a - [Clang][Sema] Allow counted_by on void* as GNU extension (#164737)

2025-11-06 Thread via cfe-commits
Author: Kees Cook Date: 2025-11-06T19:10:36-08:00 New Revision: f29955a594aedf5943d492a999b83e8c6b8fafae URL: https://github.com/llvm/llvm-project/commit/f29955a594aedf5943d492a999b83e8c6b8fafae DIFF: https://github.com/llvm/llvm-project/commit/f29955a594aedf5943d492a999b83e8c6b8fafae.diff LOG

[clang] [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (PR #165789)

2025-11-06 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-ubuntu-fast` running on `sie-linux-worker` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/39567

[clang] c88e207 - [LifetimeSafety] Fix typo which breaks the test

2025-11-06 Thread via cfe-commits
Author: Utkarsh Saxena Date: 2025-11-06T22:07:56-05:00 New Revision: c88e207bf16f3f6467c1a55dbda58070313a02e7 URL: https://github.com/llvm/llvm-project/commit/c88e207bf16f3f6467c1a55dbda58070313a02e7 DIFF: https://github.com/llvm/llvm-project/commit/c88e207bf16f3f6467c1a55dbda58070313a02e7.diff

[clang] [LifetimeSafety] Optimize fact storage with IDs and vector-based lookup (PR #165963)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/165963 >From d1e459947ea54657260d010391734b81f3203981 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Sat, 1 Nov 2025 03:16:20 + Subject: [PATCH] Avoid using DenseMap for CFGBlock and program points --- .../Ana

[clang] [BoundsSafety] Support late parsing for `counted_by` in type positions (PR #166491)

2025-11-06 Thread Yeoul Na via cfe-commits
@@ -2325,13 +2328,16 @@ class Declarator { /// This function takes attrs by R-Value reference because it takes ownership /// of those attributes from the parameter. void AddTypeInfo(const DeclaratorChunk &TI, ParsedAttributes &&attrs, - SourceLocation En

[clang] [LifetimeSafety] Optimize fact storage with IDs and vector-based lookup (PR #165963)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/165963 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 8fca65c - [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (#165789)

2025-11-06 Thread via cfe-commits
Author: Utkarsh Saxena Date: 2025-11-06T22:02:39-05:00 New Revision: 8fca65c65e3aab9bfdb1a3252335a880689a3f61 URL: https://github.com/llvm/llvm-project/commit/8fca65c65e3aab9bfdb1a3252335a880689a3f61 DIFF: https://github.com/llvm/llvm-project/commit/8fca65c65e3aab9bfdb1a3252335a880689a3f61.diff

[clang] [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (PR #165789)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/165789 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (PR #165789)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/165789 >From 11055e3d1ddb0a2b0e21c89729af380bcb8f5252 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Thu, 30 Oct 2025 22:01:36 + Subject: [PATCH 1/2] persistent-origin-optimisation --- .../LifetimeSafety/LoanP

[clang] [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (PR #165789)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
usx95 wrote: ### Merge activity * **Nov 7, 3:00 AM UTC**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.com/github/pr/llvm/llvm-project/165789). https://github.com/llvm/llvm-project/pull/165789 ___

[clang] [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (PR #165789)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -5,36 +5,114 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===--===// -#include "clang/Analysis/Analyses/LifetimeSafety/LoanPropagation.h" -#include "Dataflow.h" +#include #include

[clang] [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (PR #165789)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -543,7 +543,6 @@ TEST_F(LifetimeAnalysisTest, PointersInACycle) { EXPECT_THAT(Origin("p1"), HasLoansTo({"v1", "v2", "v3"}, "after_loop")); EXPECT_THAT(Origin("p2"), HasLoansTo({"v1", "v2", "v3"}, "after_loop")); EXPECT_THAT(Origin("p3"), HasLoansTo({"v1", "v2", "v3"},

[clang] [LifetimeSafety] Optimize loan propagation by separating persistent and block-local origins (PR #165789)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -5,36 +5,114 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===--===// -#include "clang/Analysis/Analyses/LifetimeSafety/LoanPropagation.h" -#include "Dataflow.h" +#include #include

[clang] [llvm] [GlobalOpt] Add TTI interface useFastCCForInternalCall for FASTCC (PR #164768)

2025-11-06 Thread Alex Bezzubikov via cfe-commits
zuban32 wrote: > > A function could be external before LTO stage, and become internal only > > after LTO symbol resolution. I.e. we're linking against some older object > > file which has the function compiled with some older definition of the > > target feature, and the calls to that function

[clang-tools-extra] f2857c2 - [clang-tidy] Fix `readability-use-concise-preprocessor-directives` check (#166000)

2025-11-06 Thread via cfe-commits
Author: mitchell Date: 2025-11-06T18:49:24-08:00 New Revision: f2857c2aded10a7ce9e358f0f55d5eb1a344b9a5 URL: https://github.com/llvm/llvm-project/commit/f2857c2aded10a7ce9e358f0f55d5eb1a344b9a5 DIFF: https://github.com/llvm/llvm-project/commit/f2857c2aded10a7ce9e358f0f55d5eb1a344b9a5.diff LOG:

[clang-tools-extra] [clang-tidy] Fix `readability-use-concise-preprocessor-directives` check (PR #166000)

2025-11-06 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook closed https://github.com/llvm/llvm-project/pull/166000 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [GlobalOpt] Add TTI interface useFastCCForInternalCall for FASTCC (PR #164768)

2025-11-06 Thread Phoebe Wang via cfe-commits
phoebewang wrote: > A function could be external before LTO stage, and become internal only after > LTO symbol resolution. I.e. we're linking against some older object file > which has the function compiled with some older definition of the target > feature, and the calls to that function in a

[clang] Revert "Ignore trailing NullStmts in StmtExprs for GCC compatibility." (PR #166036)

2025-11-06 Thread via cfe-commits
https://github.com/KaiYG updated https://github.com/llvm/llvm-project/pull/166036 >From 91c2333455265c6596411d033bb849b4b5254f01 Mon Sep 17 00:00:00 2001 From: Kai Kai-Yi Weng Date: Sun, 2 Nov 2025 10:37:32 +0800 Subject: [PATCH 1/3] Revert "Ignore trailing NullStmts in StmtExprs for GCC compa

[clang] [CIR] Recognize constant aggregate initialization of auto vars (PR #166850)

2025-11-06 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. https://github.com/llvm/llvm-project/pull/166850 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add name for `ObjCInterface` in vTable (PR #166817)

2025-11-06 Thread via cfe-commits
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Developer Policy](https://llvm.org/docs/DeveloperPol

[clang] [CIR] Emit promise declaration in coroutine (PR #166683)

2025-11-06 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/166683 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver] Obey -fuse-ld=... for -print-prog-name=ld output (PR #66698)

2025-11-06 Thread Roland McGrath via cfe-commits
https://github.com/frobtech updated https://github.com/llvm/llvm-project/pull/66698 >From aff75e8f64c8d2515f5fc152b33d5be514568269 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 18 Sep 2023 13:39:08 -0700 Subject: [PATCH] [clang][Driver] Obey -fuse-ld=... for -print-prog-name=ld outp

[clang] [NFC][CUDA][HIP] Print the triple when there's no mcpu (PR #166565)

2025-11-06 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx closed https://github.com/llvm/llvm-project/pull/166565 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 16ca2eb - [NFC][CUDA][HIP] Print the triple when there's no mcpu (#166565)

2025-11-06 Thread via cfe-commits
Author: Alex Voicu Date: 2025-11-07T02:01:31+02:00 New Revision: 16ca2eb77b2cf1d129747d37f3e3da1f4b9c8365 URL: https://github.com/llvm/llvm-project/commit/16ca2eb77b2cf1d129747d37f3e3da1f4b9c8365 DIFF: https://github.com/llvm/llvm-project/commit/16ca2eb77b2cf1d129747d37f3e3da1f4b9c8365.diff LO

[clang] [Clang][Sema] Allow counted_by on void* as GNU extension (PR #164737)

2025-11-06 Thread Kees Cook via cfe-commits
https://github.com/kees updated https://github.com/llvm/llvm-project/pull/164737 >From 4609f8c24170d3caf5245a140d4ff1c7cabbec5a Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Wed, 22 Oct 2025 23:56:41 + Subject: [PATCH 1/8] [Clang][Sema] Allow counted_by on void* in GNU mode The counted_by

[clang] [Clang][Sema] Allow counted_by on void* as GNU extension (PR #164737)

2025-11-06 Thread Kees Cook via cfe-commits
@@ -1211,11 +1211,13 @@ llvm::Value *CodeGenFunction::emitCountedByPointerSize( getContext().getTypeSizeInChars(ElementTy->getPointeeType()); if (ElementSize.isZero()) { - // This might be a __sized_by on a 'void *', which counts bytes, not - // elements.

[clang] [llvm] [llvm][clang] Sandbox filesystem reads (PR #165350)

2025-11-06 Thread Ben Langmuir via cfe-commits
@@ -111,10 +118,16 @@ class CrossProcessModuleCache : public ModuleCache { std::unique_ptr getLock(StringRef ModuleFilename) override { +// This is a compiler-internal input/output, let's bypass the sandbox. +auto BypassSandbox = llvm::sys::sandbox::scopedDisable()

[clang] [llvm] [llvm][clang] Sandbox filesystem reads (PR #165350)

2025-11-06 Thread Ben Langmuir via cfe-commits
@@ -399,10 +422,14 @@ void RealFileSystem::printImpl(raw_ostream &OS, PrintType Type, IntrusiveRefCntPtr vfs::getRealFileSystem() { static IntrusiveRefCntPtr FS = makeIntrusiveRefCnt(true); + sys::sandbox::violationIfEnabled(); benlangmuir wrote: We

[clang] [llvm] [llvm][clang] Sandbox filesystem reads (PR #165350)

2025-11-06 Thread Ben Langmuir via cfe-commits
@@ -110,9 +105,6 @@ class LLVM_ABI AsmPrinter : public MachineFunctionPass { /// generating (such as the current section etc). std::unique_ptr OutStreamer; - /// The VFS to resolve asm include directives. - IntrusiveRefCntPtr VFS; benlangmuir wrote: Wha

[clang] [llvm] [llvm][clang] Sandbox filesystem reads (PR #165350)

2025-11-06 Thread Ben Langmuir via cfe-commits
@@ -1447,6 +1448,8 @@ class directory_iterator { explicit directory_iterator(const Twine &path, std::error_code &ec, bool follow_symlinks = true) : FollowSymlinks(follow_symlinks) { +sandbox::violationIfEnabled(); benla

[clang] [llvm] [llvm][clang] Sandbox filesystem reads (PR #165350)

2025-11-06 Thread Ben Langmuir via cfe-commits
@@ -0,0 +1,41 @@ +//===- IOSandbox.h --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [llvm] [llvm][clang] Sandbox filesystem reads (PR #165350)

2025-11-06 Thread Ben Langmuir via cfe-commits
@@ -347,12 +348,15 @@ llvm::Expected FileManager::getSTDIN() { if (STDIN) return *STDIN; - std::unique_ptr Content; - if (auto ContentOrError = llvm::MemoryBuffer::getSTDIN()) -Content = std::move(*ContentOrError); - else + auto ContentOrError = [] { +auto By

[clang] [llvm] [llvm][clang] Sandbox filesystem reads (PR #165350)

2025-11-06 Thread Ben Langmuir via cfe-commits
@@ -1132,6 +1147,8 @@ bool is_other(const basic_file_status &status) { } std::error_code is_other(const Twine &Path, bool &Result) { + sandbox::violationIfEnabled(); benlangmuir wrote: Won't we catch these via `status` being a violation? Similarly for the o

[clang] [lldb] [llvm] [cmake] Add support for statically linking libxml2 (PR #166867)

2025-11-06 Thread Keith Smiley via cfe-commits
keith wrote: cc @tstellar since this is similar to the zstd setting and I changed it in the release cmake config here cc @petrhosek re https://discourse.llvm.org/t/cannot-cmake-self-hosted-clang-on-windows-for-lack-of-libxml2/58793/12?u=keith https://github.com/llvm/llvm-project/pull/166867 __

[clang] Add name for `ObjCInterface` in vTable (PR #166817)

2025-11-06 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: This needs a test https://github.com/llvm/llvm-project/pull/166817 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [cmake] Add support for statically linking libxml2 (PR #166867)

2025-11-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Keith Smiley (keith) Changes Dynamically depending on libxml2 results in various annoyances across different linux distros for release artifacts. Specifically on fedora and nixos the library has a different name than on debian, and on arch-

[clang] [lldb] [llvm] [cmake] Add support for statically linking libxml2 (PR #166867)

2025-11-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Keith Smiley (keith) Changes Dynamically depending on libxml2 results in various annoyances across different linux distros for release artifacts. Specifically on fedora and nixos the library has a different name than on debian, and on arch-l

[clang] [lldb] [llvm] [cmake] Add support for statically linking libxml2 (PR #166867)

2025-11-06 Thread Keith Smiley via cfe-commits
https://github.com/keith created https://github.com/llvm/llvm-project/pull/166867 Dynamically depending on libxml2 results in various annoyances across different linux distros for release artifacts. Specifically on fedora and nixos the library has a different name than on debian, and on arch-lin

[clang] Adding implementation for printings missing origin stats for lifetime analysis (PR #166568)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/166568 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding implementation for printings missing origin stats for lifetime analysis (PR #166568)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/166568 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding implementation for printings missing origin stats for lifetime analysis (PR #166568)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 requested changes to this pull request. Thanks for working on this. I have a primary comment on . This implementation exposes many `internal::` details of lifetime safety to `AnalysisBasedWarnings.h`. Layering-wise I propose the following changes: - Define `struct Life

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -39,11 +39,11 @@ class Fact { /// loan set. OriginFlow, /// An origin escapes the function by flowing into the return value. -ReturnOfOrigin, -/// An origin is used (eg. appears as l-value expression like DeclRefExpr). Use, /// A marker for a sp

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -74,11 +84,25 @@ class AnalysisImpl /// one. Lattice join(Lattice L1, Lattice L2) const { LivenessMap Merged = L1.LiveOrigins; -// Take the earliest UseFact to make the join hermetic and commutative. -auto CombineUseFact = [](const UseFact &A, -

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -2808,6 +2808,17 @@ class LifetimeSafetyReporterImpl : public LifetimeSafetyReporter { << UseExpr->getEndLoc(); } + void reportUseAfterReturn(const Expr *IssueExpr, const Expr *EscapeExpr, +SourceLocation ExpiryLoc, Confidence C) over

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -166,7 +169,8 @@ void FactsGenerator::VisitReturnStmt(const ReturnStmt *RS) { if (const Expr *RetExpr = RS->getRetValue()) { if (hasOrigin(RetExpr)) { OriginID OID = FactMgr.getOriginMgr().getOrCreate(*RetExpr); - CurrentBlockFacts.push_back(FactMgr.createFa

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -43,7 +43,7 @@ struct LivenessInfo { /// multiple uses along different paths, this will point to the use appearing /// earlier in the translation unit. /// This is 'null' when the origin is not live. - const UseFact *CausingUseFact; + const Fact *CausingFact; ---

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -582,3 +714,28 @@ void lifetimebound_ctor() { } (void)v; } + +View lifetimebound_return_of_local(){ + MyObj stack; + return Identity(stack); // expected-warning {{returning reference to stack allocated object}} + // expected-note@-1 {{returned

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -1202,5 +1202,242 @@ TEST_F(LifetimeAnalysisTest, LivenessOutsideLoop) { EXPECT_THAT(Origins({"p"}), MaybeLiveAt("p1")); } +TEST_F(LifetimeAnalysisTest, SimpleReturnStackAddress) { + SetupTest(R"( +MyObj* target() { + MyObj s; + MyObj* p = &s; + POINT(

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -93,6 +93,9 @@ class FactsGenerator : public ConstStmtVisitor { FactManager &FactMgr; AnalysisDeclContext &AC; llvm::SmallVector CurrentBlockFacts; + // Collect origins that escape the function in this block. These are handled + // at the end of the block to ensure

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -396,6 +396,131 @@ void loan_from_previous_iteration(MyObj safe, bool condition) { } // expected-note {{destroyed here}} } +//===--===// +// Basic Definite Use-After-Return (Return-Stack-Addr

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -10728,8 +10728,19 @@ def warn_lifetime_safety_loan_expires_permissive : Warning< def warn_lifetime_safety_loan_expires_strict : Warning< "object whose reference is captured may not live long enough">, InGroup, DefaultIgnore; + +def warn_lifetime_safety_return_stack_a

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -53,6 +53,16 @@ struct Lattice { } }; +static SourceLocation GetFactLoc(const Fact &F) { + if (const auto *UF = F.getAs()) { +return UF->getUseExpr()->getExprLoc(); + } + if (const auto *OEF = F.getAs()) { +return OEF->getEscapeExpr()->getExprLoc(); + } + ret

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -93,6 +93,9 @@ class FactsGenerator : public ConstStmtVisitor { FactManager &FactMgr; AnalysisDeclContext &AC; llvm::SmallVector CurrentBlockFacts; + // Collect origins that escape the function in this block. These are handled usx95 wrote: nit: sugg

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -53,6 +53,16 @@ struct Lattice { } }; +static SourceLocation GetFactLoc(const Fact &F) { + if (const auto *UF = F.getAs()) { +return UF->getUseExpr()->getExprLoc(); + } usx95 wrote: nit: remove braces here as well. https://github.com/llvm/llvm-pro

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -112,8 +114,17 @@ class LifetimeChecker { for (const auto &[LID, Warning] : FinalWarningsMap) { const Loan &L = FactMgr.getLoanMgr().getLoan(LID); const Expr *IssueExpr = L.IssueExpr; - Reporter->reportUseAfterFree(IssueExpr, Warning.UseExpr, -

[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

2025-11-06 Thread Utkarsh Saxena via cfe-commits
@@ -112,8 +114,17 @@ class LifetimeChecker { for (const auto &[LID, Warning] : FinalWarningsMap) { const Loan &L = FactMgr.getLoanMgr().getLoan(LID); const Expr *IssueExpr = L.IssueExpr; - Reporter->reportUseAfterFree(IssueExpr, Warning.UseExpr, -

[clang] [CIR] Recognize constant aggregate initialization of auto vars (PR #166850)

2025-11-06 Thread Amr Hesham via cfe-commits
@@ -265,16 +258,11 @@ void bin_comma() { // CIR: cir.func{{.*}} @_Z9bin_commav() // CIR: %[[A_ADDR:.*]] = cir.alloca !rec_CompleteS, !cir.ptr, ["a", init] -// CIR: %[[TMP_ADDR:.*]] = cir.alloca !rec_CompleteS, !cir.ptr, ["agg.tmp.ensured"] -// CIR: %[[ZERO:.*]] = cir.c

[clang] [CIR] Recognize constant aggregate initialization of auto vars (PR #166850)

2025-11-06 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper edited https://github.com/llvm/llvm-project/pull/166850 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Recognize constant aggregate initialization of auto vars (PR #166850)

2025-11-06 Thread Amr Hesham via cfe-commits
@@ -284,20 +272,13 @@ void bin_comma() { void compound_literal_expr() { CompleteS a = (CompleteS){}; } // CIR: %[[A_ADDR:.*]] = cir.alloca !rec_CompleteS, !cir.ptr, ["a", init] -// CIR: %[[A_ELEM_0_PTR:.*]] = cir.get_member %[[A_ADDR]][0] {name = "a"} : !cir.ptr -> !cir.ptr

[clang] [CIR] Recognize constant aggregate initialization of auto vars (PR #166850)

2025-11-06 Thread Amr Hesham via cfe-commits
@@ -107,21 +107,14 @@ void paren_expr() { // CIR: cir.func{{.*}} @_Z10paren_exprv() // CIR: %[[A_ADDR:.*]] = cir.alloca !rec_Point, !cir.ptr, ["a", init] // CIR: %[[B_ADDR:.*]] = cir.alloca !rec_Point, !cir.ptr, ["b", init] -// CIR: %[[X_ELEM_PTR:.*]] = cir.get_member %

[clang] [CIR] Recognize constant aggregate initialization of auto vars (PR #166850)

2025-11-06 Thread Amr Hesham via cfe-commits
@@ -312,23 +312,10 @@ void l5() { // CIR: %[[BEGIN_ADDR:.*]] = cir.alloca {{.*}} ["__begin1", init] // CIR: %[[END_ADDR:.*]] = cir.alloca {{.*}} ["__end1", init] // CIR: %[[X_ADDR:.*]] = cir.alloca {{.*}} ["x", init] -// CIR: %[[ARR_CAST:.*]] = cir.cast array_to

[clang] [CIR] Recognize constant aggregate initialization of auto vars (PR #166850)

2025-11-06 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper approved this pull request. LGTM, Thanks! https://github.com/llvm/llvm-project/pull/166850 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CLANG][OpenMP] Add support for OpenMP6.0 transparent clause (PR #166810)

2025-11-06 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/166810 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   >