[clang] [flang] [Flang][Driver] Add -print-resource-dir command line flag to emit Flang's resource directory (PR #90886)

2024-05-13 Thread Michael Klemm via cfe-commits
https://github.com/mjklemm updated https://github.com/llvm/llvm-project/pull/90886 >From 1a994159025f127f0f7d11da80b74035788d52c9 Mon Sep 17 00:00:00 2001 From: Michael Klemm Date: Thu, 2 May 2024 14:50:45 +0200 Subject: [PATCH 1/8] Enable -print-resource-dir also for Flang --- clang/include/

[clang] c4e9e41 - [Clang] Ensure ``if consteval`` consititute an immediate function context (#91939)

2024-05-13 Thread via cfe-commits
Author: cor3ntin Date: 2024-05-13T16:04:20+02:00 New Revision: c4e9e41199127bb288e84e9477da99f28941edb3 URL: https://github.com/llvm/llvm-project/commit/c4e9e41199127bb288e84e9477da99f28941edb3 DIFF: https://github.com/llvm/llvm-project/commit/c4e9e41199127bb288e84e9477da99f28941edb3.diff LOG:

[clang] [Clang] Ensure ``if consteval`` consititute an immediate function context (PR #91939)

2024-05-13 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/91939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-13 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/91345 >From 855a84814eb8d263427bce7837af61e67eb2db95 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Tue, 7 May 2024 14:47:45 +0200 Subject: [PATCH 1/6] Make unique instances --- clang/lib/Sema/SemaOpenMP.cpp |

[clang] [Clang] Fix dependency computation for pack indexing expression (PR #91933)

2024-05-13 Thread via cfe-commits
@@ -377,7 +377,7 @@ ExprDependence clang::computeDependence(PackExpansionExpr *E) { ExprDependence clang::computeDependence(PackIndexingExpr *E) { ExprDependence D = E->getIndexExpr()->getDependence(); if (D & ExprDependence::Value) -D |= ExprDependence::TypeInstantiat

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread via cfe-commits
https://github.com/EugeneZelenko edited https://github.com/llvm/llvm-project/pull/91951 ___ 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 `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread via cfe-commits
@@ -0,0 +1,50 @@ +.. title:: clang-tidy - bugprone-virtual-arithmetic + +bugprone-virtual-arithmetic +=== + +Warn if pointer arithmetic is performed on a class that declares a +virtual function. + +Pointer arithmetic on polymorphic objects where the pointer

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread via cfe-commits
@@ -0,0 +1,30 @@ +//===--- VirtualArithmeticCheck.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 `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread via cfe-commits
https://github.com/EugeneZelenko commented: Please mention new check in Release Notes. https://github.com/llvm/llvm-project/pull/91951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] b0b6c16 - [Clang][OpenMP][Tile] Allow non-constant tile sizes. (#91345)

2024-05-13 Thread via cfe-commits
Author: Michael Kruse Date: 2024-05-13T16:10:58+02:00 New Revision: b0b6c16b470a7d5d9c63765058cca0ebe07ad57d URL: https://github.com/llvm/llvm-project/commit/b0b6c16b470a7d5d9c63765058cca0ebe07ad57d DIFF: https://github.com/llvm/llvm-project/commit/b0b6c16b470a7d5d9c63765058cca0ebe07ad57d.diff

[clang] [openmp] [Clang][OpenMP] Fix tile/unroll on iterator- and foreach-loops. (PR #91459)

2024-05-13 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/91459 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [openmp] [Clang][OpenMP][Tile] Allow non-constant tile sizes. (PR #91345)

2024-05-13 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/91345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Processing real directories added as virtual ones (PR #91645)

2024-05-13 Thread Duncan P . N . Exon Smith via cfe-commits
dexonsmith wrote: @benlangmuir and @jansvoboda11 might also be good reviewers for this. https://github.com/llvm/llvm-project/pull/91645 ___ 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 `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91951 ___ 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 `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. Needs some small changes before landing. It's a good check to have, thanks. https://github.com/llvm/llvm-project/pull/91951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,50 @@ +.. title:: clang-tidy - bugprone-virtual-arithmetic + +bugprone-virtual-arithmetic +=== + +Warn if pointer arithmetic is performed on a class that declares a +virtual function. + +Pointer arithmetic on polymorphic objects where the pointer

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,49 @@ +//===--- VirtualArithmeticCheck.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] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,49 @@ +//===--- VirtualArithmeticCheck.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] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,30 @@ +//===--- VirtualArithmeticCheck.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 `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %check_clang_tidy %s bugprone-virtual-arithmetic %t + +class Base { +public: + virtual ~Base() {} +}; + +class Derived : public Base {}; + +void operators() { + Base *b = new Derived[10]; + + b += 1; + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: poi

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,30 @@ +//===--- VirtualArithmeticCheck.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] Ignore `if consteval` in else-after-return (PR #91588)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/91588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [driver] Do not warn about unused plugin flags. (PR #88948)

2024-05-13 Thread Michael Kruse via cfe-commits
Meinersbur wrote: @jakeegan Sorry, didn't see you comment over an extended weekend. https://github.com/llvm/llvm-project/pull/88948 ___ 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 `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91951 ___ 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 `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/91951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Add amdgpu-as MMRA for fences (PR #78572)

2024-05-13 Thread Pierre van Houtryve via cfe-commits
@@ -4408,6 +4409,42 @@ Target-Specific Extensions Clang supports some language features conditionally on some targets. +AMDGPU Language Extensions +-- + +__builtin_amdgcn_fence +^^ + +``__builtin_amdgcn_fence`` emits a fence. + +* `

[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)

2024-05-13 Thread Balázs Kéri via cfe-commits
@@ -136,53 +100,48 @@ void ErrnoModeling::checkBeginFunction(CheckerContext &C) const { ASTContext &ACtx = C.getASTContext(); ProgramStateRef State = C.getState(); - if (const auto *ErrnoVar = dyn_cast_or_null(ErrnoDecl)) { -// There is an external 'errno' variable.

[clang] [openmp] [Clang][OpenMP] Fix tile/unroll on iterator- and foreach-loops. (PR #91459)

2024-05-13 Thread Michael Kruse via cfe-commits
@@ -182,17 +182,34 @@ class OMPLoopScope : public CodeGenFunction::RunCleanupsScope { } return false; }); - PreInits = cast_or_null(LD->getPreInits()); + PreInits = LD->getPreInits(); } else if (const auto *Tile = dyn_cast(&S))

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-13 Thread Balázs Kéri via cfe-commits
@@ -1179,6 +1179,34 @@ security.insecureAPI.DeprecatedOrUnsafeBufferHandling (C) strncpy(buf, "a", 1); // warn } +security.SetgidSetuidOrder (C) +"" balazske wrote: Move the new checker into `unix`, or move the chroot checker i

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/91972 Fixes [this bug](https://github.com/llvm/llvm-project/pull/90152#issuecomment-2107363977) introduced in #90152. This bug occurs when typo-correction attempts to fix a reference to a non-existent member of t

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Krystian Stasiowski (sdkrystian) Changes Fixes [this bug](https://github.com/llvm/llvm-project/pull/90152#issuecomment-2107363977) introduced in #90152. This bug occurs when typo-correction attempts to fix a reference to a non-existent

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent

2024-05-13 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @ilya-biryukov See #91972 https://github.com/llvm/llvm-project/pull/90152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/91972 >From a013806c0199e260c37bc6b16b600e61e4caa1c9 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 13 May 2024 10:22:04 -0400 Subject: [PATCH] [Clang][Sema] Fix bug where operator-> typo corrects in

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/91972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-13 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -1179,6 +1179,34 @@ security.insecureAPI.DeprecatedOrUnsafeBufferHandling (C) strncpy(buf, "a", 1); // warn } +security.SetgidSetuidOrder (C

[clang] [analyzer][NFC] Move `CTUPhase1InliningMode` option to String analyzer options category (PR #91932)

2024-05-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/91932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Move `CTUPhase1InliningMode` option to String analyzer options category (PR #91932)

2024-05-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Fair! https://github.com/llvm/llvm-project/pull/91932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 96ebed7 - [analyzer][NFC] Move `CTUPhase1InliningMode` option to String analyzer options category (#91932)

2024-05-13 Thread via cfe-commits
Author: JOSTAR Date: 2024-05-13T16:32:46+02:00 New Revision: 96ebed7c7481bb143c9d3db5f4c128bb32545229 URL: https://github.com/llvm/llvm-project/commit/96ebed7c7481bb143c9d3db5f4c128bb32545229 DIFF: https://github.com/llvm/llvm-project/commit/96ebed7c7481bb143c9d3db5f4c128bb32545229.diff LOG: [

[clang] [analyzer][NFC] Move `CTUPhase1InliningMode` option to String analyzer options category (PR #91932)

2024-05-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/91932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] CTAD: implement the missing IsDeducible constraint for alias templates (PR #89358)

2024-05-13 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/89358 >From 20947c1a34fae3593a98dba125e5d70d652c7190 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 19 Apr 2024 10:54:12 +0200 Subject: [PATCH] [clang] CTAD: implement the missing IsDeducible constraint for alias

[clang] [llvm] [AMDGPU][WIP] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-05-13 Thread Matt Arsenault via cfe-commits
@@ -5386,6 +5386,153 @@ bool AMDGPULegalizerInfo::legalizeDSAtomicFPIntrinsic(LegalizerHelper &Helper, return true; } +bool AMDGPULegalizerInfo::legalizeLaneOp(LegalizerHelper &Helper, + MachineInstr &MI, +

[clang] [clang] CTAD: implement the missing IsDeducible constraint for alias templates (PR #89358)

2024-05-13 Thread Haojian Wu via cfe-commits
@@ -190,13 +196,15 @@ template struct Foo { Foo(T); }; template using AFoo = Foo; template concept False = false; -template using BFoo = AFoo; +template +using BFoo = AFoo; // expected-note {{candidate template ignored: constraints not satisfied [with V = int]}} \ +

[clang] [clang] CTAD: implement the missing IsDeducible constraint for alias templates (PR #89358)

2024-05-13 Thread Haojian Wu via cfe-commits
@@ -18,6 +18,7 @@ #include "clang/AST/ExprCXX.h" #include "clang/AST/RecursiveASTVisitor.h" #include "clang/AST/TemplateName.h" +#include "clang/AST/Type.h" hokein wrote: Done. https://github.com/llvm/llvm-project/pull/89358 __

[clang] [clang] CTAD: implement the missing IsDeducible constraint for alias templates (PR #89358)

2024-05-13 Thread Haojian Wu via cfe-commits
@@ -27,7 +27,8 @@ enum TypeTrait { , #define TYPE_TRAIT_2(Spelling, Name, Key) BTT_##Name, #include "clang/Basic/TokenKinds.def" - BTT_Last = UTT_Last // BTT_Last == last BTT_XX in the enum. + BTT_Last = UTT_Last hokein wrote: Reverted the change. https:/

[clang] [clang] CTAD: implement the missing IsDeducible constraint for alias templates (PR #89358)

2024-05-13 Thread Haojian Wu via cfe-commits
@@ -6116,6 +6116,17 @@ static bool EvaluateBinaryTypeTrait(Sema &Self, TypeTrait BTT, const TypeSourceI tok::kw___is_pointer_interconvertible_base_of); return Self.IsPointerInterconvertibleBaseOf(Lhs, Rhs); + } + case BTT_IsDeducible: { +

[clang] [clang] CTAD: implement the missing IsDeducible constraint for alias templates (PR #89358)

2024-05-13 Thread Haojian Wu via cfe-commits
@@ -2774,6 +2775,41 @@ Expr *transformRequireClause(Sema &SemaRef, FunctionTemplateDecl *FTD, return E.getAs(); } +// Build the associated constraints for the alias deduction guides. +// C++ [over.match.class.deduct]p3.3: +// The associated constraints ([temp.constr.decl]

[clang] [llvm] [AMDGPU][WIP] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-05-13 Thread Matt Arsenault via cfe-commits
@@ -5387,6 +5387,212 @@ bool AMDGPULegalizerInfo::legalizeDSAtomicFPIntrinsic(LegalizerHelper &Helper, return true; } +bool AMDGPULegalizerInfo::legalizeLaneOp(LegalizerHelper &Helper, + MachineInstr &MI, +

[clang] [llvm] [AMDGPU][WIP] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-05-13 Thread Matt Arsenault via cfe-commits
@@ -5387,6 +5387,212 @@ bool AMDGPULegalizerInfo::legalizeDSAtomicFPIntrinsic(LegalizerHelper &Helper, return true; } +bool AMDGPULegalizerInfo::legalizeLaneOp(LegalizerHelper &Helper, + MachineInstr &MI, +

[clang] [llvm] [AMDGPU][WIP] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-05-13 Thread Matt Arsenault via cfe-commits
@@ -3400,7 +3400,7 @@ def : GCNPat< // FIXME: Should also do this for readlane, but tablegen crashes on // the ignored src1. def : GCNPat< - (int_amdgcn_readfirstlane (i32 imm:$src)), + (i32 (AMDGPUreadfirstlane (i32 imm:$src))), arsenm wrote: We might need

[clang] [llvm] [AMDGPU][WIP] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-05-13 Thread Matt Arsenault via cfe-commits
@@ -6086,6 +6086,68 @@ static SDValue lowerBALLOTIntrinsic(const SITargetLowering &TLI, SDNode *N, DAG.getConstant(0, SL, MVT::i32), DAG.getCondCode(ISD::SETNE)); } +static SDValue lowerLaneOp(const SITargetLowering &TLI, SDNode *N, + Selection

[clang] [clang][static analyzer] ignore try statements in dead code checker (PR #91675)

2024-05-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. Please remove the formatting changes. (Keep only the relevant lines) Add a test demonstrating that this fixes a false-positive. To find which file you need to add your test, I'd recommend braking something inside the checker to

[clang] Revert "Revert "[OpenMP][TR12] change property of map-type modifier."… (PR #91821)

2024-05-13 Thread via cfe-commits
jyu2-git wrote: Since this has been reviewed, I am merged in now. https://github.com/llvm/llvm-project/pull/91821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 3acc691 - Revert "Revert "[OpenMP][TR12] change property of map-type modifier."… (#91821)

2024-05-13 Thread via cfe-commits
Author: jyu2-git Date: 2024-05-13T07:39:23-07:00 New Revision: 3acc6919109d91c1f047a02229a1785b461259d9 URL: https://github.com/llvm/llvm-project/commit/3acc6919109d91c1f047a02229a1785b461259d9 DIFF: https://github.com/llvm/llvm-project/commit/3acc6919109d91c1f047a02229a1785b461259d9.diff LOG:

[clang] Revert "Revert "[OpenMP][TR12] change property of map-type modifier."… (PR #91821)

2024-05-13 Thread via cfe-commits
https://github.com/jyu2-git closed https://github.com/llvm/llvm-project/pull/91821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add option to exclude headers from clang-tidy analysis (PR #91400)

2024-05-13 Thread Justin Cady via cfe-commits
https://github.com/justincady updated https://github.com/llvm/llvm-project/pull/91400 >From e65bd48ef896f3327a1397a1b2f6f0a34e3711d2 Mon Sep 17 00:00:00 2001 From: Justin Cady Date: Tue, 7 May 2024 16:54:35 -0400 Subject: [PATCH] Add option to exclude headers from clang-tidy analysis This is a

[clang] [clang][analyzer] Ignore try-statements in dead code checker (PR #91675)

2024-05-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/91675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-13 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,185 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core,security.SetgidSetuidOrder -verify %s + +typedef int uid_t; +typedef int gid_t; + +int setuid(uid_t); +int setgid(gid_t); +int seteuid(uid_t); +int setegid(gid_t); +int setreuid(uid_t, uid_t); +int setregid(gid_

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-13 Thread via cfe-commits
https://github.com/koachan updated https://github.com/llvm/llvm-project/pull/90338 >From 5935e661941fd681b2bf6b3d915e97fe0d73fcd8 Mon Sep 17 00:00:00 2001 From: Koakuma Date: Thu, 25 Apr 2024 22:37:03 +0700 Subject: [PATCH 1/3] [clang][SPARC] Treat empty structs as if it's a one-bit type in th

[clang] c4a9a37 - [OpenACC] device_type clause Sema for Compute constructs

2024-05-13 Thread via cfe-commits
Author: erichkeane Date: 2024-05-13T07:50:19-07:00 New Revision: c4a9a374749deb5f2a932a7d4ef9321be1b2ae5d URL: https://github.com/llvm/llvm-project/commit/c4a9a374749deb5f2a932a7d4ef9321be1b2ae5d DIFF: https://github.com/llvm/llvm-project/commit/c4a9a374749deb5f2a932a7d4ef9321be1b2ae5d.diff LO

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-13 Thread via cfe-commits
@@ -21,6 +21,12 @@ char f_int_4(char x) { return x; } // CHECK-LABEL: define{{.*}} fp128 @f_ld(fp128 noundef %x) long double f_ld(long double x) { return x; } +// Empty struct is lowered as a placeholder word parameter. +struct empty {}; + +// CHECK-LABEL: define{{.*}} i64 @f_

[clang] [flang] [Flang][Driver] Add -print-resource-dir command line flag to emit Flang's resource directory (PR #90886)

2024-05-13 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. Apologies for losing track of this, I was on holiday all of last week. This LGTM https://github.com/llvm/llvm-project/pull/90886 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I think this needs a release note? I know the only case we have right now is because of your other patch, but perhaps this affects elsewhere too? https://github.com/llvm/llvm-project/pull/91972 __

[clang] [AST] Replace localUncachedLookup with noload_lookup in ASTImporterFixtures (PR #91955)

2024-05-13 Thread via cfe-commits
https://github.com/AtariDreams closed https://github.com/llvm/llvm-project/pull/91955 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 67c1872 - [clang][Interp] Return false from visitExpr() if allocateLocal failed

2024-05-13 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2024-05-13T16:59:30+02:00 New Revision: 67c18721eb2170a6cd7af461e16d994b1b83363a URL: https://github.com/llvm/llvm-project/commit/67c18721eb2170a6cd7af461e16d994b1b83363a DIFF: https://github.com/llvm/llvm-project/commit/67c18721eb2170a6cd7af461e16d994b1b83363a.diff LO

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Few nits. My main concern is an check name, had to open PR to find out what it does. maybe should be more a "bugprone-arithmetic-on-polymorphic-pointer" or something like that. https://github.com/llvm/llvm-project/pull/91951 ___

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/91951 ___ 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 `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %check_clang_tidy %s bugprone-virtual-arithmetic %t + +class Base { +public: + virtual ~Base() {} +}; + +class Derived : public Base {}; + +void operators() { + Base *b = new Derived[10]; + + b += 1; + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: poi

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,50 @@ +.. title:: clang-tidy - bugprone-virtual-arithmetic + +bugprone-virtual-arithmetic +=== + +Warn if pointer arithmetic is performed on a class that declares a +virtual function. + +Pointer arithmetic on polymorphic objects where the pointer

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,49 @@ +//===--- VirtualArithmeticCheck.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] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %check_clang_tidy %s bugprone-virtual-arithmetic %t + +class Base { +public: + virtual ~Base() {} +}; + +class Derived : public Base {}; + +void operators() { + Base *b = new Derived[10]; + + b += 1; + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: poi

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,49 @@ +//===--- VirtualArithmeticCheck.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-format][NFC] Move LeftRightQualifierAlignmentFixer::is...() (PR #91930)

2024-05-13 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/91930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-13 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/91616 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (PR #91879)

2024-05-13 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/91879 >From 6969f06f39363deda92d473ec14a08663c71f3b1 Mon Sep 17 00:00:00 2001 From: yronglin Date: Sun, 12 May 2024 14:42:09 +0800 Subject: [PATCH 1/2] [Analyzer][CFG] Correctly handle rebuilted default arg and defau

[clang] [Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (PR #91879)

2024-05-13 Thread via cfe-commits
https://github.com/yronglin ready_for_review https://github.com/llvm/llvm-project/pull/91879 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (PR #91879)

2024-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (yronglin) Changes Depends on https://github.com/llvm/llvm-project/pull/87933 Clang now support the following: - Extending lifetime of object bound to reference members of aggregates, that are created from default member initializer.

[clang] [Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (PR #91879)

2024-05-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: None (yronglin) Changes Depends on https://github.com/llvm/llvm-project/pull/87933 Clang now support the following: - Extending lifetime of object bound to reference members of aggregates, that are created from default m

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-13 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,196 @@ +//===-- SetgidSetuidOrderChecker.cpp - check privilege revocation calls ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang] Fix dependency computation for pack indexing expression (PR #91933)

2024-05-13 Thread via cfe-commits
@@ -377,7 +377,7 @@ ExprDependence clang::computeDependence(PackExpansionExpr *E) { ExprDependence clang::computeDependence(PackIndexingExpr *E) { ExprDependence D = E->getIndexExpr()->getDependence(); if (D & ExprDependence::Value) -D |= ExprDependence::TypeInstantiat

[clang] [Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (PR #91879)

2024-05-13 Thread via cfe-commits
@@ -2433,6 +2429,30 @@ CFGBlock *CFGBuilder::VisitChildren(Stmt *S) { return B; } +CFGBlock *CFGBuilder::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *Arg, + AddStmtChoice asc) { + if (Arg->hasRewrittenInit()) { +if (asc.alwaysAdd

[clang] [Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (PR #91879)

2024-05-13 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/91879 >From 6969f06f39363deda92d473ec14a08663c71f3b1 Mon Sep 17 00:00:00 2001 From: yronglin Date: Sun, 12 May 2024 14:42:09 +0800 Subject: [PATCH 1/3] [Analyzer][CFG] Correctly handle rebuilted default arg and defau

[clang] 257013e - [clang][Interp] Handle VariableArrayTypes

2024-05-13 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2024-05-13T17:21:39+02:00 New Revision: 257013e4f5cbdf644646da9ec3d60d6209c9bf25 URL: https://github.com/llvm/llvm-project/commit/257013e4f5cbdf644646da9ec3d60d6209c9bf25 DIFF: https://github.com/llvm/llvm-project/commit/257013e4f5cbdf644646da9ec3d60d6209c9bf25.diff LO

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > I think this needs a release note? I know the only case we have right now is > because of your other patch, but perhaps this affects elsewhere too? @erichkeane I don't think we need a release note since the code changes are in `LookupMemberExpr`, which prior to #90152 had n

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread Erich Keane via cfe-commits
erichkeane wrote: > > I think this needs a release note? I know the only case we have right now > > is because of your other patch, but perhaps this affects elsewhere too? > > @erichkeane I don't think we need a release note since the code changes are > in `LookupMemberExpr`, which prior to #9

[clang] 1f6f5bf - Fix warning from c4a9a374

2024-05-13 Thread via cfe-commits
Author: erichkeane Date: 2024-05-13T08:25:24-07:00 New Revision: 1f6f5bf9307033980121fc534815a7b59453e122 URL: https://github.com/llvm/llvm-project/commit/1f6f5bf9307033980121fc534815a7b59453e122 DIFF: https://github.com/llvm/llvm-project/commit/1f6f5bf9307033980121fc534815a7b59453e122.diff LO

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-05-13 Thread via cfe-commits
VReichelt wrote: Unfortunately, I get a crash in some circumstances: #91982 https://github.com/llvm/llvm-project/pull/85572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix dependency computation for pack indexing expression (PR #91933)

2024-05-13 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/91933 >From 4cadff527e02ae03aa5850ee713fe57aee663a52 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Mon, 13 May 2024 10:00:19 +0200 Subject: [PATCH 1/4] [Clang] Fix dependency computation for pack indexing expre

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-13 Thread Sergei Barannikov via cfe-commits
@@ -21,6 +21,12 @@ char f_int_4(char x) { return x; } // CHECK-LABEL: define{{.*}} fp128 @f_ld(fp128 noundef %x) long double f_ld(long double x) { return x; } +// Empty struct is lowered as a placeholder word parameter. +struct empty {}; + +// CHECK-LABEL: define{{.*}} i64 @f_

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-13 Thread Sergei Barannikov via cfe-commits
https://github.com/s-barannikov approved this pull request. https://github.com/llvm/llvm-project/pull/90338 ___ 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 `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: I'm not very happy about the name, there's no such thing as "virtual arithmetic". What about "bugprone-pointer-arithmetic-polymorphic-object"? I rather have a long descriptive name than a short ambiguous name. https://github.com/llvm/llvm-project/pull/91951 __

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Otherwise since this is a problem also on non-polymorphic objects, maybe "bugprone-pointer-arithmetic-base-class"? https://github.com/llvm/llvm-project/pull/91951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] 06f04b2 - Revert "[OpenACC] device_type clause Sema for Compute constructs"

2024-05-13 Thread via cfe-commits
Author: erichkeane Date: 2024-05-13T08:40:43-07:00 New Revision: 06f04b2e27f2586d3db2204ed4e54f8b78fea74e URL: https://github.com/llvm/llvm-project/commit/06f04b2e27f2586d3db2204ed4e54f8b78fea74e DIFF: https://github.com/llvm/llvm-project/commit/06f04b2e27f2586d3db2204ed4e54f8b78fea74e.diff LO

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: bugprone-pointer-arithmetic-polymorphic-object or bugprone-pointer-arithmetic-on-polymorphic-object could be fine. limiting check to polymorphic objects it's fine, someone can always enable an cppguidelines check to cover all cases. Also check-alias should be added to cert. ht

[clang] 2d511cd - [clang][Interp][NFC] Add missing test diagnostic output

2024-05-13 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2024-05-13T17:44:50+02:00 New Revision: 2d511cdc10be611999d2a3c8983a992dd90f892c URL: https://github.com/llvm/llvm-project/commit/2d511cdc10be611999d2a3c8983a992dd90f892c DIFF: https://github.com/llvm/llvm-project/commit/2d511cdc10be611999d2a3c8983a992dd90f892c.diff LO

[clang] [llvm] [AMDGPU] Add amdgpu-as MMRA for fences (PR #78572)

2024-05-13 Thread Sameer Sahasrabuddhe via cfe-commits
@@ -678,6 +680,54 @@ class SIMemoryLegalizer final : public MachineFunctionPass { bool runOnMachineFunction(MachineFunction &MF) override; }; +static std::array, 3> ASNames = {{ ssahasra wrote: Use StringMap for this? https://github.com/llvm/llvm-project/

[clang] [llvm] [AMDGPU] Add amdgpu-as MMRA for fences (PR #78572)

2024-05-13 Thread Sameer Sahasrabuddhe via cfe-commits
@@ -678,6 +680,54 @@ class SIMemoryLegalizer final : public MachineFunctionPass { bool runOnMachineFunction(MachineFunction &MF) override; }; +static std::array, 3> ASNames = {{ +{"global", SIAtomicAddrSpace::GLOBAL}, +{"local", SIAtomicAddrSpace::LDS}, +{"image

[clang] [llvm] [DebugInfo] Use DW_op_bit_piece for structured bindings of bitfields (PR #85665)

2024-05-13 Thread John Brawn via cfe-commits
@@ -6178,10 +6178,16 @@ The current supported opcode vocabulary is limited: the last entry from the second last entry and appends the result to the expression stack. - ``DW_OP_plus_uconst, 93`` adds ``93`` to the working expression. -- ``DW_OP_LLVM_fragment, 16, 8`` specifi

[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)

2024-05-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/91531 From 07dc4dd5c60c8a04637cce686b379e195deb5b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Wed, 8 May 2024 20:01:57 +0200 Subject: [PATCH 1/5] [analyzer] Refactor recognition of the errno

[clang-tools-extra] [clang-tidy] Add `bugprone-virtual-arithmetic` check (PR #91951)

2024-05-13 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: I realize it's probably very hard (if not impossible) to detect whether a class is a base class unless it has virtual functions. That's why the corresponding AUTOSAR rule bans only non-final classes. But that is a bit overkill and leads to some pain. https://github.com

[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)

2024-05-13 Thread Donát Nagy via cfe-commits
@@ -136,53 +100,48 @@ void ErrnoModeling::checkBeginFunction(CheckerContext &C) const { ASTContext &ACtx = C.getASTContext(); ProgramStateRef State = C.getState(); - if (const auto *ErrnoVar = dyn_cast_or_null(ErrnoDecl)) { -// There is an external 'errno' variable.

<    1   2   3   4   5   6   >