[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-09-04 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/103917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [docs] Add a section on AI-generated content to the developer policy (PR #91014)

2024-09-04 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/91014 >From 88e4991013a05e26cece87d3989ad957a4e18e3d Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 4 Sep 2024 16:52:49 + Subject: [PATCH 1/4] [clang] Fix FIXME in dynamic initializer emission, NFCI This poten

[clang] [llvm] [docs] Add a section on AI-generated content to the developer policy (PR #91014)

2024-09-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Reid Kleckner (rnk) Changes Governments around the world are starting to require labelling for AI-generated content, and some LLVM stakeholders have asked if LLVM contains AI-generated content. Defining a policy on the use of AI t

[clang] 601645c - [clang] Fix FIXME in dynamic initializer emission, NFCI

2024-09-04 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2024-09-04T17:34:26Z New Revision: 601645c3b70e2a17d18779a3a51b8bc9ecdc9aa6 URL: https://github.com/llvm/llvm-project/commit/601645c3b70e2a17d18779a3a51b8bc9ecdc9aa6 DIFF: https://github.com/llvm/llvm-project/commit/601645c3b70e2a17d18779a3a51b8bc9ecdc9aa6.diff LOG:

[clang] [llvm] [mlir] [TableGen] Add const variants of accessors for backend (PR #106658)

2024-09-04 Thread Rahul Joshi via cfe-commits
@@ -189,7 +189,7 @@ static StringRef NormalizeGNUAttrSpelling(StringRef AttrSpelling) { typedef std::vector> ParsedAttrMap; -static ParsedAttrMap getParsedAttrList(const RecordKeeper &Records, jurahul wrote: And here's for the entire MLIR tablegen code: ht

[clang] [llvm] [mlir] [TableGen] Add const variants of accessors for backend (PR #106658)

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

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-09-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @lukel97 If you can reduce, I would appreciate it. You can also post here an unreduced pre-processed unit which compiles fine with clang before this patch. https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing lis

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-09-04 Thread Erich Keane via cfe-commits
@@ -13559,6 +13562,27 @@ QualType Sema::CheckAssignmentOperands(Expr *LHSExpr, ExprResult &RHS, QualType LHSType = LHSExpr->getType(); QualType RHSType = CompoundType.isNull() ? RHS.get()->getType() : CompoundType; + + if (RHS.

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-09-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/106321 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-09-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I did a pass, I think @Sirraide is on the right direction in his reviews here, but the general direction of this patch is also completely acceptable. https://github.com/llvm/llvm-project/pull/106321 ___ cfe-com

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-09-04 Thread Erich Keane via cfe-commits
@@ -186,4 +218,370 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // Note: This implementation relies on `CountAttributedType` being uniqu

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-09-04 Thread Erich Keane via cfe-commits
@@ -3343,6 +3363,8 @@ class CountAttributedType final static bool classof(const Type *T) { return T->getTypeClass() == CountAttributed; } + + StringRef GetAttributeName(bool WithMacroPrefix) const; erichkeane wrote: ```suggestion StringRef getAttrib

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-09-04 Thread Erich Keane via cfe-commits
@@ -186,4 +218,370 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { erichkeane wrote: I agree with Sirraide here, but would h

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

2024-09-04 Thread Erich Keane via cfe-commits
erichkeane wrote: Rather than this being "not added in the header file", should we just make this one of the attributes that is disallowed after the thing has been 'referenced'? Or is that a dumb suggestion here? https://github.com/llvm/llvm-project/pull/67520

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-09-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I've not done as in depth of a review as Corentin, but I approve of the direction here, I think the approach is correct, and most of the changes are fairly mechanical. So once Corentin is happy with the changes, so am I. https://github.com/llvm/llvm-pr

[clang] [llvm] [DLCov 2/5] Implement DebugLoc coverage tracking (PR #107279)

2024-09-04 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/107279 This is part of a series of patches that tries to improve DILocation bug detection in Debugify; see below for more details. This is the patch that adds the main feature, adding a set of `DebugLoc::get` function

[clang] [llvm] [DLCov 2/5] Implement DebugLoc coverage tracking (PR #107279)

2024-09-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Stephen Tozer (SLTozer) Changes This is part of a series of patches that tries to improve DILocation bug detection in Debugify; see below for more details. This is the patch that adds the main feature, adding a set of `DebugLoc::g

[clang] [llvm] [DLCov 2/5] Implement DebugLoc coverage tracking (PR #107279)

2024-09-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Stephen Tozer (SLTozer) Changes This is part of a series of patches that tries to improve DILocation bug detection in Debugify; see below for more details. This is the patch that adds the main feature, adding a set of `DebugLoc::get

[clang] Delay sanitizer args parsing. (PR #107280)

2024-09-04 Thread Evgenii Stepanov via cfe-commits
https://github.com/eugenis created https://github.com/llvm/llvm-project/pull/107280 Delay sanitizer arg parsing until after -Xclang flags are forwarded to the clang command line. This allows the check in hasTargetFeaturMTE to pick up manually specified target feature, and enables the following

[clang] Delay sanitizer args parsing. (PR #107280)

2024-09-04 Thread Evgenii Stepanov via cfe-commits
https://github.com/eugenis edited https://github.com/llvm/llvm-project/pull/107280 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Delay sanitizer args parsing. (PR #107280)

2024-09-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Evgenii Stepanov (eugenis) Changes Delay sanitizer arg parsing until after -Xclang flags are forwarded to the clang command line. This allows the check in hasTargetFeatureMTE to pick up manually specified target feature, and enables the f

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -4932,6 +4938,78 @@ class FunctionEffectsRef { void dump(llvm::raw_ostream &OS) const; }; +/// A mutable set of FunctionEffect::Kind. +class FunctionEffectKindSet { + // For now this only needs to be a bitmap. + constexpr static size_t EndBitPos = 8; + using KindBitsT

[clang] Delay sanitizer args parsing. (PR #107280)

2024-09-04 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. https://github.com/llvm/llvm-project/pull/107280 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -10950,6 +10950,51 @@ def warn_imp_cast_drops_unaligned : Warning< InGroup>; // Function effects +def warn_func_effect_violation : Warning< + "'%0' %select{function|constructor|destructor|lambda|block|constructor's member initializer}1 " dougsonos wrote

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -15099,6 +15037,106 @@ class Sema final : public SemaBase { std::string getFixItZeroLiteralForType(QualType T, SourceLocation Loc) const; ///@} + + // dougsonos wrote: It's copied from the other groupings which separate methods (etc) which are isolat

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-09-04 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/102040 >From dc565488caf29366c3dc7257725a0b46fd00f11d Mon Sep 17 00:00:00 2001 From: higher-performance Date: Mon, 5 Aug 2024 15:04:19 -0400 Subject: [PATCH] Add Clang attribute to ensure that fields are ini

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Erich Keane via cfe-commits
@@ -10950,6 +10950,51 @@ def warn_imp_cast_drops_unaligned : Warning< InGroup>; // Function effects +def warn_func_effect_violation : Warning< + "'%0' %select{function|constructor|destructor|lambda|block|constructor's member initializer}1 " erichkeane wrot

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-09-04 Thread via cfe-commits
@@ -1419,6 +1419,28 @@ is not specified. }]; } +def ExplicitInitDocs : Documentation { + let Category = DocCatField; + let Content = [{ +The ``clang::explicit_init`` attribute indicates that the field must be +initialized explicitly by the caller when the class is construc

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Erich Keane via cfe-commits
@@ -15099,6 +15037,106 @@ class Sema final : public SemaBase { std::string getFixItZeroLiteralForType(QualType T, SourceLocation Loc) const; ///@} + + // erichkeane wrote: @endilll ? https://github.com/llvm/llvm-project/pull/99656 __

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Erich Keane via cfe-commits
@@ -4932,6 +4938,78 @@ class FunctionEffectsRef { void dump(llvm::raw_ostream &OS) const; }; +/// A mutable set of FunctionEffect::Kind. +class FunctionEffectKindSet { + // For now this only needs to be a bitmap. + constexpr static size_t EndBitPos = 8; + using KindBitsT

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -5137,47 +5137,41 @@ StringRef FunctionEffect::name() const { llvm_unreachable("unknown effect kind"); } -bool FunctionEffect::canInferOnFunction(const Decl &Callee) const { +std::optional FunctionEffect::effectProhibitingInference( +const Decl &Callee, const Function

[clang] Adjust modulemap to mark mm3dnow as textual header. (PR #107155)

2024-09-04 Thread James Y Knight via cfe-commits
jyknight wrote: If we don't keep the include-guard, then we'll report the same warning once per `#include`, instead of once per TU, which is probably not ideal. https://github.com/llvm/llvm-project/pull/107155 ___ cfe-commits mailing list cfe-commits@

[clang] Adjust modulemap to mark mm3dnow as textual header. (PR #107155)

2024-09-04 Thread Ian Anderson via cfe-commits
ian-twilightcoder wrote: That's true. Probably nobody's using this header anymore anyway so either way should be fine I think. https://github.com/llvm/llvm-project/pull/107155 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [llvm] Introduce -defer-thinlto-prelink-coro-split that skips Coro passes in ThinLTO pre-link pipeline (PR #107153)

2024-09-04 Thread Wei Wang via cfe-commits
apolloww wrote: > I don't know much about the Coro handling, but this not only makes it > conditional but changes the default - what should the default behavior be? Default behavior: Coro passes were always run in pre-link pipeline. Since all the coro intrinsics are lowered, the output bitcode

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -8392,6 +8397,20 @@ void ASTReader::InitializeSema(Sema &S) { NewOverrides.applyOverrides(SemaObj->getLangOpts()); } + if (!DeclsWithEffectsToVerify.empty()) { +for (GlobalDeclID ID : DeclsWithEffectsToVerify) { + Decl *D = GetDecl(ID); + FunctionEf

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -10950,6 +10950,51 @@ def warn_imp_cast_drops_unaligned : Warning< InGroup>; // Function effects +def warn_func_effect_violation : Warning< + "'%0' %select{function|constructor|destructor|lambda|block|constructor's member initializer}1 " dougsonos wrote

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/99656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Erich Keane via cfe-commits
@@ -10950,6 +10950,51 @@ def warn_imp_cast_drops_unaligned : Warning< InGroup>; // Function effects +def warn_func_effect_violation : Warning< + "'%0' %select{function|constructor|destructor|lambda|block|constructor's member initializer}1 " erichkeane wrot

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Erich Keane via cfe-commits
@@ -8392,6 +8397,20 @@ void ASTReader::InitializeSema(Sema &S) { NewOverrides.applyOverrides(SemaObj->getLangOpts()); } + if (!DeclsWithEffectsToVerify.empty()) { +for (GlobalDeclID ID : DeclsWithEffectsToVerify) { + Decl *D = GetDecl(ID); + FunctionEf

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -0,0 +1,1566 @@ +//=== SemaFunctionEffects.cpp - Sema handling of function effects -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -0,0 +1,1566 @@ +//=== SemaFunctionEffects.cpp - Sema handling of function effects -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [llvm] [mlir] [TableGen] Add const variants of accessors for backend (PR #106658)

2024-09-04 Thread Rahul Joshi via cfe-commits
@@ -189,7 +189,7 @@ static StringRef NormalizeGNUAttrSpelling(StringRef AttrSpelling) { typedef std::vector> ParsedAttrMap; -static ParsedAttrMap getParsedAttrList(const RecordKeeper &Records, jurahul wrote: And for all clang-tablegen its here: https://git

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -0,0 +1,1566 @@ +//=== SemaFunctionEffects.cpp - Sema handling of function effects -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [HLSL] Adjust resource binding diagnostic flags code (PR #106657)

2024-09-04 Thread Helena Kotas via cfe-commits
hekota wrote: Thank you @kazutakahirata! I will remove the code; the consistency check is repeated later in a called function. https://github.com/llvm/llvm-project/pull/106657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -0,0 +1,1566 @@ +//=== SemaFunctionEffects.cpp - Sema handling of function effects -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [llvm] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

2024-09-04 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/104544 >From 6d5f8991a4ef9e79bc1bed30addf7b29b7ed0d2e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 15 Aug 2024 19:03:29 -0700 Subject: [PATCH 01/16] Implement `__builtin_is_intangible` --- clang/include/clan

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -8392,6 +8397,20 @@ void ASTReader::InitializeSema(Sema &S) { NewOverrides.applyOverrides(SemaObj->getLangOpts()); } + if (!DeclsWithEffectsToVerify.empty()) { +for (GlobalDeclID ID : DeclsWithEffectsToVerify) { + Decl *D = GetDecl(ID); + FunctionEf

[clang] [clang] Fix FnInfoOpts::operator&= and FnInfoOpts::operator|= not updating assigned operands (PR #107050)

2024-09-04 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 8e5b43c8effc0a01745bb7c53ca21fb6c8384c51 c62066b1cca052b6258ce1e44788cf1f9a35bb01 --e

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
https://github.com/joaosaffran created https://github.com/llvm/llvm-project/pull/107292 None >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH] Adding `asuint` implementation to hlsl --- clang/incl

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [HLSL] Apply resource attributes to the resource type rather than the handle member (PR #107160)

2024-09-04 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/107160 >From 337a9ed1d5e7c71fb5be5741afe7726f5b76af7b Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Tue, 3 Sep 2024 15:30:50 -0700 Subject: [PATCH 1/4] [HLSL] Apply resource attributes to the resource type rather t

[clang] [llvm] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

2024-09-04 Thread Helena Kotas via cfe-commits
@@ -5695,6 +5696,15 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, return true; return false; } + case UTT_IsIntangibleType: +assert(Self.getLangOpts().HLSL && "intangible types are HLSL-only feature"); +if (!T->isVoidType() && !T->isI

[clang] [llvm] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

2024-09-04 Thread Helena Kotas via cfe-commits
@@ -249,4 +249,8 @@ FIELD(HasDeclaredCopyAssignmentWithConstParam, 1, MERGE_OR) /// base classes or fields have a no-return destructor FIELD(IsAnyDestructorNoReturn, 1, NO_MERGE) +/// Whether the record type is intangible (if any base classes or fields have +/// type that is i

[clang] [HLSL] Apply resource attributes to the resource type rather than the handle member (PR #107160)

2024-09-04 Thread Helena Kotas via cfe-commits
@@ -77,6 +77,23 @@ class SemaHLSL : public SemaBase { ExprResult ActOnOutParamExpr(ParmVarDecl *Param, Expr *Arg); QualType getInoutParameterType(QualType Ty); + + // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no + // longer need to create bui

[clang] [llvm] [docs] Add a section on AI-generated content to the developer policy (PR #91014)

2024-09-04 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/91014 >From 88e4991013a05e26cece87d3989ad957a4e18e3d Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 4 Sep 2024 16:52:49 + Subject: [PATCH 1/4] [clang] Fix FIXME in dynamic initializer emission, NFCI This poten

[clang] [HLSL] Apply resource attributes to the resource type rather than the handle member (PR #107160)

2024-09-04 Thread Helena Kotas via cfe-commits
@@ -1,32 +1,32 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s | FileCheck %s - -// CHECK: -HLSLResourceClassAttr 0x{{[0-9a-f]+}} SRV -struct Eg1 { - [[hlsl::resource_class(SRV)]] int i; +// CHECK: CXXRecordDecl 0x{{[0-9a-f]+}} {{.*}}

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Erich Keane via cfe-commits
@@ -0,0 +1,1566 @@ +//=== SemaFunctionEffects.cpp - Sema handling of function effects -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [llvm] [AMDGPU] Add target intrinsic for s_buffer_prefetch_data (PR #107293)

2024-09-04 Thread Stanislav Mekhanoshin via cfe-commits
https://github.com/rampitec created https://github.com/llvm/llvm-project/pull/107293 None >From 8361742ca5fe20a3168b3274166909412e225184 Mon Sep 17 00:00:00 2001 From: Stanislav Mekhanoshin Date: Wed, 4 Sep 2024 12:00:27 -0700 Subject: [PATCH] [AMDGPU] Add target intrinsic for s_buffer_prefetc

[clang] [llvm] [AMDGPU] Add target intrinsic for s_buffer_prefetch_data (PR #107293)

2024-09-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Stanislav Mekhanoshin (rampitec) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/107293.diff 16 Files Affected: - (modified) clang/include/clang/Basic/BuiltinsAMDGPU.def (+1) - (modified) clang/test/CodeGenOp

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Erich Keane via cfe-commits
@@ -0,0 +1,1566 @@ +//=== SemaFunctionEffects.cpp - Sema handling of function effects -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [analyzer] Prevent crash due to missing EventDispatch in corner case (PR #107294)

2024-09-04 Thread via cfe-commits
https://github.com/vabridgers created https://github.com/llvm/llvm-project/pull/107294 Random testing revealed it's possible to crash the analyzer through a rare command line invocation: clang -cc1 -analyze -analyzer-checker=nullability empty.c where the source file, empty.c is an empty sourc

[clang] [analyzer] Prevent crash due to missing EventDispatch in corner case (PR #107294)

2024-09-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (vabridgers) Changes Random testing revealed it's possible to crash the analyzer through a rare command line invocation: clang -cc1 -analyze -analyzer-checker=nullability empty.c where the source file, empty.c is an empty source fil

[clang] Delay sanitizer args parsing. (PR #107280)

2024-09-04 Thread Florian Mayer via cfe-commits
fmayer wrote: super-nit: add `[sanitizers]` and remove `.` from commit message? https://github.com/llvm/llvm-project/pull/107280 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Apply resource attributes to the resource type rather than the handle member (PR #107160)

2024-09-04 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/107160 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Vlad Serebrennikov via cfe-commits
@@ -15099,6 +15037,106 @@ class Sema final : public SemaBase { std::string getFixItZeroLiteralForType(QualType T, SourceLocation Loc) const; ///@} + + // Endilll wrote: Yes, this is consistent with the rest of Sema.h https://github.com/llvm/llvm-project

[clang] [llvm] [Utils] add --update-tests flag to llvm-lit (PR #97369)

2024-09-04 Thread Henrik G. Olsson via cfe-commits
https://github.com/hnrklssn edited https://github.com/llvm/llvm-project/pull/97369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-04 Thread via cfe-commits
@@ -7981,7 +7969,7 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base, SmallVector OperatorArrows; CTypes.insert(Context.getCanonicalType(BaseType)); -while (BaseType->isRecordType()) { +while (BaseType->getAsRecordDecl()) {

[clang] [llvm] [Utils] add --update-tests flag to llvm-lit (PR #97369)

2024-09-04 Thread Henrik G. Olsson via cfe-commits
hnrklssn wrote: Added tests and updated the script. Instead of only being a free-standing script it's now (along with the UTC scripts) integrated into llvm-lit to automatically detect which script can update a failing test, using the new flag `--update-tests`. https://github.com/llvm/llvm-pro

[clang] 0fffdeb - [-Wunsafe-buffer-usage] Warning Libc functions (#101583)

2024-09-04 Thread via cfe-commits
Author: Ziqing Luo Date: 2024-09-04T12:34:43-07:00 New Revision: 0fffdeb5f46078ddcc61e112cd38856b1165f050 URL: https://github.com/llvm/llvm-project/commit/0fffdeb5f46078ddcc61e112cd38856b1165f050 DIFF: https://github.com/llvm/llvm-project/commit/0fffdeb5f46078ddcc61e112cd38856b1165f050.diff LO

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-09-04 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 closed https://github.com/llvm/llvm-project/pull/101583 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] f574b9c - [PS4,PS5][Driver] Check for absent SDK when -nostdlib/-nodefaultlibs (#107112)

2024-09-04 Thread via cfe-commits
Author: Edd Dawson Date: 2024-09-04T20:36:24+01:00 New Revision: f574b9c9297538a8d471658564619be3ad6e87dd URL: https://github.com/llvm/llvm-project/commit/f574b9c9297538a8d471658564619be3ad6e87dd DIFF: https://github.com/llvm/llvm-project/commit/f574b9c9297538a8d471658564619be3ad6e87dd.diff LO

[clang] [PS4,PS5][Driver] Check for absent SDK when -nostdlib/-nodefaultlibs (PR #107112)

2024-09-04 Thread Edd Dawson via cfe-commits
https://github.com/playstation-edd closed https://github.com/llvm/llvm-project/pull/107112 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Apply resource attributes to the resource type rather than the handle member (PR #107160)

2024-09-04 Thread Justin Bogner via cfe-commits
@@ -2062,6 +2066,7 @@ void TypePrinter::printBTFTagAttributedAfter(const BTFTagAttributedType *T, void TypePrinter::printHLSLAttributedResourceBefore( const HLSLAttributedResourceType *T, raw_ostream &OS) { printBefore(T->getWrappedType(), OS); + printAfter(T->getWrappe

[clang] [HLSL] Apply resource attributes to the resource type rather than the handle member (PR #107160)

2024-09-04 Thread Justin Bogner via cfe-commits
@@ -12364,6 +12364,7 @@ def err_hlsl_packoffset_cross_reg_boundary : Error<"packoffset cannot cross regi def err_hlsl_packoffset_alignment_mismatch : Error<"packoffset at 'y' not match alignment %0 required by %1">; def err_hlsl_pointers_unsupported : Error< "%select{pointe

[clang] [HLSL] Apply resource attributes to the resource type rather than the handle member (PR #107160)

2024-09-04 Thread Justin Bogner via cfe-commits
@@ -556,46 +562,120 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } -void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { - if (!AL.isArgIdent(0)) { -Diag(AL.getLoc(), diag::err_attribute_argument_type) -

[clang] [HLSL] Apply resource attributes to the resource type rather than the handle member (PR #107160)

2024-09-04 Thread Justin Bogner via cfe-commits
@@ -556,46 +562,120 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } -void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { - if (!AL.isArgIdent(0)) { -Diag(AL.getLoc(), diag::err_attribute_argument_type) -

[clang] [HLSL] Apply resource attributes to the resource type rather than the handle member (PR #107160)

2024-09-04 Thread Justin Bogner via cfe-commits
@@ -556,46 +562,120 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } -void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { - if (!AL.isArgIdent(0)) { -Diag(AL.getLoc(), diag::err_attribute_argument_type) -

[clang] [HLSL] Apply resource attributes to the resource type rather than the handle member (PR #107160)

2024-09-04 Thread Justin Bogner via cfe-commits
@@ -556,46 +562,120 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } -void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { - if (!AL.isArgIdent(0)) { -Diag(AL.getLoc(), diag::err_attribute_argument_type) -

[clang] [HLSL] Apply resource attributes to the resource type rather than the handle member (PR #107160)

2024-09-04 Thread Justin Bogner via cfe-commits
@@ -556,46 +562,120 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } -void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { - if (!AL.isArgIdent(0)) { -Diag(AL.getLoc(), diag::err_attribute_argument_type) -

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-04 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/107213 >From 650054c3fa9a640b9cd255f98c46dbfbd0b8c590 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 28 Aug 2024 09:59:41 +0200 Subject: [PATCH 1/2] [clang] Diagnose dangling issues for "Container" case. We teac

[clang] [HLSL] Remove variables that are used only in assert (PR #107299)

2024-09-04 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/107299 Changes the assert to test the same condition without using the variables. This change is done in response to a comment [here](https://github.com/llvm/llvm-project/pull/106657#issuecomment-2327493439). >From

[clang] [HLSL] Remove variables that are used only in assert (PR #107299)

2024-09-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Helena Kotas (hekota) Changes Changes the assert to test the same condition without using the variables. This change is done in response to a comment [here](https://github.com/llvm/llvm-project/pull/106657#issuecomment-2327493439). ---

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-04 Thread Haojian Wu via cfe-commits
@@ -470,10 +474,24 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, VisitGSLPointerArg(Callee, Args[0], !Callee->getReturnType()->isReferenceType()); } else { -if (auto *CCE = dyn_cast(Call); -

[clang] [HLSL] Remove variables that are used only in assert (PR #107299)

2024-09-04 Thread Damyan Pepper via cfe-commits
@@ -834,17 +834,10 @@ static void ValidateMultipleRegisterAnnotations(Sema &S, Decl *TheDecl, static void DiagnoseHLSLRegisterAttribute(Sema &S, SourceLocation &ArgLoc, Decl *TheDecl, RegisterType regType) { - // Samplers, UAVs, and

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-04 Thread Haojian Wu via cfe-commits
@@ -363,10 +363,14 @@ static bool implicitObjectParamIsLifetimeBound(const FunctionDecl *FD) { if (ATL.getAttrAs()) return true; } - return isNormalAsisgnmentOperator(FD); } +bool isFirstTemplateArgumentGSLPointer(const TemplateArgumentList &TAs) { + return

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-04 Thread Haojian Wu via cfe-commits
@@ -470,10 +474,24 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, VisitGSLPointerArg(Callee, Args[0], !Callee->getReturnType()->isReferenceType()); } else { -if (auto *CCE = dyn_cast(Call); -

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-04 Thread Haojian Wu via cfe-commits
@@ -499,3 +518,28 @@ std::string_view test2(int i, std::optional a) { return std::move(a.value()); } } + +namespace GH100526 { +void test() { + std::vector t1 = {std::string()}; // expected-warning {{object backing the pointer will be destroyed at the end}} ---

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-04 Thread Haojian Wu via cfe-commits
hokein wrote: > Since this is not limited to a hardcoded set of types/stl-containers, this is > a substantial change in the behaviour of general Owner types and > warrants extra documentation both in GSL analysis docs and ReleaseNotes. Done. https://github.com/llvm/llvm-project/pull/107213 _

[clang] [Parser][NFC] Move the core parsing of an attribute into a separate method (PR #107300)

2024-09-04 Thread Bill Wendling via cfe-commits
https://github.com/bwendling created https://github.com/llvm/llvm-project/pull/107300 Refactor attribute parsing so that the main code parsing an attribute can be called by a separate code path that doesn't start with the '__attribute' keyword. >From c30c6c11686cc95ba20eb7000d210b17757fbfe3 M

[clang] [Parser][NFC] Move the core parsing of an attribute into a separate method (PR #107300)

2024-09-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Bill Wendling (bwendling) Changes Refactor attribute parsing so that the main code parsing an attribute can be called by a separate code path that doesn't start with the '__attribute' keyword. --- Full diff: https://github.com/llvm/llvm-

[clang] [clang-tools-extra] [NFC] Add explicit #include llvm-config.h where its macros are used, clang part. (PR #107301)

2024-09-04 Thread Daniil Fukalov via cfe-commits
https://github.com/dfukalov created https://github.com/llvm/llvm-project/pull/107301 (this is clang related part) Without these explicit includes, removing other headers, who implicitly include llvm-config.h, may have non-trivial side effects. For example, `clagd` may report even `llvm-config

[clang] [Parser][NFC] Move the core parsing of an attribute into a separate method (PR #107300)

2024-09-04 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 34f2c9a9ce73a61b27d75dab7e1eed256491afcc c30c6c11686cc95ba20eb7000d210b17757fbfe3 --e

[clang] Adding `asuint` implementation to hlsl (PR #107292)

2024-09-04 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/107292 >From f1ca0a6070aa34bcce92d76df3a2e897d44e5f9c Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Tue, 3 Sep 2024 19:06:22 + Subject: [PATCH 1/2] Adding `asuint` implementation to hlsl --- clang/includ

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-04 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/107213 >From 0d9a5971121bf66608625de3514db346876d9091 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 28 Aug 2024 09:59:41 +0200 Subject: [PATCH 1/2] [clang] Diagnose dangling issues for "Container" case. We teac

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Doug Wyatt via cfe-commits
@@ -0,0 +1,1566 @@ +//=== SemaFunctionEffects.cpp - Sema handling of function effects -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [HLSL] Remove variables that are used only in assert (PR #107299)

2024-09-04 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/107299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose dangling issues for the "Container" case. (PR #107213)

2024-09-04 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 d21e731c42d6b967e29dbe2edc16c1b86885df0d fe0ca71b1d5cc3ff696e374b5b5bd03f748944aa --e

[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)

2024-09-04 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt updated https://github.com/llvm/llvm-project/pull/86618 >From 06250aa308d1662848726528bd31395fb2ad3ea0 Mon Sep 17 00:00:00 2001 From: Justin Stitt Date: Tue, 5 Mar 2024 03:14:49 + Subject: [PATCH] implement wraps attribute Signed-off-by: Justin Stitt --- cl

[clang] [clang] Check inline defs when emitting speculative vtable (PR #100785)

2024-09-04 Thread Fabian Parzefall via cfe-commits
FPar wrote: @efriedma-quic Thank you for being patient. I do not have write permissions, can you please merge this for me? https://github.com/llvm/llvm-project/pull/100785 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [Parser][NFC] Move the core parsing of an attribute into a separate method (PR #107300)

2024-09-04 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/107300 >From c30c6c11686cc95ba20eb7000d210b17757fbfe3 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 4 Sep 2024 12:49:04 -0700 Subject: [PATCH 1/2] [Parser][NFC] Move the core parsing of an attribute into a

<    1   2   3   4   >