[clang] [Clang] Explain why a type trait evaluated to false. (PR #141238)

2025-05-23 Thread Erich Keane via cfe-commits
@@ -1917,3 +1917,190 @@ ExprResult Sema::BuildExpressionTrait(ExpressionTrait ET, SourceLocation KWLoc, return new (Context) ExpressionTraitExpr(KWLoc, ET, Queried, Value, RParen, Context.BoolTy); } + +static std::optional StdNameToTypeTrait(StringRef Name) { + return

[clang] [Clang] Explain why a type trait evaluated to false. (PR #141238)

2025-05-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/141238 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Explain why a type trait evaluated to false. (PR #141238)

2025-05-23 Thread Erich Keane via cfe-commits
@@ -1917,3 +1917,190 @@ ExprResult Sema::BuildExpressionTrait(ExpressionTrait ET, SourceLocation KWLoc, return new (Context) ExpressionTraitExpr(KWLoc, ET, Queried, Value, RParen, Context.BoolTy); } + +static std::optional StdNameToTypeTrait(StringRef Name) { + return

[clang] [Clang] Explain why a type trait evaluated to false. (PR #141238)

2025-05-23 Thread Erich Keane via cfe-commits
@@ -1917,3 +1917,190 @@ ExprResult Sema::BuildExpressionTrait(ExpressionTrait ET, SourceLocation KWLoc, return new (Context) ExpressionTraitExpr(KWLoc, ET, Queried, Value, RParen, Context.BoolTy); } + +static std::optional StdNameToTypeTrait(StringRef Name) { + return

[clang] [Clang][NFC] Move the type trait logic to a separate file. (PR #141245)

2025-05-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Just a copy&paste refactor that makes a lot of sense. Thanks! https://github.com/llvm/llvm-project/pull/141245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [Clang] Explain why a type trait evaluated to false. (PR #141238)

2025-05-23 Thread Erich Keane via cfe-commits
@@ -0,0 +1,539 @@ +//===- SemaTypeTraits.cpp - Semantic Analysis for C++ Type Traits -===// +// +// 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] Explain why a type trait evaluated to false. (PR #141238)

2025-05-23 Thread Erich Keane via cfe-commits
@@ -5590,69 +5590,8 @@ static bool isTriviallyEqualityComparableType(Sema &S, QualType Type, SourceLoca CanonicalType, /*CheckIfTriviallyCopyable=*/false); } -static bool IsCXXTriviallyRelocatableType(Sema &S, const CXXRecordDecl *RD) { - if (std::optional Info = -

[clang] [Clang] Explain why a type trait evaluated to false. (PR #141238)

2025-05-23 Thread Erich Keane via cfe-commits
@@ -0,0 +1,539 @@ +//===- SemaTypeTraits.cpp - Semantic Analysis for C++ Type Traits -===// +// +// 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] Explain why a type trait evaluated to false. (PR #141238)

2025-05-23 Thread Erich Keane via cfe-commits
@@ -1762,6 +1762,29 @@ def err_user_defined_msg_constexpr : Error< "%sub{subst_user_defined_msg}0 must be produced by a " "constant expression">; +// Type traits explanations +def note_unsatisfied_trait : Note<"%0 is not %enum_select{" + "%

[clang] [OpenACC][CIR] Add lowering for 'copy' array indexes (PR #140971)

2025-05-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/140971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC][CIR] Add lowering for 'copy' array indexes (PR #140971)

2025-05-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/140971 >From ec6359330368ed72d6e4354afdcf6d0a32f9a2f9 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Tue, 20 May 2025 08:55:39 -0700 Subject: [PATCH 1/2] [OpenACC][CIR] Add lowering for 'copy' array indexes The ar

[clang] [CIR] Add alignment support for global, store, and load ops (PR #141163)

2025-05-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Seems reasonable https://github.com/llvm/llvm-project/pull/141163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Erich Keane via cfe-commits
@@ -3028,6 +3043,19 @@ class CallExpr : public Expr { bool hasStoredFPFeatures() const { return CallExprBits.HasFPFeatures; } + bool usesMemberSyntax() const { +return CallExprBits.ExplicitObjectMemFunUsingMemberSyntax; + } + void setUsesMemberSyntax(bool V = true) {

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Erich Keane via cfe-commits
@@ -3187,9 +3215,48 @@ class CallExpr : public Expr { SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getEndLoc() const LLVM_READONLY; +

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Erich Keane via cfe-commits
@@ -1510,41 +1519,41 @@ CallExpr *CallExpr::Create(const ASTContext &Ctx, Expr *Fn, unsigned NumArgs = std::max(Args.size(), MinNumArgs); unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects( /*NumPreArgs=*/0, NumArgs, FPFeatures.requiresTrailingStorage()

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Erich Keane via cfe-commits
@@ -1510,41 +1519,41 @@ CallExpr *CallExpr::Create(const ASTContext &Ctx, Expr *Fn, unsigned NumArgs = std::max(Args.size(), MinNumArgs); unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects( /*NumPreArgs=*/0, NumArgs, FPFeatures.requiresTrailingStorage()

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Erich Keane via cfe-commits
@@ -3028,6 +3043,19 @@ class CallExpr : public Expr { bool hasStoredFPFeatures() const { return CallExprBits.HasFPFeatures; } + bool usesMemberSyntax() const { +return CallExprBits.ExplicitObjectMemFunUsingMemberSyntax; + } + void setUsesMemberSyntax(bool V = true) {

[clang] [Clang] Optimize some `getBeginLoc` implementations (PR #141058)

2025-05-22 Thread Erich Keane via cfe-commits
@@ -3187,9 +3215,48 @@ class CallExpr : public Expr { SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getEndLoc() const LLVM_READONLY; +

[clang] [CIR] Simplify error emission to return failures directly (PR #141032)

2025-05-22 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/141032 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement `AnyScalarType` constraint (PR #141033)

2025-05-22 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/141033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC][CIR] Add lowering for 'copy' array indexes (PR #140971)

2025-05-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/140971 The array indexes(and sections) are represented by the acc.bounds operation, which this ensures we fill in properly. The lowerbound is required, so we always get that. The upperbound or extent is required.

[clang] [C] Fix crash-on-invalid due to infinite recursion (PR #140925)

2025-05-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][TableGen] Fix Duplicate Entries in TableGen (PR #140828)

2025-05-21 Thread Erich Keane via cfe-commits
@@ -3727,12 +3734,26 @@ static void GenerateHasAttrSpellingStringSwitch( } } -std::string TestStr = !Test.empty() - ? Test + " ? " + itostr(Version) + " : 0" - : itostr(Version); -if (Scope.empty() ||

[clang] [clang][TableGen] Fix Duplicate Entries in TableGen (PR #140828)

2025-05-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C2y] Add stdcountof.h (PR #140890)

2025-05-21 Thread Erich Keane via cfe-commits
@@ -260,6 +260,7 @@ static bool isBuiltinHeaderName(StringRef FileName) { .Case("stdarg.h", true) .Case("stdatomic.h", true) .Case("stdbool.h", true) + .Case("stdcountof.h", true) erichkeane wrote: These too! https:/

[clang] [C2y] Add stdcountof.h (PR #140890)

2025-05-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/140890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C2y] Add stdcountof.h (PR #140890)

2025-05-21 Thread Erich Keane via cfe-commits
@@ -252,8 +252,8 @@ static bool warnByDefaultOnWrongCase(StringRef Include) { .Cases("assert.h", "complex.h", "ctype.h", "errno.h", "fenv.h", true) erichkeane wrote: The fact that these aren't tablegened somewhere is frightening! https://github.com/llvm/llv

[clang] [C2y] Add stdcountof.h (PR #140890)

2025-05-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I still have no problem with this, but it is now into things I have zero confidence reviewing :) Please have someone who has ever used modules review this. https://github.com/llvm/llvm-project/pull/140890 __

[clang] [Clang] add typo correction for unknown attribute names (PR #140629)

2025-05-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Thought I'd already +1ed! with teh copyright headers, this LGTM. https://github.com/llvm/llvm-project/pull/140629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [C2y] Add stdcountof.h (PR #140890)

2025-05-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for recursive record layouts (PR #140811)

2025-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Want someone else to poke at it, but nothing from my end. https://github.com/llvm/llvm-project/pull/140811 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [CIR] Upstream support for string literals (PR #140796)

2025-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: still ok, 1 nit. https://github.com/llvm/llvm-project/pull/140796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for string literals (PR #140796)

2025-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/140796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for string literals (PR #140796)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -26,6 +26,34 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { CIRGenBuilderTy(mlir::MLIRContext &mlirContext, const CIRGenTypeCache &tc) : CIRBaseBuilderTy(mlirContext), typeCache(tc) {} + /// Get a cir::ConstArrayAttr for a string literal. + /// Note: Th

[clang] [CIR] Upstream support for string literals (PR #140796)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -26,6 +26,34 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { CIRGenBuilderTy(mlir::MLIRContext &mlirContext, const CIRGenTypeCache &tc) : CIRBaseBuilderTy(mlirContext), typeCache(tc) {} + /// Get a cir::ConstArrayAttr for a string literal. + /// Note: Th

[clang] [CIR] Upstream support for string literals (PR #140796)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -26,6 +26,34 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { CIRGenBuilderTy(mlir::MLIRContext &mlirContext, const CIRGenTypeCache &tc) : CIRBaseBuilderTy(mlirContext), typeCache(tc) {} + /// Get a cir::ConstArrayAttr for a string literal. + /// Note: Th

[clang] [CIR] Upstream support for string literals (PR #140796)

2025-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -5406,6 +5408,101 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, RParenLoc, CurFPFeatureOverrides()); } +ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) { + auto Loc = TheCall->getBeginLoc(); + auto Args = Mutab

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -5406,6 +5408,103 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, RParenLoc, CurFPFeatureOverrides()); } +ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) { + SourceLocation Loc = TheCall->getBeginLoc(); + auto Ar

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/116709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I'm happy as-is. Please give Aaron a chance to poke if he wants to. https://github.com/llvm/llvm-project/pull/116709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -5406,6 +5408,101 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, RParenLoc, CurFPFeatureOverrides()); } +ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) { + auto Loc = TheCall->getBeginLoc(); + auto Args = Mutab

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -5406,6 +5408,103 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, RParenLoc, CurFPFeatureOverrides()); } +ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) { + SourceLocation Loc = TheCall->getBeginLoc(); + auto Ar

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -5406,6 +5408,103 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, RParenLoc, CurFPFeatureOverrides()); } +ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) { + SourceLocation Loc = TheCall->getBeginLoc(); + auto Ar

[clang] [C] Don't diagnose null pointer macros in -Wimplicit-void-ptr-cast (PR #140724)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -9966,8 +9966,13 @@ AssignConvertType Sema::CheckSingleAssignmentConstraints(QualType LHSType, // If there is a conversion of some kind, check to see what kind of // pointer conversion happened so we can diagnose a C++ compatibility // diagnostic if the co

[clang] [C] Don't diagnose null pointer macros in -Wimplicit-void-ptr-cast (PR #140724)

2025-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -5406,6 +5408,101 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, RParenLoc, CurFPFeatureOverrides()); } +ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) { + auto Loc = TheCall->getBeginLoc(); + auto Args = Mutab

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -1611,29 +1611,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, Tok.isOneOf( #define TRANSFORM_TYPE_TRAIT_DEF(_, Trait) tok::kw___##Trait, #include "clang/Basic/TransformTypeTraits.def" - tok::kw___is_abstract, - tok::kw___is_aggregat

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -5406,6 +5408,101 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, RParenLoc, CurFPFeatureOverrides()); } +ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) { + auto Loc = TheCall->getBeginLoc(); + auto Args = Mutab

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -5406,6 +5408,101 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, RParenLoc, CurFPFeatureOverrides()); } +ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) { + auto Loc = TheCall->getBeginLoc(); + auto Args = Mutab

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -5406,6 +5408,101 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, RParenLoc, CurFPFeatureOverrides()); } +ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) { + auto Loc = TheCall->getBeginLoc(); eri

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Couple of nits, else I'm reasonably ok with this. Interested to hear what @AaronBallman has to say, else I think this is beneficial. https://github.com/llvm/llvm-project/pull/116709 ___ cfe-commits mailing lis

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/116709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C] Don't diagnose null pointer macros in -Wimplicit-void-ptr-cast (PR #140724)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -9966,8 +9966,13 @@ AssignConvertType Sema::CheckSingleAssignmentConstraints(QualType LHSType, // If there is a conversion of some kind, check to see what kind of // pointer conversion happened so we can diagnose a C++ compatibility // diagnostic if the co

[clang] [C] Don't diagnose null pointer macros in -Wimplicit-void-ptr-cast (PR #140724)

2025-05-20 Thread Erich Keane via cfe-commits
@@ -9966,8 +9966,13 @@ AssignConvertType Sema::CheckSingleAssignmentConstraints(QualType LHSType, // If there is a conversion of some kind, check to see what kind of // pointer conversion happened so we can diagnose a C++ compatibility // diagnostic if the co

[clang] [C] Do not diagnose unions with -Wdefault-const-init (PR #140725)

2025-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140725 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for iterator-based range for loops (PR #140636)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I don't see anything of concern, lgtm! https://github.com/llvm/llvm-project/pull/140636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [NFC][OpenACC] Refactor clause emission- (PR #140586)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/140586 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR][NFC] Eliminate ArgInfo structure (PR #140612)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Diagnose exceptions only in non-dependent context in discarded `try/catch/throw` blocks (PR #139859)

2025-05-19 Thread Erich Keane via cfe-commits
erichkeane wrote: So @Rajveer100 : I think I bottomed out with Aaron. I think the solution of 'create a function to diagnose these, but only if not in a dependent `DeclContext`', then call this both from where we do the current checking, plus during `TreeTransform` of these things is the 'rig

[clang] [clang-tools-extra] [clang-include-cleaner] Make cleanup attr report expr location (PR #140233)

2025-05-19 Thread Erich Keane via cfe-commits
@@ -1351,7 +1352,8 @@ def OSConsumesThis : InheritableAttr { def Cleanup : InheritableAttr { let Spellings = [GCC<"cleanup">]; - let Args = [DeclArgument]; + let Args = [DeclArgument, + ExprArgument<"Expr", /*opt=*/0, /*fake=*/1>]; erichkeane

[clang] [clang][Sema] Diagnose exceptions only in non-dependent context in discarded `try/catch/throw` blocks (PR #139859)

2025-05-19 Thread Erich Keane via cfe-commits
erichkeane wrote: > > I would be against said RFC. If you asked me in 1996/whatever, I could be > > talked into it. But we're 30+ years of this behavior. > > Doesn't stop WG21 from changing the behavior 30 years later. ;-) My biggest > concern is actually that C++ is changing exception handlin

[clang] [clang-tools-extra] [clang-include-cleaner] Make cleanup attr report expr location (PR #140233)

2025-05-19 Thread Erich Keane via cfe-commits
@@ -1351,7 +1352,8 @@ def OSConsumesThis : InheritableAttr { def Cleanup : InheritableAttr { let Spellings = [GCC<"cleanup">]; - let Args = [DeclArgument]; + let Args = [DeclArgument, + ExprArgument<"Expr", /*opt=*/0, /*fake=*/1>]; erichkeane

[clang] [clang][Sema] Diagnose exceptions only in non-dependent context in discarded `try/catch/throw` blocks (PR #139859)

2025-05-19 Thread Erich Keane via cfe-commits
erichkeane wrote: > > I feel like this issue is a little too niche to be adding such complexity, > > maybe just covering those specific uses cases before codegen might be the > > way to go? > > I think disabling the keywords entirely is a large ask (requires an RFC at a > minimum) and so we d

[clang] [clang-tools-extra] [clang-include-cleaner] Make cleanup attr report expr location (PR #140233)

2025-05-19 Thread Erich Keane via cfe-commits
@@ -1351,7 +1352,8 @@ def OSConsumesThis : InheritableAttr { def Cleanup : InheritableAttr { let Spellings = [GCC<"cleanup">]; - let Args = [DeclArgument]; + let Args = [DeclArgument, + ExprArgument<"Expr", /*opt=*/0, /*fake=*/1>]; erichkeane

[clang] [NFC][OpenACC] Refactor clause emission- (PR #140586)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/140586 Having the whole clause emission be in a header file ended up being pragmatic, but ended up being a sizable negative for a variety of reasons. This patch moves it to its own .cpp file and makes CIRGenFuncti

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/140304 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C] Do not diagnose flexible array members with -Wdefault-const-init-field-unsafe (PR #140578)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Functions called in discarded statements should not be instantiated (PR #140576)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/140304 >From a4e63bb357688f7200113d4dc39c83d95d72ce6e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 12 May 2025 08:59:40 -0700 Subject: [PATCH 1/4] [OpenACC][CIR] Implement beginning of 'copy' lowering for c

[clang] Fix crash with delayed typo correction (PR #140571)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140571 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Alright, I've done all as requested. Would love a 2nd review/approval from Bruno. @bcardosolopes : If it is alright, I'd like to just do the OpenACC clause refactor in a followup patch. I'll work on it 'next', immediately after this one. I'd origina

[clang] [C++] Fix a crash with __thread and dependent types (PR #140542)

2025-05-19 Thread Erich Keane via cfe-commits
@@ -14622,7 +14622,8 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) { Diag(var->getLocation(), diag::err_thread_nontrivial_dtor); if (getLangOpts().CPlusPlus11) Diag(var->getLocation(), diag::note_use_thread_local); -} else if (getLangOpts

[clang] [C++] Fix a crash with __thread and dependent types (PR #140542)

2025-05-19 Thread Erich Keane via cfe-commits
@@ -14608,6 +14608,10 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) { std::optional CacheHasConstInit; const Expr *CacheCulprit = nullptr; auto checkConstInit = [&]() mutable { +const Expr *Init = var->getInit(); +if (Init->isInstantiationDependent

[clang] [C++] Fix a crash with __thread and dependent types (PR #140542)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140542 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++] Fix a crash with __thread and dependent types (PR #140542)

2025-05-19 Thread Erich Keane via cfe-commits
@@ -14608,6 +14608,10 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) { std::optional CacheHasConstInit; const Expr *CacheCulprit = nullptr; auto checkConstInit = [&]() mutable { +const Expr *Init = var->getInit(); +if (Init->isInstantiationDependent

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-19 Thread Erich Keane via cfe-commits
@@ -36,6 +37,76 @@ template constexpr bool isCombinedType = false; template constexpr bool isCombinedType> = true; +namespace { +struct DataOperandInfo { + mlir::Location beginLoc; + mlir::Value varValue; + llvm::StringRef name; + mlir::ValueRange bounds; + + DataOpera

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/140304 >From a4e63bb357688f7200113d4dc39c83d95d72ce6e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 12 May 2025 08:59:40 -0700 Subject: [PATCH 1/2] [OpenACC][CIR] Implement beginning of 'copy' lowering for c

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/140304 >From a4e63bb357688f7200113d4dc39c83d95d72ce6e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 12 May 2025 08:59:40 -0700 Subject: [PATCH 1/3] [OpenACC][CIR] Implement beginning of 'copy' lowering for c

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/140304 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-19 Thread Erich Keane via cfe-commits
@@ -36,6 +37,76 @@ template constexpr bool isCombinedType = false; template constexpr bool isCombinedType> = true; +namespace { +struct DataOperandInfo { + mlir::Location beginLoc; + mlir::Value varValue; + llvm::StringRef name; + mlir::ValueRange bounds; + + DataOpera

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-19 Thread Erich Keane via cfe-commits
@@ -36,6 +37,76 @@ template constexpr bool isCombinedType = false; template constexpr bool isCombinedType> = true; +namespace { +struct DataOperandInfo { + mlir::Location beginLoc; + mlir::Value varValue; + llvm::StringRef name; + mlir::ValueRange bounds; + + DataOpera

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-19 Thread Erich Keane via cfe-commits
@@ -36,6 +37,76 @@ template constexpr bool isCombinedType = false; template constexpr bool isCombinedType> = true; +namespace { +struct DataOperandInfo { + mlir::Location beginLoc; + mlir::Value varValue; + llvm::StringRef name; + mlir::ValueRange bounds; + + DataOpera

[clang] [llvm] [Clang] Allow vector and matrix type attributes for sub-byte _BitInt (PR #140253)

2025-05-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Diagnose exceptions only in non-dependent context in discarded `try/catch/throw` blocks (PR #139859)

2025-05-19 Thread Erich Keane via cfe-commits
erichkeane wrote: >What are the use cases for disabling exceptions but still allowing the >constructs in source? e.g., do we want to start disabling the keywords >entirely, and thus they won't appear in the AST? Or do we want them to be a >codegen-only option, at which point they do appear in

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-16 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/140304 …structs This is a partial implementation of the 'copy' lowering. It is missing 3 things, which are coming in future patches: 1- does not handle subscript/subarrays for emission as variables 2- does not ha

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-16 Thread Erich Keane via cfe-commits
@@ -250,14 +420,26 @@ class OpenACCClauseCIREmitter final } void VisitAsyncClause(const OpenACCAsyncClause &clause) { +hasAsyncClause = true; if constexpr (isOneOfTypes) { if (!clause.hasIntExpr()) operation.addAsyncOnly(builder.getContext(), lastD

[clang] [OpenACC][CIR] Implement beginning of 'copy' lowering for compute con… (PR #140304)

2025-05-16 Thread Erich Keane via cfe-commits
@@ -157,6 +222,103 @@ class OpenACCClauseCIREmitter final computeEmitter.Visit(&c); } + template + void addDataOperand(const Expr *varOperand, mlir::acc::DataClause dataClause, + bool structured, bool implicit) { +DataOperandInfo opInfo = +

[clang] [CIR] Upstream support for C++ member function calls (PR #140290)

2025-05-16 Thread Erich Keane via cfe-commits
@@ -0,0 +1,45 @@ +//===- CirGenCXXABI.cpp - Interface to C++ ABIs ---===// +// +// 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] [CIR] Upstream support for C++ member function calls (PR #140290)

2025-05-16 Thread Erich Keane via cfe-commits
@@ -0,0 +1,45 @@ +//===- CirGenCXXABI.cpp - Interface to C++ ABIs ---===// +// +// 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] [NFC][Clang] Adopt simplified `getTrailingObjects` in Expr.cpp/h (PR #140102)

2025-05-16 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Allow vector and matrix type attributes for sub-byte _BitInt (PR #140253)

2025-05-16 Thread Erich Keane via cfe-commits
erichkeane wrote: > > So I'd need to see some codegen tests that show that we're doing the right > > thing for these, plus some sort of testing that shows that we do the right > > thing with llvm codegen. > > Sure, I'll work on this. Thanks! This was really just a "tests would be a PITA to w

[clang] [Clang] Allow vector and matrix type attributes for sub-byte _BitInt (PR #140253)

2025-05-16 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I don't have a problem with this, but I'd need to see a LOT more tests here. We have this restriction because it wasn't clear whether the semantics work correctly for codegen/llvm backends. So I'd need to see some codegen tests that show that we're doi

[clang] [NFC][Clang] Adopt simplified `getTrailingObjects` in Expr.cpp/h (PR #140102)

2025-05-16 Thread Erich Keane via cfe-commits
@@ -5043,16 +5037,18 @@ PseudoObjectExpr::PseudoObjectExpr(QualType type, ExprValueKind VK, : Expr(PseudoObjectExprClass, type, VK, OK_Ordinary) { PseudoObjectExprBits.NumSubExprs = semantics.size() + 1; PseudoObjectExprBits.ResultIndex = resultIndex + 1; - - for (uns

[clang] [NFC][Clang] Adopt simplified `getTrailingObjects` in Expr.cpp/h (PR #140102)

2025-05-16 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/140102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Diagnose exceptions only in non-dependent context in discarded `try/catch/throw` blocks (PR #139859)

2025-05-16 Thread Erich Keane via cfe-commits
erichkeane wrote: > Moving the checks does work for these limited cases, but now that we don't > have them there, one of the old tests now doesn't show up the diagnosis: > > ```c++ > void f() { > throw; > } > > void g() { > try { > f(); > } catch (...) { > } > } > ``` > > Since th

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-05-16 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: First, please take a look at the LLVM coding standard re the use of 'auto'. Second: The use of a special type for these builtins is a little novel (though I see the predicate type already exists?), but I guess I'm ok with it. I have some concerns with

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-05-16 Thread Erich Keane via cfe-commits
@@ -13338,4 +13338,23 @@ def err_acc_device_type_multiple_archs // AMDGCN builtins diagnostics def err_amdgcn_load_lds_size_invalid_value : Error<"invalid size value">; def note_amdgcn_load_lds_size_valid_value : Note<"size must be %select{1, 2, or 4|1, 2, 4, 12 or 16}0">; +de

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-05-16 Thread Erich Keane via cfe-commits
@@ -581,6 +581,9 @@ llvm::Type *CodeGenTypes::ConvertType(QualType T) { case BuiltinType::Id: \ return llvm::TargetExtType::get(getLLVMContext(), "amdgcn.named.barrier", \ {}, {S

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-05-16 Thread Erich Keane via cfe-commits
@@ -366,4 +367,72 @@ void SemaAMDGPU::handleAMDGPUMaxNumWorkGroupsAttr(Decl *D, addAMDGPUMaxNumWorkGroupsAttr(D, AL, AL.getArgAsExpr(0), YExpr, ZExpr); } +Expr *SemaAMDGPU::ExpandAMDGPUPredicateBI(CallExpr *CE) { + auto &Ctx = getASTContext(); erichkeane wr

  1   2   3   4   5   6   7   8   9   10   >