[clang] [clangd] [AST] Handle uninitialized type constraints (PR #110496)

2024-09-30 Thread Florian Albrechtskirchinger via cfe-commits
@@ -27,3 +25,12 @@ int main() { } #endif + +namespace GH99036 { + +template +concept C; // expected-error {{expected '='}} +// expected-note@32 {{declared here}} falbrechtskirchinger wrote: Should have used `@-1` here. https://github.com/llvm/llvm-project/p

[clang] 23c0850 - [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (#106914)

2024-09-30 Thread via cfe-commits
Author: Brandon Wu Date: 2024-09-30T23:52:35-07:00 New Revision: 23c0850d2e860c5773da6e4ee4ecf9802ba62202 URL: https://github.com/llvm/llvm-project/commit/23c0850d2e860c5773da6e4ee4ecf9802ba62202 DIFF: https://github.com/llvm/llvm-project/commit/23c0850d2e860c5773da6e4ee4ecf9802ba62202.diff LO

[clang] [llvm] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (PR #106914)

2024-09-30 Thread Brandon Wu via cfe-commits
https://github.com/4vtomat closed https://github.com/llvm/llvm-project/pull/106914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (PR #106914)

2024-09-30 Thread Brandon Wu via cfe-commits
https://github.com/4vtomat updated https://github.com/llvm/llvm-project/pull/106914 >From aff3876f0d983413d5538929e11885111079e566 Mon Sep 17 00:00:00 2001 From: Brandon Wu Date: Sun, 1 Sep 2024 09:35:34 -0700 Subject: [PATCH] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set R

[clang] [llvm] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (PR #106914)

2024-09-30 Thread Brandon Wu via cfe-commits
https://github.com/4vtomat updated https://github.com/llvm/llvm-project/pull/106914 >From be771da74a7663d56cdf850c10b4daa47c087bcc Mon Sep 17 00:00:00 2001 From: Brandon Wu Date: Sun, 1 Sep 2024 09:35:34 -0700 Subject: [PATCH 1/2] [RISCV][VCIX] Precommit test --- llvm/test/CodeGen/RISCV/inlin

[clang] [clang-tools-extra] [clangd] [AST] Handle uninitialized type constraints (PR #110496)

2024-09-30 Thread Florian Albrechtskirchinger via cfe-commits
falbrechtskirchinger wrote: > We need to resort to `-fallow-pch-with-compiler-errors` :) Ah, thanks! I would not have figured that out on my own. :) > Specifically, add the following file to `clang/test/PCH` (or somehow merge it > into a pre-existing test, which I'd prefer) I looked through t

[clang] [clangd] [AST] Handle uninitialized type constraints (PR #110496)

2024-09-30 Thread Florian Albrechtskirchinger via cfe-commits
https://github.com/falbrechtskirchinger updated https://github.com/llvm/llvm-project/pull/110496 >From c090601a032c6ba406928821ec4296d190edade5 Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Mon, 30 Sep 2024 12:58:15 +0200 Subject: [PATCH] [clangd][AST] Handle uninitialized ty

[clang] [clang] WIP: Warn on mismatched RequiresCapability attributes (PR #67520)

2024-09-30 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -5794,6 +5794,30 @@ static void handleRequiresCapabilityAttr(Sema &S, Decl *D, RequiresCapabilityAttr(S.Context, AL, Args.data(), Args.size()); D->addAttr(RCA); + + if (const auto *FD = dy

[clang] [clang] WIP: Warn on mismatched RequiresCapability attributes (PR #67520)

2024-09-30 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -5794,6 +5794,30 @@ static void handleRequiresCapabilityAttr(Sema &S, Decl *D, RequiresCapabilityAttr(S.Context, AL, Args.data(), Args.size()); D->addAttr(RCA); + + if (const auto *FD = dy

[clang] [clang] WIP: Warn on mismatched RequiresCapability attributes (PR #67520)

2024-09-30 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: tbaederr wrote: > So the semantics here are: if there is any `requires_capability` attribute on > a function, it needs to exactly match the set of `requires_capability` > attributes on every previous declaration? Or in

[clang] [Clang][TableGen] Change Opcodes Emitter to use const Record * (PR #110588)

2024-09-30 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. https://github.com/llvm/llvm-project/pull/110588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __builtin_(elementwise|reduce)_(max|min)imum (PR #110198)

2024-09-30 Thread Francis Visoiu Mistrih via cfe-commits
https://github.com/francisvm updated https://github.com/llvm/llvm-project/pull/110198 >From 8b53cbbcb3f9ea11b091407ec4ecfa59d1f748a3 Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Thu, 26 Sep 2024 18:05:09 -0700 Subject: [PATCH] [Clang] Add __builtin_elementwise|reduce_max|minimum

[clang] [clang] [Driver] Ensure we error on lto with link.exe and target `*-windows-msvc` on non cl driver modes (PR #109607)

2024-09-30 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/109607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > > Why isn't `misc` suitable for this use case? > > `bugprone` was just an initial thought. If the group think leads us to `misc` > I'm ok with moving in that direction. Other thoughts? Maybe i misunderstood, I thought you meant creating a new clang-tidy module called `a

[clang] [Clang][TableGen] Change ClangAttrEmitter to use const Record * (PR #110584)

2024-09-30 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. LGTM Looks like this a project-wide refactor, and since this is literally just adding `const` in a bunch of places, I don’t think there is much that could go wrong here. https://github.com/llvm/llvm-project/pull/110584 __

[clang] [clang] Fix the local parameter of void type inside the `Requires` expression. (PR #109831)

2024-09-30 Thread via cfe-commits
c8ef wrote: Thank you all for reviewing! If this patch looks good, could someone help me land it? https://github.com/llvm/llvm-project/pull/109831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [clang][x86] Add constexpr support for PDEP/PEXT intrinsics (PR #110535)

2024-09-30 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/110535 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Implement Clang Builtins for XCVmac Extension in CV32E40P (PR #110623)

2024-09-30 Thread Craig Topper via cfe-commits
@@ -0,0 +1,111 @@ +/*=== riscv_corev_mac.h - CORE-V multiply accumulate intrinsics === + * + * 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: Apac

[clang] 463a4f1 - [Clang][Concepts] Normalize SizeOfPackExpr's pack declaration (#110238)

2024-09-30 Thread via cfe-commits
Author: Younan Zhang Date: 2024-10-01T12:28:30+08:00 New Revision: 463a4f15044c04279583d6d0da73ae49f4c242ec URL: https://github.com/llvm/llvm-project/commit/463a4f15044c04279583d6d0da73ae49f4c242ec DIFF: https://github.com/llvm/llvm-project/commit/463a4f15044c04279583d6d0da73ae49f4c242ec.diff

[clang] [Clang][Concepts] Normalize SizeOfPackExpr's pack declaration (PR #110238)

2024-09-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/110238 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a bug in annotating angles containing FatArrow (PR #108671)

2024-09-30 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/108671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix templated array size calculation. (PR #96464)

2024-09-30 Thread via cfe-commits
https://github.com/awson updated https://github.com/llvm/llvm-project/pull/96464 >From 096b999120cc28844d780acbc16f8308b3a54160 Mon Sep 17 00:00:00 2001 From: awson Date: Mon, 24 Jun 2024 10:34:51 +0300 Subject: [PATCH 1/3] [Clang][Sema] don't handle ArraySize/AllocType early. --- clang/lib/Se

[clang] [clang-format] Fix a bug in annotating angles containing FatArrow (PR #108671)

2024-09-30 Thread Owen Pan via cfe-commits
@@ -243,14 +244,16 @@ class AnnotatingParser { // operator that was misinterpreted because we are parsing template // parameters. // FIXME: This is getting out of hand, write a decent parser. - if (InExpr && !Line.startsWith(tok::kw_template) && + if

[clang] [RISCV] Implement Clang Builtins for XCVmac Extension in CV32E40P (PR #110623)

2024-09-30 Thread via cfe-commits
https://github.com/realqhc updated https://github.com/llvm/llvm-project/pull/110623 >From da8b2fc0b5815f5870efe650ba5d585ec14e1a08 Mon Sep 17 00:00:00 2001 From: Qihan Cai Date: Tue, 1 Oct 2024 12:14:15 +1000 Subject: [PATCH 1/2] [RISCV] Implement Clang Builtins for XCVmac Extension in CV32E40

[clang] [RISCV] Implement Clang Builtins for XCVmac Extension in CV32E40P (PR #110623)

2024-09-30 Thread via cfe-commits
https://github.com/realqhc updated https://github.com/llvm/llvm-project/pull/110623 >From da8b2fc0b5815f5870efe650ba5d585ec14e1a08 Mon Sep 17 00:00:00 2001 From: Qihan Cai Date: Tue, 1 Oct 2024 12:14:15 +1000 Subject: [PATCH 1/2] [RISCV] Implement Clang Builtins for XCVmac Extension in CV32E40

[clang] [clang-tools-extra] [clangd] [AST] Handle uninitialized type constraints (PR #110496)

2024-09-30 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @falbrechtskirchinger We need to resort to `-fallow-pch-with-compiler-errors` :) Specifically, add the following file to `clang/test/PCH` (or somehow merge it into a pre-existing test, which I'd prefer) Name it with a reasonable name e.g. `cxx2a-invalid-constraint-serializatio

[clang] [Clang][TableGen] Change Opcodes Emitter to use const Record * (PR #110588)

2024-09-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Rahul Joshi (jurahul) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/110588.diff 1 Files Affected: - (modified) clang/utils/TableGen/ClangOpcodesEmitter.cpp (+8-8) ``diff diff --git a/clang/utils/TableGen/C

[clang] [Clang][TableGen] Change Opcodes Emitter to use const Record * (PR #110588)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul ready_for_review https://github.com/llvm/llvm-project/pull/110588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Emit load of GEP after EmitMemberExpr (PR #110487)

2024-09-30 Thread Jan Hendrik Farr via cfe-commits
Cydox wrote: > I went ahead and used the `EmitPointerWithAlignment` for all (it worked > without needing special casing). I'll look into doing this in Sema as a > potential cleanup. With that change now the compiler segfaults when compiling the example C file I posted above: > ```c > #inclu

[clang] [Clang][TableGen] Change ClangDiagnosticEmitter to use const Record * (PR #110585)

2024-09-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Rahul Joshi (jurahul) Changes This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089 -

[clang] [Clang][TableGen] Change ClangAttrEmitter to use const Record * (PR #110584)

2024-09-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Rahul Joshi (jurahul) Changes This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089

[clang] [Clang][TableGen] Change ClangDiagnosticEmitter to use const Record * (PR #110585)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul ready_for_review https://github.com/llvm/llvm-project/pull/110585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][TableGen] Change ClangDiagnosticEmitter to use const Record * (PR #110585)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul edited https://github.com/llvm/llvm-project/pull/110585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][TableGen] Change ClangDiagnosticEmitter to use const Record * (PR #110585)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul edited https://github.com/llvm/llvm-project/pull/110585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][TableGen] Change ClangAttrEmitter to use const Record * (PR #110584)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul ready_for_review https://github.com/llvm/llvm-project/pull/110584 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][TableGen] Change ClangAttrEmitter to use const Record * (PR #110584)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul edited https://github.com/llvm/llvm-project/pull/110584 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] [mlir] [TableGen] Change TableGenMain to use const RecordKeeper (PR #110578)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul edited https://github.com/llvm/llvm-project/pull/110578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] [mlir] [TableGen] Change TableGenMain to use const RecordKeeper (PR #110578)

2024-09-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-mlir-core Author: Rahul Joshi (jurahul) Changes Change TableGenMain's `MainFn` argument to be a function that accepts a const reference to RecordKeeper. --- Full diff: https://github.com/llvm/llvm-project/pull/110578.diff 5 Files Affected: - (modifi

[clang] [libc] [llvm] [mlir] [TableGen] Change TableGenMain to use const RecordKeeper (PR #110578)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul ready_for_review https://github.com/llvm/llvm-project/pull/110578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Emit load of GEP after EmitMemberExpr (PR #110487)

2024-09-30 Thread Bill Wendling via cfe-commits
bwendling wrote: > > If I return the LValueToRValue cast and run EmitLValue on it > > I'm surprised EmitLValue didn't error out on that. The result of an > LValueToRValue cast is an rvalue. Calling EmitPointerWithAlignment on it > should work, I think. > > > I understand, but there are ~30 di

[clang] [Clang][CodeGen] Emit load of GEP after EmitMemberExpr (PR #110487)

2024-09-30 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/110487 >From 375a71d114fffb94c16455f476364a7de9e08191 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 30 Sep 2024 03:41:15 -0700 Subject: [PATCH 1/2] [Clang][CodeGen] Emit load of value We were missing a loa

[clang] [Clang][Concepts] Normalize SizeOfPackExpr's pack declaration (PR #110238)

2024-09-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/110238 >From 23a765ac6d8e455121346405332d2066dcc0861e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 27 Sep 2024 18:23:47 +0800 Subject: [PATCH 1/9] [Clang] GH93099 --- clang/include/clang/Sema/Sema.h

[clang] [clang] Fix the local parameter of void type inside the `Requires` expression. (PR #109831)

2024-09-30 Thread Younan Zhang via cfe-commits
@@ -9509,6 +9509,19 @@ Sema::ActOnStartRequiresExpr(SourceLocation RequiresKWLoc, PushDeclContext(BodyScope, Body); for (ParmVarDecl *Param : LocalParameters) { +if (Param->getType()->isVoidType()) { + if (LocalParameters.size() > 1) { +Diag(Param->getBeg

[clang] [clang] Fix the local parameter of void type inside the `Requires` expression. (PR #109831)

2024-09-30 Thread Younan Zhang via cfe-commits
@@ -153,6 +153,10 @@ RequiresExpr::RequiresExpr(ASTContext &C, SourceLocation RequiresKWLoc, std::copy(Requirements.begin(), Requirements.end(), getTrailingObjects()); RequiresExprBits.IsSatisfied |= Dependent; + RequiresExprBits.IsSatisfied &= + llvm::no

[clang] [llvm] [SPARC] Align i128 to 16 bytes in SPARC datalayouts (PR #106951)

2024-09-30 Thread via cfe-commits
koachan wrote: My bad, yeah, I forgot to run bugpoint tests. https://github.com/llvm/llvm-project/pull/110608 should fix it. https://github.com/llvm/llvm-project/pull/106951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-30 Thread Chris B via cfe-commits
@@ -10506,7 +10506,9 @@ def err_second_argument_to_cwsc_not_pointer : Error< "second argument to __builtin_call_with_static_chain must be of pointer type">; def err_vector_incorrect_num_initializers : Error< - "%select{too many|too few}0 elements in vector initialization (

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-30 Thread Chris B via cfe-commits
@@ -10506,7 +10506,9 @@ def err_second_argument_to_cwsc_not_pointer : Error< "second argument to __builtin_call_with_static_chain must be of pointer type">; def err_vector_incorrect_num_initializers : Error< - "%select{too many|too few}0 elements in vector initialization (

[clang] [HLSL][clang] Add elementwise builtin for atan2 (p3) (PR #110187)

2024-09-30 Thread Tex Riddell via cfe-commits
https://github.com/tex3d updated https://github.com/llvm/llvm-project/pull/110187 >From 3669af3b40c85f1287f2c2fcb27bfc4282babd6a Mon Sep 17 00:00:00 2001 From: Tex Riddell Date: Fri, 13 Sep 2024 18:56:58 -0700 Subject: [PATCH] [HLSL][clang] Add elementwise builtin for atan2 (p3) This change is

[clang] [clang] Fix the local parameter of void type inside the `Requires` expression. (PR #109831)

2024-09-30 Thread Matheus Izvekov via cfe-commits
@@ -9509,6 +9509,19 @@ Sema::ActOnStartRequiresExpr(SourceLocation RequiresKWLoc, PushDeclContext(BodyScope, Body); for (ParmVarDecl *Param : LocalParameters) { +if (Param->getType()->isVoidType()) { + if (LocalParameters.size() > 1) { +Diag(Param->getBeg

[clang] [Clang][CodeGen] Emit load of GEP after EmitMemberExpr (PR #110487)

2024-09-30 Thread Bill Wendling via cfe-commits
bwendling wrote: > This is sort of the same comment I've made on other related patches... but I > think the fundamental issue here is that StructAccessBase is skipping over > CK_LValueToRValue casts. Once you jump over such a cast, you're looking at > expressions which are at a different level

[clang] [clang] Fix the local parameter of void type inside the `Requires` expression. (PR #109831)

2024-09-30 Thread Matheus Izvekov via cfe-commits
@@ -153,6 +153,10 @@ RequiresExpr::RequiresExpr(ASTContext &C, SourceLocation RequiresKWLoc, std::copy(Requirements.begin(), Requirements.end(), getTrailingObjects()); RequiresExprBits.IsSatisfied |= Dependent; + RequiresExprBits.IsSatisfied &= + llvm::no

[clang] [Clang][TableGen] Change ClangAttrEmitter to use const Record * (PR #110584)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/110584 None >From 26576dbe94bbe9885b01ca66c97f9ccbc87ec471 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Mon, 30 Sep 2024 15:04:17 -0700 Subject: [PATCH] [Clang][TableGen] Change ClangAttrEmitter to use const Recor

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -1915,6 +1936,101 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D, } } + std::optional Args; + if (Exp) { +if (const auto *CE = dyn_cast(Exp)) + Args = CE->arguments(); +else if (const auto *CE = dyn_cast(Exp)) + Args = CE->ar

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -3171,6 +3171,372 @@ void lockUnlock() EXCLUSIVE_LOCKS_REQUIRED(mu) { } // end namespace ScopedUnlock +namespace PassingScope { + +class SCOPED_LOCKABLE RelockableScope { +public: + RelockableScope(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu); + void Release() UNLOCK_FUNCTION(

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -3171,6 +3171,372 @@ void lockUnlock() EXCLUSIVE_LOCKS_REQUIRED(mu) { } // end namespace ScopedUnlock +namespace PassingScope { + +class SCOPED_LOCKABLE RelockableScope { +public: + RelockableScope(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu); + void Release() UNLOCK_FUNCTION(

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert edited https://github.com/llvm/llvm-project/pull/110523 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -1915,6 +1936,101 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D, } } + std::optional Args; + if (Exp) { +if (const auto *CE = dyn_cast(Exp)) + Args = CE->arguments(); +else if (const auto *CE = dyn_cast(Exp)) + Args = CE->ar

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -1915,6 +1936,101 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D, } } + std::optional Args; + if (Exp) { +if (const auto *CE = dyn_cast(Exp)) + Args = CE->arguments(); +else if (const auto *CE = dyn_cast(Exp)) + Args = CE->ar

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -305,6 +337,16 @@ deadlock can occur if the function acquires the mutex a second time. mu.Unlock(); } + void exclude(MutexLocker& scope LOCKS_EXCLUDED(mu)){ aaronpuchert wrote: ```suggestion void exclude(MutexLocker& scope LOCKS_EXCLUDED(mu)) { `

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -1915,6 +1936,101 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D, } } + std::optional Args; + if (Exp) { +if (const auto *CE = dyn_cast(Exp)) + Args = CE->arguments(); +else if (const auto *CE = dyn_cast(Exp)) + Args = CE->ar

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -211,17 +214,35 @@ must be held on entry to the function, *and must still be held on exit*. mu1.Unlock(); } + void require(MutexLocker& scope REQUIRES(mu1)) { +scope.Unlock(); +a=0; // Warning! Requires mu1. aaronpuchert wrote: Nitpick: sp

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert commented: One more idea for a test: can a parameter attribute reference another parameter? Then we could try something like ```c++ struct ObjectWithMutex { Mutex mu; }; void releaseMember(ObjectWithMutex& object, ReleasableMutexLock& scope EXCLUSIVE_UNLOCK_FUNCT

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-09-30 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/103039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][TableGen] Change Opcodes Emitter to use const Record * (PR #110588)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/110588 None >From 46ab6ac668a50ebe46cb2a69ead5d3808250e26e Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Mon, 30 Sep 2024 15:23:11 -0700 Subject: [PATCH] [Clang][TableGen] Change Opcodes Emitter to use const Record

[clang] [Clang][TableGen] Change ClangDiagnosticEmutter to use const Record * (PR #110585)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/110585 None >From a4aac38b8ce3f8e6a4f16790bc5d231a4e1635a0 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Mon, 30 Sep 2024 15:15:06 -0700 Subject: [PATCH] [Clang][TableGen] Change ClangDiagnosticEmutter to use const

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-09-30 Thread Utkarsh Saxena via cfe-commits
@@ -83,6 +83,19 @@ namespace llvm { class raw_pwrite_stream; +// Type of the time trace event. +enum class TimeTraceEventType { + // Complete events have a duration (start and end time points) and are marked + // by the "X" phase type. + CompleteEvent, usx

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-09-30 Thread Utkarsh Saxena via cfe-commits
@@ -194,13 +234,17 @@ struct llvm::TimeTraceProfiler { J.attribute("pid", Pid); J.attribute("tid", int64_t(Tid)); J.attribute("ts", StartUs); -if (E.AsyncEvent) { +if (TimeTraceEventType::AsyncEvent == E.EventType) { usx9

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-09-30 Thread Utkarsh Saxena via cfe-commits
@@ -114,27 +134,42 @@ struct llvm::TimeTraceProfiler { llvm::get_thread_name(ThreadName); } - TimeTraceProfilerEntry *begin(std::string Name, -llvm::function_ref Detail, -bool AsyncEvent = false) { -Sta

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-09-30 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 approved this pull request. Thanks. Looks great now. Should be ready to land. Left some nit comments. https://github.com/llvm/llvm-project/pull/103039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-09-30 Thread Utkarsh Saxena via cfe-commits
@@ -145,27 +180,32 @@ struct llvm::TimeTraceProfiler { DurationType Duration = E.End - E.Start; // Only include sections longer or equal to TimeTraceGranularity msec. -if (duration_cast(Duration).count() >= TimeTraceGranularity) +if (duration_cast(Duration).cou

[clang] [clang][CodeGen] Emit improved memory effects and return status for AsmStmt (PR #110510)

2024-09-30 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: The gcc documentation isn't really written like a reference... it's hard to tell what exactly it does and does not guarantee. And we generally want clang to reduce its reliance on gcc documentation to define its own behavior. Particularly for edges that gcc documentation

[clang] [clang][x86] Add constexpr support for all remaining BMI1 intrinsics (PR #110581)

2024-09-30 Thread via cfe-commits
goldsteinn wrote: LG but in official headers need to fix fmt. https://github.com/llvm/llvm-project/pull/110581 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][x86] Add constexpr support for all remaining BMI1 intrinsics (PR #110581)

2024-09-30 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 78ccffc05336201c90e2c0bb2ae929ea3a6eec2b 6dd203077d78ea7d757ab775a0a61b365c3359b8 --e

[clang] [llvm] [sanitizer] Document AddressSanitizer security considerations (PR #100937)

2024-09-30 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. LGTM % vitaly's comment https://github.com/llvm/llvm-project/pull/100937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][x86] Add constexpr support for all remaining BMI1 intrinsics (PR #110581)

2024-09-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: Simon Pilgrim (RKSimon) Changes BEXTR/TZCNT are already handled, so we just need to tag the rest of the intrinsics, which are all expanded to generic patterns. --- Full diff: https://github.com/llvm/llvm-project/pull/110581.diff 3

[clang] [clang] Redeclare function templates instances per primary template (PR #110387)

2024-09-30 Thread Matheus Izvekov via cfe-commits
@@ -2146,9 +2147,15 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl( FunctionDecl *SpecFunc = FunctionTemplate->findSpecialization(Innermost, InsertPos); -// If we already have a function template specialization, return it. -if (SpecFunc) - return S

[clang] [clang][x86] Add constexpr support for all remaining BMI1 intrinsics (PR #110581)

2024-09-30 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon created https://github.com/llvm/llvm-project/pull/110581 BEXTR/TZCNT are already handled, so we just need to tag the rest of the intrinsics, which are all expanded to generic patterns. >From 6dd203077d78ea7d757ab775a0a61b365c3359b8 Mon Sep 17 00:00:00 2001 From: Simo

[clang] [clang] Redeclare function templates instances per primary template (PR #110387)

2024-09-30 Thread Matheus Izvekov via cfe-commits
@@ -3949,28 +3949,15 @@ TemplateDeductionResult Sema::FinishTemplateArgumentDeduction( TemplateArgumentList::CreateCopy(Context, CanonicalBuilder); Info.reset(SugaredDeducedArgumentList, CanonicalDeducedArgumentList); + FunctionTemplate = FunctionTemplate->getMostRec

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > creation of an advisory group. Why isn't `misc` suitable for this use case? It would be confusing to have both groups I think, and may lead to bike-shedding discussions in the future about where a check belongs in misc or advisory. https://github.com/llvm/llvm-project/p

[clang] [clang][CodeGen] Emit improved memory effects and return status for AsmStmt (PR #110510)

2024-09-30 Thread Bruno De Fraine via cfe-commits
brunodf-snps wrote: > We need documentation for the exact assumptions we're making here. Sure, we can try to work on this (and your other remarks). But what do you have in mind? Since this form of inline assembly is a gcc extension, I consider the gcc documentation and implementation authorita

[clang] [libc] [llvm] [mlir] [TableGen] Change TableGenMain to use const RecordKeeper (PR #110578)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/110578 Change TableGenMain's `MainFn` argument to be a function that accepts a const reference to RecordKeeper. >From 40ad0205938492a163b6c261b7c46a78b7e65e32 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Mon, 30

[clang] [clang] WIP: Warn on mismatched RequiresCapability attributes (PR #67520)

2024-09-30 Thread Aaron Puchert via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -5794,6 +5794,30 @@ static void handleRequiresCapabilityAttr(Sema &S, Decl *D, RequiresCapabilityAttr(S.Context, AL, Args.data(), Args.size()); D->addAttr(RCA); + + if (const auto *FD = dy

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - bugprone-nondeterministic-pointer-usage + +nondeterministic-pointer-usage +== + +Finds nondeterministic usages of pointers in unordered containers. + +One canonical example is iteration across a container of poi

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - bugprone-nondeterministic-pointer-usage + +nondeterministic-pointer-usage +== + +Finds nondeterministic usages of pointers in unordered containers. + +One canonical example is iteration across a container of poi

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,67 @@ +//===--- NondetermnisticPointerUsageCheck.cpp - clang-tidy ===// vabridgers wrote: Done, thanks https://github.com/llvm/llvm-project/pull/110471 ___ cfe-commits mailing list cfe-commits@li

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -103,6 +103,10 @@ Improvements to clang-tidy New checks ^^ +- New check :doc:`bugprone-nondeterministic-pointer-usage EugeneZelenko wrote: See 19 Release Notes as example for such entries. https://github.com/llvm/llvm-project/pull/110471 _

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,67 @@ +//===--- NondetermnisticPointerUsageCheck.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: Apache-2

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -179,6 +180,8 @@ class BugproneModule : public ClangTidyModule { CheckFactories.registerCheck( "bugprone-narrowing-conversions"); CheckFactories.registerCheck("bugprone-no-escape"); +CheckFactories.registerCheck( +"bugprone-nondeterministic-pointe

[clang] [clang] WIP: Warn on mismatched RequiresCapability attributes (PR #67520)

2024-09-30 Thread Aaron Puchert via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/aaronpuchert commented: So the semantics here are: if there is any `requires_capability` attribute on a function, it needs to exactly match the set of `requires_capability` attributes on every previou

[clang] [clang] WIP: Warn on mismatched RequiresCapability attributes (PR #67520)

2024-09-30 Thread Aaron Puchert via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -5794,6 +5794,30 @@ static void handleRequiresCapabilityAttr(Sema &S, Decl *D, RequiresCapabilityAttr(S.Context, AL, Args.data(), Args.size()); D->addAttr(RCA); + + if (const auto *FD = dy

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - bugprone-nondeterministic-pointer-usage + +nondeterministic-pointer-usage +== vabridgers wrote: Will update, thanks! https://github.com/llvm/llvm-project/pull/110471 __

[clang] [clang] WIP: Warn on mismatched RequiresCapability attributes (PR #67520)

2024-09-30 Thread Aaron Puchert via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/aaronpuchert edited https://github.com/llvm/llvm-project/pull/67520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,1450 @@ +// Like the compiler, clang-tidy treats some functions differently if +// they come from a system header -- for example, it is assumed that system +// functions do not arbitrarily free() their parameters, and that some bugs +// found in system headers cannot be

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
vabridgers wrote: > I wish we had something like this. It might be possible, but really really > challenging to implement. To me the problem is that the iteration or lookups > are not necessarily bad. And to determine if it's bad one needs to understand > how the result of the lookup or the in

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,36 @@ +//===--- NondeterministicPointerUsageCheck.h - clang-tidy ---*- C++ -*-===// vabridgers wrote: Done, thanks https://github.com/llvm/llvm-project/pull/110471 ___ cfe-commits mailing list cfe-commits@li

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
https://github.com/vabridgers updated https://github.com/llvm/llvm-project/pull/110471 >From 52e390899c6c58840e97f5fb1b67f171c178b6d6 Mon Sep 17 00:00:00 2001 From: einvbri Date: Thu, 26 Sep 2024 16:24:59 +0200 Subject: [PATCH] [clang-tidy] [analyzer] Nondeterministic pointer usage improvement

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Chris B via cfe-commits
llvm-beanz wrote: > There is still logic elsewhere that sets the default entry point to "main", > right? This looks right to me. Yes, and we apply the HLSLShader attribute to main and key generating the entry off that in clangCodeGen. https://github.com/llvm/llvm-project/pull/110546 _

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/110546 >From c966c604e8e40ddae4e738d6048bb7f87cfeeb25 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 30 Sep 2024 13:05:09 -0500 Subject: [PATCH 1/3] [HLSL] Treat `main` as any other function HLSL doesn't

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/110546 >From c966c604e8e40ddae4e738d6048bb7f87cfeeb25 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 30 Sep 2024 13:05:09 -0500 Subject: [PATCH 1/2] [HLSL] Treat `main` as any other function HLSL doesn't

[libcxx] [libcxxabi] [libunwind] [llvm] [runtimes] Run backdeployment CI on Github hosted runners (PR #109984)

2024-09-30 Thread Louis Dionne via cfe-commits
https://github.com/ldionne closed https://github.com/llvm/llvm-project/pull/109984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   >