[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,50 @@ +//===--- UseScopedLockCheck.h - clang-tidy --*- 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-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,81 @@ +.. title:: clang-tidy - modernize-use-scoped-lock + +modernize-use-scoped-lock += + +Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's more +flexible and safer alternative ``std::scoped_lock``. The check will +auto

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-12 Thread Reid Kleckner via cfe-commits
@@ -2964,20 +2963,36 @@ static bool isValidCodeModelAttr(Sema &S, StringRef Str) { static void handleCodeModelAttr(Sema &S, Decl *D, const ParsedAttr &AL) { StringRef Str; SourceLocation LiteralLoc; + auto IsTripleSupported = [](const llvm::Triple Triple) { +return Tr

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,233 @@ +//===--- UseScopedLockCheck.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-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,233 @@ +//===--- UseScopedLockCheck.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-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,81 @@ +.. title:: clang-tidy - modernize-use-scoped-lock + +modernize-use-scoped-lock += + +Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's more +flexible and safer alternative ``std::scoped_lock``. The check will +auto

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,333 @@ +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-scoped-lock %t -- -- -fno-delayed-template-parsing + +namespace std { + +struct mutex { + void lock() {} + void unlock() {} +}; + +template +void lock(Lockable1& lock1, Lockable2& lock2, LockableN

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,234 @@ +//===--- UseScopedLockCheck.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-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,234 @@ +//===--- UseScopedLockCheck.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-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,234 @@ +//===--- UseScopedLockCheck.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-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,234 @@ +//===--- UseScopedLockCheck.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-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-02-12 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,333 @@ +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-scoped-lock %t -- -- -fno-delayed-template-parsing + +namespace std { + +struct mutex { + void lock() {} + void unlock() {} +}; + +template +void lock(Lockable1& lock1, Lockable2& lock2, LockableN

[clang] [llvm] [mlir] [NVPTX] Convert scalar function nvvm.annotations to attributes (PR #125908)

2025-02-12 Thread Alex MacLean via cfe-commits
@@ -227,14 +228,14 @@ class NVVMDialectLLVMIRTranslationInterface } else if (attribute.getName() == AlexMaclean wrote: Yes, I plan to replace all !nvvm.annotations with attributes. This change is already fairly large and I would prefer to avoid a single mon

[clang] [llvm] [RISCV][MC] Implement MC for Base P extension (PR #123271)

2025-02-12 Thread Craig Topper via cfe-commits
@@ -0,0 +1,1064 @@ +//===-- RISCVInstrInfoP.td - RISC-V 'P' instructions ---*- tablegen -*-===// +// +// 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: A

[clang] [llvm] [RISCV][MC] Implement MC for Base P extension (PR #123271)

2025-02-12 Thread Craig Topper via cfe-commits
https://github.com/topperc edited https://github.com/llvm/llvm-project/pull/123271 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV][MC] Implement MC for Base P extension (PR #123271)

2025-02-12 Thread Craig Topper via cfe-commits
@@ -0,0 +1,1440 @@ +// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --tool ./llvm-objdump --version 5 topperc wrote: What does the --tool here do? https://github.com/llvm/llvm-project/pull/123271 _

[clang] [llvm] [RISCV][MC] Implement MC for Base P extension (PR #123271)

2025-02-12 Thread Craig Topper via cfe-commits
https://github.com/topperc commented: Can we break this up into smaller patches? The P spec is rather large. Reviewing 1000 lines of RISCVInstrInfoP.td in a single PR is very time consuming and exhausting as a reviewer. The changes to RISCVFeatures.td and RISCVInstrInfoZb.td and other things t

[clang] [llvm] [RISCV][MC] Implement MC for Base P extension (PR #123271)

2025-02-12 Thread Craig Topper via cfe-commits
@@ -0,0 +1,1440 @@ +// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --tool ./llvm-objdump --version 5 +# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-p -riscv-no-aliases -show-encoding \ topperc wrote: Please add

[clang] [llvm] [RISCV][MC] Implement MC for Base P extension (PR #123271)

2025-02-12 Thread Craig Topper via cfe-commits
@@ -0,0 +1,1064 @@ +//===-- RISCVInstrInfoP.td - RISC-V 'P' instructions ---*- tablegen -*-===// +// +// 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: A

[clang] [llvm] [RISCV][MC] Implement MC for Base P extension (PR #123271)

2025-02-12 Thread Craig Topper via cfe-commits
@@ -0,0 +1,1440 @@ +// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --tool ./llvm-objdump --version 5 +# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-p -riscv-no-aliases -show-encoding \ +# RUN: | FileCheck -check-prefixes=CHEC

[clang] Reapply "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP."… (PR #126671)

2025-02-12 Thread Amit Kumar Pandey via cfe-commits
https://github.com/ampandey-1995 closed https://github.com/llvm/llvm-project/pull/126671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 46f1bab - Reapply "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP."… (#126671)

2025-02-12 Thread via cfe-commits
Author: Amit Kumar Pandey Date: 2025-02-12T13:40:51+05:30 New Revision: 46f1bab7930cb118c61bf5ff221790240ec07512 URL: https://github.com/llvm/llvm-project/commit/46f1bab7930cb118c61bf5ff221790240ec07512 DIFF: https://github.com/llvm/llvm-project/commit/46f1bab7930cb118c61bf5ff221790240ec07512.d

[clang] [clang][AST] Handle dependent representation of call to function with explicit object parameter in CallExpr::getBeginLoc() (PR #126868)

2025-02-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/126868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST] Handle dependent representation of call to function with explicit object parameter in CallExpr::getBeginLoc() (PR #126868)

2025-02-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks for the patch. While this may not be the most optimal solution, we can likely go with it as-is to put the fire out. (I think @cor3ntin is not present right now) https://github.com/llvm/llvm-project/pull/126868 ___

[clang] [clang][AST] Handle dependent representation of call to function with explicit object parameter in CallExpr::getBeginLoc() (PR #126868)

2025-02-12 Thread Younan Zhang via cfe-commits
@@ -1648,8 +1648,11 @@ SourceLocation CallExpr::getBeginLoc() const { if (const auto *Method = dyn_cast_if_present(getCalleeDecl()); Method && Method->isExplicitObjectMemberFunction()) { -assert(getNumArgs() > 0 && getArg(0)); -return getArg(0)->getBeg

[clang] [clang][AST] Handle dependent representation of call to function with explicit object parameter in CallExpr::getBeginLoc() (PR #126868)

2025-02-12 Thread Younan Zhang via cfe-commits
@@ -1648,8 +1648,11 @@ SourceLocation CallExpr::getBeginLoc() const { if (const auto *Method = dyn_cast_if_present(getCalleeDecl()); Method && Method->isExplicitObjectMemberFunction()) { -assert(getNumArgs() > 0 && getArg(0)); -return getArg(0)->getBeg

[clang] [clang][AST] Handle dependent representation of call to function with explicit object parameter in CallExpr::getBeginLoc() (PR #126868)

2025-02-12 Thread Shafik Yaghmour via cfe-commits
@@ -1648,8 +1648,11 @@ SourceLocation CallExpr::getBeginLoc() const { if (const auto *Method = dyn_cast_if_present(getCalleeDecl()); Method && Method->isExplicitObjectMemberFunction()) { -assert(getNumArgs() > 0 && getArg(0)); -return getArg(0)->getBeg

[clang] Reapply "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP."… (PR #126671)

2025-02-12 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-amdgpu-runtime` running on `omp-vega20-0` while building `clang` at step 7 "Add check check-offload". Full details are available at: https://lab.llvm.org/buildbot/#/builders/30/builds/15636 Here is the releva

[clang] [clang][AST] Handle dependent representation of call to function with explicit object parameter in CallExpr::getBeginLoc() (PR #126868)

2025-02-12 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can we please add more details in the summary about e.g. "This fixes a crash when ... and the fix is ..." https://github.com/llvm/llvm-project/pull/126868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [llvm] [RISCV][MC] Implement MC for Base P extension (PR #123271)

2025-02-12 Thread Kito Cheng via cfe-commits
@@ -335,6 +335,9 @@ The primary goal of experimental support is to assist in the process of ratifica ``experimental-svukte`` LLVM implements the `0.3 draft specification `__. +``experimental-p``, ``experimental-p`` -

[clang] [NFC] Avoid potential null dereference. (PR #126872)

2025-02-12 Thread via cfe-commits
https://github.com/schittir created https://github.com/llvm/llvm-project/pull/126872 Add a null check. >From 5a25d2a34813d7b37a0a26cd883c6a7ccd4574a8 Mon Sep 17 00:00:00 2001 From: Sindhu Chittireddy Date: Wed, 12 Feb 2025 00:05:33 -0800 Subject: [PATCH] [NFC] Avoid potential null dereference.

[clang] [NFC] Avoid potential null dereference. (PR #126872)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: None (schittir) Changes Add a null check. --- Full diff: https://github.com/llvm/llvm-project/pull/126872.diff 1 Files Affected: - (modified) clang/lib/Format/UnwrappedLineFormatter.cpp (+1-1) ``diff diff --git a/clang

[clang] Enable -Wunique-object-duplication inside templated code (PR #125902)

2025-02-12 Thread Hans Wennborg via cfe-commits
https://github.com/zmodem approved this pull request. lgtm I'll wait a day or so before merging in case other reviewers want to chime in. https://github.com/llvm/llvm-project/pull/125902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang] [C++20][Modules][Serialization] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (PR #121245)

2025-02-12 Thread Michael Park via cfe-commits
mpark wrote: Hi @zixu-w, thanks for the ping. I can't take a look this week, but can on Monday. It would be great if I can look at a small repro though. I'll follow on the issue. https://github.com/llvm/llvm-project/pull/121245 ___ cfe-commits mailin

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-12 Thread Pranav Kant via cfe-commits
@@ -2964,20 +2963,36 @@ static bool isValidCodeModelAttr(Sema &S, StringRef Str) { static void handleCodeModelAttr(Sema &S, Decl *D, const ParsedAttr &AL) { StringRef Str; SourceLocation LiteralLoc; + auto IsTripleSupported = [](const llvm::Triple Triple) { +return Tr

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-12 Thread Arthur Eubanks via cfe-commits
https://github.com/aeubanks updated https://github.com/llvm/llvm-project/pull/124834 >From 7c40169ec7430ec64aaeb053e423eca1ceff7f0d Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Tue, 28 Jan 2025 20:36:58 + Subject: [PATCH 01/11] [clang][X86] Support __attribute__((model("small"/"larg

[clang] [analyzer] StackAddrEscapeChecker: also check return for child stack frames (PR #126986)

2025-02-12 Thread Michael Flanders via cfe-commits
https://github.com/Flandini created https://github.com/llvm/llvm-project/pull/126986 Fixes #123459. This changes checking of the returned expr to also look for memory regions whose stack frame context was a child of the current stack frame context, e.g., for cases like this given in #123459:

[clang] [analyzer] StackAddrEscapeChecker: also check return for child stack frames (PR #126986)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Michael Flanders (Flandini) Changes Fixes #123459. This changes checking of the returned expr to also look for memory regions whose stack frame context was a child of the current stack frame context, e.g., for cases lik

[clang] [llvm] [ThinLTO] Support dead RTTI data elimination under -fno-split-lto-unit (PR #126336)

2025-02-12 Thread Mingming Liu via cfe-commits
@@ -0,0 +1,20 @@ +; RUN: llvm-as %s -o - | llvm-dis -o %t.ll +; RUN: grep "^\^" %s >%t2 +; RUN: grep "^\^" %t.ll >%t3 +; Expect that the summary information is the same after round-trip through +; llvm-as and llvm-dis. +; RUN: diff -b %t2 %t3 + +target triple = "aarch64-unknown-li

[clang] [C++20][Modules][Serialization] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (PR #121245)

2025-02-12 Thread Zixu Wang via cfe-commits
zixu-w wrote: > Hi @zixu-w, thanks for the ping. I can't take a look this week, but can on > Monday. It would be great if I can look at a small repro though. I'll follow > on the issue. Thanks! Yes, I'll try to construct a smaller and isolated reproducer. Is it okay if we revert this change f

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-12 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,194 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +namespace clang { +namespace hlsl { + +// Lexer Definitions + +static bool IsNumberChar(char C) { + // TODO(#126565): extend for float support exponents + return isdigit(C); // integer support +} + +bool RootS

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-12 Thread via cfe-commits
@@ -0,0 +1,44 @@ +/// Check DTLTO options are forwarded to the linker. + +// REQUIRES: lld + +// RUN: echo "-target x86_64-linux-gnu \ +// RUN: -Xdist distarg1 \ +// RUN: -Xdist distarg2 \ +// RUN: -fuse-ld=lld" > %t.rsp + + +/// Check that options are forwarded as expected

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-12 Thread via cfe-commits
@@ -0,0 +1,69 @@ +# REQUIRES: x86 + +## Check that DTLTO handles imports files correctly. + +# RUN: rm -rf %t.dir && split-file %s %t.dir && cd %t.dir bd1976bris wrote: Done. Thanks. https://github.com/llvm/llvm-project/pull/126654 __

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-12 Thread via cfe-commits
@@ -0,0 +1,2 @@ + -*- rst -*- bd1976bris wrote: Yes, a `.md` makes sense. I have also added another sentence explaining why the tests are in this area. https://github.com/llvm/llvm-project/pull/1

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-12 Thread via cfe-commits
@@ -0,0 +1,69 @@ +# REQUIRES: x86 + +## Check that DTLTO handles imports files correctly. + +# RUN: rm -rf %t.dir && split-file %s %t.dir && cd %t.dir + +## Compile bitcode. +# RUN: opt -module-summary 0.ll -o 0.o -O2 +# RUN: opt -module-summary 1.ll -o 1.o -O2 + +## Common comman

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-12 Thread via cfe-commits
@@ -0,0 +1,72 @@ +## Simple test that a DTLTO link succeeds and outputs the expected set of files +## correctly when thin archives are present. + +# RUN: rm -rf %t.dir && split-file %s %t.dir && cd %t.dir +# RUN: %clang -target x86_64-linux-gnu -c foo.c -o foo.o b

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-12 Thread via cfe-commits
@@ -0,0 +1,49 @@ +/// Simple test that DTLTO works with a single input file and generates the +/// expected set of files with --save-temps applied to the linker. +/// +/// Note that we also supply --save-temps to the compiler for predictable +/// bitcode file names. + +// RUN: rm

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-12 Thread via cfe-commits
@@ -0,0 +1,44 @@ +/// Check DTLTO options are forwarded to the linker. + +// REQUIRES: lld + +// RUN: echo "-target x86_64-linux-gnu \ bd1976bris wrote: Done. Thanks. Apologies, I now recall you writing about this previously. https://github.com/llvm/llvm-project

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-12 Thread via cfe-commits
@@ -0,0 +1,49 @@ +/// Simple test that DTLTO works with a single input file and generates the +/// expected set of files with --save-temps applied to the linker. +/// +/// Note that we also supply --save-temps to the compiler for predictable +/// bitcode file names. + +// RUN: rm

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-12 Thread via cfe-commits
@@ -0,0 +1,49 @@ +/// Simple test that DTLTO works with a single input file and generates the +/// expected set of files with --save-temps applied to the linker. +/// +/// Note that we also supply --save-temps to the compiler for predictable +/// bitcode file names. + +// RUN: rm

[clang] [WebKit Checkers] Treat offsetof as a trivial expression. (PR #126996)

2025-02-12 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/126996 None >From f7eafbfd258fb0acf60a01d033958f859c426ff3 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Wed, 12 Feb 2025 17:52:45 -0800 Subject: [PATCH] [WebKit Checkers] Treat offsetof as a trivial expression. --

[clang] [WebKit Checkers] Treat offsetof as a trivial expression. (PR #126996)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Ryosuke Niwa (rniwa) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/126996.diff 2 Files Affected: - (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp (+5) - (modified) clang

[clang] [WebKit Checkers] Treat offsetof as a trivial expression. (PR #126996)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ryosuke Niwa (rniwa) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/126996.diff 2 Files Affected: - (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp (+5) - (modified) clang/test/Analysis/Che

[clang] [HLSL] Implement HLSL intialization list support (PR #123141)

2025-02-12 Thread Tex Riddell via cfe-commits
https://github.com/tex3d commented: This is interesting. I wonder though what it looks like in the AST when initializing something with the result of a function call that return an aggregate that must be split up across different boundaries? Or what about expressions with side-effects? How

[clang] [WebKit Checkers] Treat offsetof as a trivial expression. (PR #126996)

2025-02-12 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 8ed36373a2227c7d39fb1a520ec8dde476dc5603 f7eafbfd258fb0acf60a01d033958f859c426ff3 --e

[clang] [WebKit Checkers] Treat offsetof as a trivial expression. (PR #126996)

2025-02-12 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/126996 >From f7eafbfd258fb0acf60a01d033958f859c426ff3 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Wed, 12 Feb 2025 17:52:45 -0800 Subject: [PATCH 1/2] [WebKit Checkers] Treat offsetof as a trivial expression. ---

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-12 Thread via cfe-commits
@@ -186,6 +187,16 @@ BitcodeCompiler::BitcodeCompiler(Ctx &ctx) : ctx(ctx) { std::string(ctx.arg.thinLTOPrefixReplaceNew), std::string(ctx.arg.thinLTOPrefixReplaceNativeObject), ctx.arg.thinLTOEmitImportsFiles, indexFile.get(), onIndexWrite); + } else i

[clang] [WebKit Checkers] Treat offsetof as a trivial expression. (PR #126996)

2025-02-12 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/126996 >From f7eafbfd258fb0acf60a01d033958f859c426ff3 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Wed, 12 Feb 2025 17:52:45 -0800 Subject: [PATCH 1/3] [WebKit Checkers] Treat offsetof as a trivial expression. ---

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-12 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/122981 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [llvm] add support for mustache templating language (PR #105893)

2025-02-12 Thread Paul Kirth via cfe-commits
ilovepi wrote: Any progress to report? https://github.com/llvm/llvm-project/pull/105893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-12 Thread Arthur Eubanks via cfe-commits
@@ -2950,12 +2950,11 @@ static void handleSectionAttr(Sema &S, Decl *D, const ParsedAttr &AL) { } } -static bool isValidCodeModelAttr(Sema &S, StringRef Str) { - if (S.Context.getTargetInfo().getTriple().isLoongArch()) { +static bool isValidCodeModelAttr(llvm::Triple Tripl

[clang] [analyzer] StackAddrEscapeChecker: also check return for child stack frames (PR #126986)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Michael Flanders (Flandini) Changes Fixes #123459. This changes checking of the returned expr to also look for memory regions whose stack frame context was a child of the current stack frame context, e.g., for cases like this given in #1

[clang] [clang][X86] Support __attribute__((model("small"/"large"))) (PR #124834)

2025-02-12 Thread Arthur Eubanks via cfe-commits
https://github.com/aeubanks deleted https://github.com/llvm/llvm-project/pull/124834 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [scan-build-py] use explicit compiler wrapper paths for intercept (PR #123252)

2025-02-12 Thread Aymeric Wibo via cfe-commits
obiwac wrote: Ping https://github.com/llvm/llvm-project/pull/123252 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] fix false positive of BlockInCriticalSectionChecker (PR #126752)

2025-02-12 Thread via cfe-commits
flovent wrote: I thought about the case when file descriptor equals to -1, which is modeled by `evalcall` for `open`, means that `open` failed to get a valid file descriptor, if we use this file descriptor in `read` or `recv`, they will not be blocked too. so I think we can avoid report for th

[libunwind] [libunwind][NFC] Remove the CET keyword in shadow stack-related stuffs (PR #126663)

2025-02-12 Thread John Brawn via cfe-commits
john-brawn-arm wrote: These functions aren't exposed in any of the header files in libunwind/include so I don't think renaming them should be a problem. Renaming things to use architecture-neutral terms sounds like a good idea to me. https://github.com/llvm/llvm-project/pull/126663 ___

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM too; thanks for running with this! https://github.com/llvm/llvm-project/pull/126059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang-tools-extra] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-12 Thread via cfe-commits
@@ -106,15 +106,15 @@ Changes in existing checks ` check to allow specifying additional C++ member functions to match. -- Improved :doc:`performance-noexcept-move-constructor - `. Check allows - move-constructors with `noexcept(expr)`, even if `expr` evaluates to `false`

[clang-tools-extra] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-12 Thread via cfe-commits
@@ -22,4 +22,5 @@ The following options are described below: .. option:: AllowFalseEvaluated When defined, the check will not generate any warning -if the `expr` in `noexcept(expr)` evaluates to `false`. +if the ``expr`` in ``noexcept(expr)`` evaluates to ``false``

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
@@ -57,6 +57,10 @@ // - IsBF true for vector of brain float elements. //===--===// +#ifndef SVE_TYPE momchil-velikov wrote: I thought of adding this in one of the previous refactorings, in

[clang] Thread Safety Analysis: Support warning on taking address of guarded variables (PR #123063)

2025-02-12 Thread Marco Elver via cfe-commits
melver wrote: Addressed comments so far. > > The equivalent of passing a `pt_guarded_by` variable by value doesn't seem > > to warn. > > This inconsistency is probably my largest concern. If you have > > ```c > int x GUARDED_BY(mu); > int *p PT_GUARDED_BY(mu); > ``` > > then `&x` should basi

[clang] [llvm] [mlir] [AMDGPU] Generalize amdgcn.make.buffer.rsrc to fat pointers (PR #126828)

2025-02-12 Thread Krzysztof Drewniak via cfe-commits
https://github.com/krzysz00 edited https://github.com/llvm/llvm-project/pull/126828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [AMDGPU] Generalize amdgcn.make.buffer.rsrc to fat pointers (PR #126828)

2025-02-12 Thread Krzysztof Drewniak via cfe-commits
krzysz00 wrote: @arsenm On further investigation, I misdiagnosed the issue and have updated the commit message accordingly. The real problem is the addrspacecast(addrspacecast(x)) => addrspacecast(x)` fold that was getting rid of the fat pointer intermediate, and then infer-address-spaces did

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/9] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2025-02-12 Thread Alexey Bataev via cfe-commits
@@ -,6 +,105 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { emitMaster(*this, S); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { alexey-bataev wrote: Why do you need it? https://github.com/llvm/llvm-pr

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2025-02-12 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,269 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] [mlir] [AMDGPU] Generalize amdgcn.make.buffer.rsrc to fat pointers (PR #126828)

2025-02-12 Thread Krzysztof Drewniak via cfe-commits
https://github.com/krzysz00 updated https://github.com/llvm/llvm-project/pull/126828 >From 457350589fc4c4295a212025873ab4b90124e02f Mon Sep 17 00:00:00 2001 From: Krzysztof Drewniak Date: Tue, 11 Feb 2025 23:55:36 + Subject: [PATCH 1/4] [AMDGPU] Generalize amdgcn.make.buffer.rsrc to fat po

[clang] [llvm] [mlir] [AMDGPU] Generalize amdgcn.make.buffer.rsrc to fat pointers (PR #126828)

2025-02-12 Thread Krzysztof Drewniak via cfe-commits
@@ -1072,6 +1073,14 @@ static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn, {F->getReturnType(), F->getArg(1)->getType()}); return true; } + // Old-style make.buffer.rsrc was only variadic in the input pointer + if (Name.cons

[clang] 562c0c6 - [HLSL][Docs] Update function calls docs (#106860)

2025-02-12 Thread via cfe-commits
Author: Chris B Date: 2025-02-12T13:29:24-06:00 New Revision: 562c0c611a3bee6b7766043bfdeb5c6f47d7d2fd URL: https://github.com/llvm/llvm-project/commit/562c0c611a3bee6b7766043bfdeb5c6f47d7d2fd DIFF: https://github.com/llvm/llvm-project/commit/562c0c611a3bee6b7766043bfdeb5c6f47d7d2fd.diff LOG:

[clang] [HLSL][Docs] Update function calls docs (PR #106860)

2025-02-12 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/106860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-12 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/122981 >From 98deff6a407b912852e70b2bdc3618aaec8a1931 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Fri, 24 Jan 2025 22:23:39 + Subject: [PATCH 01/17] [HLSL][RootSignature] Initial Lexer Definition with puncua

[clang] [-Wunsafe-buffer-usage] add test for constexpr size in snprintf (#119786) (PR #126826)

2025-02-12 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 approved this pull request. LGTM, but I think we can keep the test of `sizeof(b)` and add yours at a new line. Thanks. https://github.com/llvm/llvm-project/pull/126826 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

2025-02-12 Thread Finn Plummer via cfe-commits
@@ -0,0 +1,166 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +namespace clang { +namespace hlsl { + +// Lexer Definitions + +static bool IsNumberChar(char C) { + // TODO(#126565): extend for float support exponents + return isdigit(C); // integer support +} + +bool RootS

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `premerge-monolithic-linux` running on `premerge-linux-1` while building `clang,llvm` at step 7 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/22689 He

[clang] [NFC] Add release notes for -Wunsafe-buffer-usage-in-libc-call (PR #126975)

2025-02-12 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 created https://github.com/llvm/llvm-project/pull/126975 `-Wunsafe-buffer-usage-in-libc-call` is a subgroup of `-Wunsafe-buffer-usage` that warns about unsafe libc function calls. >From 49cfb174e21290918d30928397e6d0d44a521b66 Mon Sep 17 00:00:00 2001 From: Ziqi

[clang] [NFC] Add release notes for -Wunsafe-buffer-usage-in-libc-call (PR #126975)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ziqing Luo (ziqingluo-90) Changes `-Wunsafe-buffer-usage-in-libc-call` is a subgroup of `-Wunsafe-buffer-usage` that warns about unsafe libc function calls. --- Full diff: https://github.com/llvm/llvm-project/pull/126975.diff 1 Files Af

[clang] [llvm] [DirectX] Set Shader Flag DisableOptimizations (PR #126813)

2025-02-12 Thread S. Bharadwaj Yadavalli via cfe-commits
https://github.com/bharadwajy closed https://github.com/llvm/llvm-project/pull/126813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] f2650c5 - [DirectX] Set Shader Flag DisableOptimizations (#126813)

2025-02-12 Thread via cfe-commits
Author: S. Bharadwaj Yadavalli Date: 2025-02-12T16:45:01-05:00 New Revision: f2650c54c9a6caf021415ed57a0a430fbb032094 URL: https://github.com/llvm/llvm-project/commit/f2650c54c9a6caf021415ed57a0a430fbb032094 DIFF: https://github.com/llvm/llvm-project/commit/f2650c54c9a6caf021415ed57a0a430fbb032

[clang] [Clang] [NFC] Remove outdated FIXME (PR #126978)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (MagentaTreehouse) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/126978.diff 1 Files Affected: - (modified) clang/include/clang/AST/Redeclarable.h (-2) ``diff diff --git a/clang/include/clang/AST/Rede

[clang] [Clang] [NFC] Remove outdated FIXME (PR #126978)

2025-02-12 Thread via cfe-commits
https://github.com/MagentaTreehouse created https://github.com/llvm/llvm-project/pull/126978 None >From 80fd13852966649d6a8762fc735a53714474429e Mon Sep 17 00:00:00 2001 From: Mingyi Chen Date: Wed, 12 Feb 2025 16:46:54 -0500 Subject: [PATCH] [Clang] [NFC] Remove outdated FIXME --- clang/inc

[clang-tools-extra] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-12 Thread via cfe-commits
@@ -11,3 +11,15 @@ evaluates to ``false`` (but is not a ``false`` literal itself). Move constructors of all the types used with STL containers, for example, need to be declared ``noexcept``. Otherwise STL will choose copy constructors instead. The same is valid for move assign

[clang-tools-extra] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-12 Thread via cfe-commits
@@ -106,6 +106,11 @@ Changes in existing checks ` check to allow specifying additional C++ member functions to match. +- Improved :doc:`performance-noexcept-move-constructor EugeneZelenko wrote: Please keep alphabetical order (by check name) in this list.

[clang-tools-extra] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-12 Thread via cfe-commits
@@ -106,6 +106,11 @@ Changes in existing checks ` check to allow specifying additional C++ member functions to match. +- Improved :doc:`performance-noexcept-move-constructor + `. Check allows + move-constructors with `noexcept(expr)`, even if `expr` evaluates to `false`,

[clang-tools-extra] [clang-tidy] add AllowedTypes option to misc-const-correctness (PR #122951)

2025-02-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/122951 >From 899a4d3e79b0b9f2c8c156624ebbf94f50696b61 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Tue, 14 Jan 2025 22:05:43 +0300 Subject: [PATCH 1/9] [clang-tidy] add AllowedTypes to misc-const-correctness -

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Tomas Matheson via cfe-commits
https://github.com/tmatheson-arm created https://github.com/llvm/llvm-project/pull/126945 The AAPCS64 adds a number of vector types to the C unconditionally: https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#11appendix-support-for-advanced-simd-extensions The equivalent SVE

[clang] [Clang][CMake][MSVC] Install PDBs alongside executables (PR #126675)

2025-02-12 Thread Miguel A. Arroyo via cfe-commits
mayanez wrote: I have reverted the commit. It looks like I mistakenly put the `install` in the wrong location. https://github.com/llvm/llvm-project/pull/126675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [analyzer][NFC] Trivial cleanup in ArrayBoundChecker (PR #126941)

2025-02-12 Thread Donát Nagy via cfe-commits
@@ -394,14 +394,13 @@ static bool tryDividePair(std::optional &Val1, return false; const bool Val1HasRemainder = Val1 && *Val1 % Divisor; const bool Val2HasRemainder = Val2 && *Val2 % Divisor; - if (!Val1HasRemainder && !Val2HasRemainder) { -if (Val1) - *Val1

[clang] [analyzer][NFC] Trivial cleanup in ArrayBoundChecker (PR #126941)

2025-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Donát Nagy (NagyDonat) Changes Two small stylistic improvements in code that I wrote ~a year ago: 1. fix a typo in a comment; and 2. simplify the code of `tryDividePair` by swapping the true and the false branches. --- F

[clang] [analyzer][NFC] Trivial cleanup in ArrayBoundChecker (PR #126941)

2025-02-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/126941 Two small stylistic improvements in code that I wrote ~a year ago: 1. fix a typo in a comment; and 2. simplify the code of `tryDividePair` by swapping the true and the false branches. From a0b6f3aff5e639d4388

<    1   2   3   4   5   6   >