[clang] [clang][bytecode] Fix assignInteger() with allocated primtypes (PR #145302)

2025-06-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/145302 None >From 33eadba2a8d300be67cab69540537589400f7b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 23 Jun 2025 12:00:20 +0200 Subject: [PATCH] [clang][bytecode] Fix assignInteger() wit

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

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

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

2025-06-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/145260 >From 96f1c3bbbf7c07bf9d11bb907e3a35e196d181aa Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 23 Jun 2025 12:31:39 +0800 Subject: [PATCH] [Clang] Back out the source location workaround for CXXConstruct

[clang] [clang][bytecode] Fix assignInteger() with allocated primtypes (PR #145302)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/145302.diff 2 Files Affected: - (modified) clang/lib/AST/ByteCode/InterpBuiltin.cpp (+17-6) - (modified) clang/test/AST/ByteCode/builtin-functions

[clang] fccc6ee - [C++20] [Modules] Don't make enum constant members always visible

2025-06-23 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-06-23T14:39:08+08:00 New Revision: fccc6ee7021811a27ab1303d19407f703853ab92 URL: https://github.com/llvm/llvm-project/commit/fccc6ee7021811a27ab1303d19407f703853ab92 DIFF: https://github.com/llvm/llvm-project/commit/fccc6ee7021811a27ab1303d19407f703853ab92.diff LO

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread via cfe-commits
https://github.com/anthonyhatran updated https://github.com/llvm/llvm-project/pull/143758 >From 0cf31b41838d449835296d4ec290209bd5aae1e6 Mon Sep 17 00:00:00 2001 From: Anthony Tran Date: Wed, 11 Jun 2025 10:11:09 -0700 Subject: [PATCH 1/2] Added Trap messages in debug info --- clang/lib/CodeG

[clang] [llvm] [Clang][OpenMP] Non-contiguous strided update (PR #144635)

2025-06-23 Thread Amit Tiwari via cfe-commits
@@ -7384,7 +7384,40 @@ class MappableExprsHandler { // dimension. uint64_t DimSize = 1; -bool IsNonContiguous = CombinedInfo.NonContigInfo.IsNonContiguous; +// Detects non-contiguous updates due to strided accesses. +// Sets the 'IsNonContiguous' flag so th

[clang] [Clang][LoongArch] Fixed incorrect _BitInt(N>64) alignment (PR #145297)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (Ami-zhang) Changes This patch makes determining alignment and width of BitInt to be target ABI specific and makes it consistent with [Procedure Call Standard for the LoongArch™ Architecture] for LoongArch target (https://github.com/

[clang] [clang][scandeps] Improve handling of rawstrings. (PR #139504)

2025-06-23 Thread Tobias Hieta via cfe-commits
tru wrote: Sorry for the delay. I have addressed both your comments now @benlangmuir - reworked it to use Lexer::getEscapedNewLineSize() and removed the assertline. I also expanded the test coverage. https://github.com/llvm/llvm-project/pull/139504 _

[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

2025-06-23 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. The fix doesn't look quite right. It's not correct to say that canonicalization changes the declaration name. We don't canonicalize declarations after all. It's just that a canonical template parameter type doesn't refer to a

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-06-23 Thread Cristian Assaiante via cfe-commits
https://github.com/cristianassaiante updated https://github.com/llvm/llvm-project/pull/145059 >From ab6063493744ef5a1ee92fd249bf8d86b7299fad Mon Sep 17 00:00:00 2001 From: Cristian Assaiante Date: Fri, 20 Jun 2025 16:56:23 +0200 Subject: [PATCH 1/3] Adding -opt-disable and a test for it --- c

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

2025-06-23 Thread Sander de Smalen via cfe-commits
@@ -820,16 +820,23 @@ AArch64TargetInfo::getTargetBuiltins() const { std::optional> AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts, - bool IsArmStreamingFunction, + ArmStreamingKind IsArmStreaming

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

2025-06-23 Thread Sander de Smalen via cfe-commits
@@ -82,6 +82,15 @@ class SemaARM : public SemaBase { void handleInterruptSaveFPAttr(Decl *D, const ParsedAttr &AL); void CheckSMEFunctionDefAttributes(const FunctionDecl *FD); + + /// Return true if the given types are an SVE builtin and a VectorType that + /// is a fixe

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

2025-06-23 Thread Sander de Smalen via cfe-commits
@@ -820,16 +820,23 @@ AArch64TargetInfo::getTargetBuiltins() const { std::optional> AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts, - bool IsArmStreamingFunction, + ArmStreamingKind IsArmStreaming

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

2025-06-23 Thread Sander de Smalen via cfe-commits
@@ -1666,30 +1666,43 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args, } // Handle -msve_vector_bits= - if (Arg *A = Args.getLastArg(options::OPT_msve_vector_bits_EQ)) { + auto HandleVectorBits = [&](Arg *A, bool Streaming) { StringRef Val = A->getValue();

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

2025-06-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/145260 >From f642a6d25a2bd3f12e6629f93152edc784bddbaa Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 23 Jun 2025 12:31:39 +0800 Subject: [PATCH] [Clang] Back out the source location workaround for CXXConstruct

[clang] [Clang][OpenCL] Declare cl_amd_media_ops/cl_amd_media_ops2 builtins with -fdeclare-opencl-builtins (PR #143507)

2025-06-23 Thread Juan Manuel Martinez Caamaño via cfe-commits
https://github.com/jmmartinez edited https://github.com/llvm/llvm-project/pull/143507 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-c] introduce queries on GCC-style inline assembly statements (PR #143424)

2025-06-23 Thread via cfe-commits
https://github.com/dingxiangfei2009 updated https://github.com/llvm/llvm-project/pull/143424 >From cbfed6b195083d07330694ae497f59f4007e6a1f Mon Sep 17 00:00:00 2001 From: Xiangfei Ding Date: Mon, 9 Jun 2025 13:57:18 + Subject: [PATCH 1/2] [clang-c] introduce queries on GCC-style inline asse

[clang] [clang][nvlink-wrapper] Add support for opt-remarks command line options (PR #145200)

2025-06-23 Thread Miguel Cárdenas via cfe-commits
https://github.com/miguelcsx updated https://github.com/llvm/llvm-project/pull/145200 From 883345d337df982a87c55b11b3374cf661b7b49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20C=C3=A1rdenas?= Date: Sun, 22 Jun 2025 03:32:24 +0200 Subject: [PATCH 1/3] [clang][nvlink-wrapper] Add support fo

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread Vasiliy Kulikov via cfe-commits
https://github.com/segoon created https://github.com/llvm/llvm-project/pull/145307 None >From 546567ee93c1c0c0de5e34a1ec4d7c2ccfd081c8 Mon Sep 17 00:00:00 2001 From: Vasily Kulikov Date: Mon, 12 May 2025 20:36:43 +0300 Subject: [PATCH 1/2] clang-tidy: add bugprone-taxi-async-use-after-free --

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Vasiliy Kulikov (segoon) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/145307.diff 8 Files Affected: - (modified) clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp (+3) - (modified) clang-tool

[clang] [HLSL][SPIRV] Allow large z value in numthreads (PR #144934)

2025-06-23 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts approved this pull request. https://github.com/llvm/llvm-project/pull/144934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Allow large z value in numthreads (PR #144934)

2025-06-23 Thread Nathan Gauër via cfe-commits
@@ -1033,12 +1033,15 @@ void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) { void SemaHLSL::handleNumThreadsAttr(Decl *D, const ParsedAttr &AL) { llvm::VersionTuple SMVersion = getASTContext().getTargetInfo().getTriple().getOSVersion(); + bool IsDXI

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

2025-06-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 ready_for_review https://github.com/llvm/llvm-project/pull/145260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-06-23 Thread Cristian Assaiante via cfe-commits
https://github.com/cristianassaiante updated https://github.com/llvm/llvm-project/pull/145059 >From ab6063493744ef5a1ee92fd249bf8d86b7299fad Mon Sep 17 00:00:00 2001 From: Cristian Assaiante Date: Fri, 20 Jun 2025 16:56:23 +0200 Subject: [PATCH 1/2] Adding -opt-disable and a test for it --- c

[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-23 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/144710 >From 2c278271277823b3544d991365e58f97dd4b7031 Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 18 Jun 2025 10:17:05 +0100 Subject: [PATCH 1/2] [flang][AArch64] Always compiler-rt to flang linking after

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

2025-06-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/145260 >From 504c05c3a076ecafb4f11ce0703caddfac6e06d1 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 23 Jun 2025 12:31:39 +0800 Subject: [PATCH] [Clang] Back out the source location workaround for CXXConstruct

[clang] [clang][scandeps] Improve handling of rawstrings. (PR #139504)

2025-06-23 Thread Tobias Hieta via cfe-commits
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/139504 >From 859723743a51bc75d855b4ee924ea5cf86e26183 Mon Sep 17 00:00:00 2001 From: Tobias Hieta Date: Mon, 5 May 2025 11:40:17 +0200 Subject: [PATCH 1/4] [clang][scandeps] Improve handling of rawstrings. The current pars

[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

2025-06-23 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > It's just that a canonical template parameter type doesn't refer to a > particular template parameter declaration. The particular statement is that Clang canonicalizes `decltype(func())` to `decltype(func())`. If we don't change that, we end up with spurious false posi

[clang] [clang][scandeps] Improve handling of rawstrings. (PR #139504)

2025-06-23 Thread Tobias Hieta via cfe-commits
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/139504 >From 859723743a51bc75d855b4ee924ea5cf86e26183 Mon Sep 17 00:00:00 2001 From: Tobias Hieta Date: Mon, 5 May 2025 11:40:17 +0200 Subject: [PATCH 1/3] [clang][scandeps] Improve handling of rawstrings. The current pars

[clang] [clang][scandeps] Improve handling of rawstrings. (PR #139504)

2025-06-23 Thread Tobias Hieta via cfe-commits
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/139504 >From 859723743a51bc75d855b4ee924ea5cf86e26183 Mon Sep 17 00:00:00 2001 From: Tobias Hieta Date: Mon, 5 May 2025 11:40:17 +0200 Subject: [PATCH 1/5] [clang][scandeps] Improve handling of rawstrings. The current pars

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

2025-06-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 converted_to_draft https://github.com/llvm/llvm-project/pull/145260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][LoongArch] Fixed incorrect _BitInt(N>64) alignment (PR #145297)

2025-06-23 Thread via cfe-commits
https://github.com/Ami-zhang created https://github.com/llvm/llvm-project/pull/145297 This patch makes determining alignment and width of BitInt to be target ABI specific and makes it consistent with [Procedure Call Standard for the LoongArch™ Architecture] for LoongArch target (https://github

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

2025-06-23 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I feel like this is a solution that can grow out of hand very easily. IMO the better solution would be to have `-Wmissing-noreturn` place a `[[noreturn]]` into the AST to avoid incorrect follow-up diagnostics. https://github.com/llvm/llvm-project/pull/145166 _

[clang-tools-extra] [clang-tidy] Add misc-bool-bitwise-operation check (PR #142324)

2025-06-23 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,198 @@ +//===--- BoolBitwiseOperationCheck.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 misc-bool-bitwise-operation check (PR #142324)

2025-06-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor deleted https://github.com/llvm/llvm-project/pull/142324 ___ 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 misc-bool-bitwise-operation check (PR #142324)

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

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

2025-06-23 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. Please wait for @owenca . https://github.com/llvm/llvm-project/pull/145243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

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

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

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-23 Thread Chuanqi Xu via cfe-commits
@@ -2434,6 +2434,31 @@ VarDecl *VarDecl::getInitializingDeclaration() { return Def; } +bool VarDecl::hasInitWithSideEffects() const { + if (!hasInit()) +return false; + + // Check if we can get the initializer without deserializing + const Expr *E = nullptr; + if (au

[clang-tools-extra] [clang-tidy] Add misc-bool-bitwise-operation check (PR #142324)

2025-06-23 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,198 @@ +//===--- BoolBitwiseOperationCheck.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 misc-bool-bitwise-operation check (PR #142324)

2025-06-23 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,198 @@ +//===--- BoolBitwiseOperationCheck.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 misc-bool-bitwise-operation check (PR #142324)

2025-06-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/142324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WPD]: Apply speculative WPD in non-lto mode. (PR #145031)

2025-06-23 Thread Hassnaa Hamdi via cfe-commits
hassnaaHamdi wrote: Some of the open issues related to devirtualization, the WPD pass doesn't get any GVs out of them, as a result it doesn't work. For such issues, I think WPD can't help them by any chance. Maybe it's a Clang problem. https://github.com/llvm/llvm-project/pull/145031 _

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

2025-06-23 Thread Marco Elver via cfe-commits
melver wrote: Gentle ping. https://github.com/llvm/llvm-project/pull/141599 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Very basic capability alias-analysis (PR #142955)

2025-06-23 Thread Marco Elver via cfe-commits
melver wrote: Gentle ping. https://github.com/llvm/llvm-project/pull/142955 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix shifts with an allocated RHS (PR #145280)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes This was broken before because we ended up using a constructor that was disabled via assert(false). Use ShiftAP() if either LHS or RHS is allocated. --- Full diff: https://github.com/llvm/llvm-project/pull/1

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread Vasiliy Kulikov via cfe-commits
https://github.com/segoon updated https://github.com/llvm/llvm-project/pull/145307 >From 546567ee93c1c0c0de5e34a1ec4d7c2ccfd081c8 Mon Sep 17 00:00:00 2001 From: Vasily Kulikov Date: Mon, 12 May 2025 20:36:43 +0300 Subject: [PATCH 1/3] clang-tidy: add bugprone-taxi-async-use-after-free --- ...

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

2025-06-23 Thread Vikram Hegde via cfe-commits
https://github.com/vikramRH created https://github.com/llvm/llvm-project/pull/145272 This attempts to fix https://github.com/llvm/llvm-project/issues/26078. However I have couple of fundamental questions with the 7.1.5 consexpr note "[ Note: An explicit specialization can differ from the templa

[clang] Docs: ambiguous use of "explicitly" in [[clang::no_specializaiton]] (PR #143839)

2025-06-23 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: If we choose to be consistent with the standard wording, we might need to say "[...] templates for which neither explicit specialization nor partial specialization should be declared [...]", which is quite verbose. The crux seems to be that it's not clear in the standard

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread Baranov Victor via cfe-commits
vbvictor wrote: Is this unfinished work? I'd suggest to covert this to draft. https://github.com/llvm/llvm-project/pull/145307 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Implement P1857R3 Modules Dependency Discovery (PR #107168)

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

[clang] [llvm] [RISCV] Add Andes AX45MPV processor definition (PR #145267)

2025-06-23 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp edited https://github.com/llvm/llvm-project/pull/145267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Add s_setprio_inc_wg gfx1250 instruction (PR #145152)

2025-06-23 Thread Stanislav Mekhanoshin via cfe-commits
https://github.com/rampitec closed https://github.com/llvm/llvm-project/pull/145152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 1c78d8d - [clang][bytecode] Fix shifts with an allocated RHS (#145280)

2025-06-23 Thread via cfe-commits
Author: Timm Baeder Date: 2025-06-23T10:14:33+02:00 New Revision: 1c78d8d9d7bcb4b20910047ad7db35f177a17c8c URL: https://github.com/llvm/llvm-project/commit/1c78d8d9d7bcb4b20910047ad7db35f177a17c8c DIFF: https://github.com/llvm/llvm-project/commit/1c78d8d9d7bcb4b20910047ad7db35f177a17c8c.diff L

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

2025-06-23 Thread Ziqing Luo via cfe-commits
@@ -130,6 +140,14 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) { this); } + if (WarnOnSizeOfInLoopTermination) { +Finder->addMatcher(LoopExpr(hasDescendant(binaryOperator( ziqingluo-90 wrote: Since `hasDe

[clang] [-Wunsafe-buffer-usage] Support span creation from std::initializer_list and begin/end pairs (PR #145311)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ziqing Luo (ziqingluo-90) Changes Support safe construction of `std::span` from `begin` and `end` calls on hardened containers or views or `std::initializer_list`s. For example, the following code is safe: ``` void create(std::initializer

[clang] [-Wunsafe-buffer-usage] Support span creation from std::initializer_list and begin/end pairs (PR #145311)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis Author: Ziqing Luo (ziqingluo-90) Changes Support safe construction of `std::span` from `begin` and `end` calls on hardened containers or views or `std::initializer_list`s. For example, the following code is safe: ``` void create(std::in

[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

2025-06-23 Thread Ilya Biryukov via cfe-commits
@@ -828,7 +828,23 @@ void ODRHash::AddDecl(const Decl *D) { return; } - AddDeclarationName(ND->getDeclName()); + // For template parameters, use depth+index instead of name, because type + // canonicalization can change the name of the template parameter. + if (auto

[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

2025-06-23 Thread Ilya Biryukov via cfe-commits
@@ -5164,6 +5164,29 @@ namespace A { A::X x; #endif +namespace TemplateDecltypeOperator { + +#if defined(FIRST) || defined(SECOND) +template +T6 func(); +#endif + +#if defined(SECOND) +template +using UnrelatedAlias = decltype(func())(); +#endif + +#if defined(FIRST) || defi

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Orlando Cazalet-Hyams via cfe-commits
@@ -922,8 +922,8 @@ template <> struct MDNodeKeyImpl { MDString *LinkageName; Metadata *File; unsigned Line; - Metadata *Type; unsigned ScopeLine; + Metadata *Type; OCHyams wrote: Yep, 136 -> 128 bytes (144 -> 136 with the new bool). I don't think i

[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

2025-06-23 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov requested changes to this pull request. Thanks, I believe we've seen some related breakages in the past and had to workaround the module structure because of this. It would definitely save some cycles for us in the future! My only request is to keep this change

[clang-tools-extra] [clangd] Implement simple folding for preprocessor branches (PR #140959)

2025-06-23 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/140959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Implement simple folding for preprocessor branches (PR #140959)

2025-06-23 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 requested changes to this pull request. Thanks for adding some unit tests, and sorry I didn't get a chance to look at this sooner. Unfortunately, it looks like the patch needs a bit more work, as I'm seeing it crash on incomplete code, for example: ```c++ #if

[clang-tools-extra] [clangd] Implement simple folding for preprocessor branches (PR #140959)

2025-06-23 Thread Nathan Ridge via cfe-commits
@@ -220,6 +220,24 @@ getFoldingRanges(const std::string &Code, bool LineFoldingOnly) { auto EndPosition = [&](const Token &T) { return offsetToPosition(Code, EndOffset(T)); }; + + // Preprocessor directives + auto PPRanges = pairDirectiveRanges(DirectiveStructure, Or

[clang-tools-extra] [clangd] Implement simple folding for preprocessor branches (PR #140959)

2025-06-23 Thread Nathan Ridge via cfe-commits
@@ -220,6 +220,24 @@ getFoldingRanges(const std::string &Code, bool LineFoldingOnly) { auto EndPosition = [&](const Token &T) { return offsetToPosition(Code, EndOffset(T)); }; + + // Preprocessor directives HighCommander4 wrote: A couple of minor poi

[clang] [NFC][Clang][AST] Drop `llvm::` in front of `ArrayRef`/`MutableArrayRef` (PR #145207)

2025-06-23 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. https://github.com/llvm/llvm-project/pull/145207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix assignInteger() with allocated primtypes (PR #145302)

2025-06-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/145302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 23ba0fd - [clang][bytecode] Fix assignInteger() with allocated primtypes (#145302)

2025-06-23 Thread via cfe-commits
Author: Timm Baeder Date: 2025-06-23T14:43:11+02:00 New Revision: 23ba0fdbfc2a240ca5ddcc7f71c7383437c00aaa URL: https://github.com/llvm/llvm-project/commit/23ba0fdbfc2a240ca5ddcc7f71c7383437c00aaa DIFF: https://github.com/llvm/llvm-project/commit/23ba0fdbfc2a240ca5ddcc7f71c7383437c00aaa.diff L

[clang] [NFC][Clang][AST] Use `llvm::copy` instead of `memcpy` in StringLiteral (PR #145187)

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

[clang] [NFC][Clang][AST] Use `llvm::copy` instead of `memcpy` in StringLiteral (PR #145187)

2025-06-23 Thread via cfe-commits
@@ -1853,18 +1852,11 @@ class StringLiteral final public: /// This is the "fully general" constructor that allows representation of - /// strings formed from multiple concatenated tokens. + /// strings formed from multiple concatenated tokens. This same constructor + ///

[clang] [NFC][Clang][AST] Use `llvm::copy` instead of `memcpy` in StringLiteral (PR #145187)

2025-06-23 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. Nice cleanup, thanks! https://github.com/llvm/llvm-project/pull/145187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang][AST] Use `llvm::copy` instead of `memcpy` in StringLiteral (PR #145187)

2025-06-23 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul updated https://github.com/llvm/llvm-project/pull/145187 >From 0579404d5df9dd7cf8380ed8b90355e3ef8391f0 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Sat, 21 Jun 2025 13:32:25 -0700 Subject: [PATCH 1/2] [NFC][Clang][AST] Use `llvm::copy` instead of `memcpy` in Str

[clang] [NFC][Clang][AST] Adopt `llvm::copy` in Clang AST (PR #145192)

2025-06-23 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. https://github.com/llvm/llvm-project/pull/145192 ___ 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 misc-bool-bitwise-operation check (PR #142324)

2025-06-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/142324 ___ 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-scoped-lock (PR #126434)

2025-06-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/126434 >From 516a831127d98d4b1a38a09d7d13f4f04a3a80ae Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 3 Mar 2025 09:25:03 +0300 Subject: [PATCH 01/13] [clang-tidy] add scoped-lock-check --- .../clang-tidy/m

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Orlando Cazalet-Hyams via cfe-commits
OCHyams wrote: > LGTM, I think this raises a few questions about whether we're going to > support non-key-instructions code forever more. AFAIUI the premise is that > the debugging behaviour is worse if you've got groupless instructions in a > key-instructions program? Worse is an understatem

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

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

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Jeremy Morse via cfe-commits
@@ -922,8 +922,8 @@ template <> struct MDNodeKeyImpl { MDString *LinkageName; Metadata *File; unsigned Line; - Metadata *Type; unsigned ScopeLine; + Metadata *Type; jmorse wrote: This is space packing rather than being related to a functional change

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM, I think this raises a few questions about whether we're going to support non-key-instructions code forever more. AFAIUI the premise is that the debugging behaviour is worse if you've got groupless instructions in a key-instructions pr

[clang] [HLSL] Don't use CreateRuntimeFunction for intrinsics (PR #145334)

2025-06-23 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts approved this pull request. https://github.com/llvm/llvm-project/pull/145334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread via cfe-commits
@@ -0,0 +1,6 @@ +.. title:: clang-tidy - bugprone-taxi-async-use-after-free + +bugprone-taxi-async-use-after-free +== + +FIXME: Describe what patterns does the check detect and why. Give examples. EugeneZelenko wrote: Missing docum

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread Dan Liew via cfe-commits
@@ -85,6 +85,92 @@ enum VariableTypeDescriptorKind : uint16_t { //Miscellaneous Helper Methods //======// +static llvm::StringRef GetTrapMessageForHandler(SanitizerHandler ID) { + swit

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread via cfe-commits
@@ -0,0 +1,58 @@ +//===--- TaxiAsyncUseAfterFreeCheck.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: Apa

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread via cfe-commits
@@ -0,0 +1,58 @@ +//===--- TaxiAsyncUseAfterFreeCheck.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: Apa

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread via cfe-commits
@@ -0,0 +1,58 @@ +//===--- TaxiAsyncUseAfterFreeCheck.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: Apa

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread Dan Liew via cfe-commits
@@ -85,6 +85,92 @@ enum VariableTypeDescriptorKind : uint16_t { //Miscellaneous Helper Methods //======// +static llvm::StringRef GetTrapMessageForHandler(SanitizerHandler ID) { + swit

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread Dan Liew via cfe-commits
@@ -4059,8 +4154,16 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked, auto Call = TrapBB->begin(); assert(isa(Call) && "Expected call in trap BB"); -Call->applyMergedLocation(Call->getDebugLoc(), - Builder.getCurrentDebugLoca

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread Dan Liew via cfe-commits
@@ -85,6 +85,92 @@ enum VariableTypeDescriptorKind : uint16_t { //Miscellaneous Helper Methods //======// +static llvm::StringRef GetTrapMessageForHandler(SanitizerHandler ID) { ---

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread Dan Liew via cfe-commits
@@ -85,6 +85,92 @@ enum VariableTypeDescriptorKind : uint16_t { //Miscellaneous Helper Methods //======// +static llvm::StringRef GetTrapMessageForHandler(SanitizerHandler ID) { + swit

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread Dan Liew via cfe-commits
@@ -4059,8 +4154,16 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked, auto Call = TrapBB->begin(); assert(isa(Call) && "Expected call in trap BB"); -Call->applyMergedLocation(Call->getDebugLoc(), - Builder.getCurrentDebugLoca

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread Dan Liew via cfe-commits
@@ -4051,6 +4137,15 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked, llvm::BasicBlock *&TrapBB = TrapBBs[CheckHandlerID]; + llvm::DILocation *TrapLocation = Builder.getCurrentDebugLocation(); + llvm::StringRef Category = "UBSan Trap Reason"; d

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread Dan Liew via cfe-commits
@@ -4051,6 +4144,14 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked, llvm::BasicBlock *&TrapBB = TrapBBs[CheckHandlerID]; + llvm::DILocation *TrapLocation = Builder.getCurrentDebugLocation(); + llvm::StringRef Category = GetTrapMessageForHandler(CheckHandlerID

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread Dan Liew via cfe-commits
https://github.com/delcypher edited https://github.com/llvm/llvm-project/pull/143758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread Dan Liew via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang -O0 -g -debug-info-kind=standalone -dwarf-version=5 -fsanitize=undefined \ +// RUN: -fsanitize-trap=undefined -emit-llvm -S -c %s -o - | FileCheck %s + +int add_overflow(int a, int b) { + return a + b; +} + +// CHECK: call void @llvm.ubsantrap(i8

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread Dan Liew via cfe-commits
https://github.com/delcypher requested changes to this pull request. Thanks for working on this. We're off to a good start. Once we have your test cases in a good shape we should look at the failing tests to figure out why they broke so we can fix them or adjust your implementation. https://gi

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread via cfe-commits
@@ -124,6 +124,11 @@ New checks pointer and store it as class members without handle the copy and move constructors and the assignments. +- New :doc:`bugprone-taxi-async-use-after-free + ` check. + + Use-after-free for engine::Async. EugeneZelenko wrote:

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Jeremy Morse via cfe-commits
@@ -1904,7 +1904,8 @@ CGDebugInfo::createInlinedSubprogram(StringRef FuncName, /*ScopeLine=*/0, /*Flags=*/llvm::DINode::FlagArtificial, /*SPFlags=*/llvm::DISubprogram::SPFlagDefinition, -/*TParams=*/nullptr, /*ThrownTypes=*/nullptr, /*Annotations

[clang-tools-extra] [clang-tidy] add 'IgnoreMarcos' option to 'special-member-functions' check (PR #143550)

2025-06-23 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, don't have strong opinions on the default. https://github.com/llvm/llvm-project/pull/143550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

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

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

  1   2   3   4   >