[clang] [Clang] Do not try to diagnose parameter packs in invalid pack expressions (PR #89257)

2024-04-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/89257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC] Implement 'num_workers' clause for compute constructs (PR #89151)

2024-04-18 Thread Erich Keane via cfe-commits
erichkeane wrote: Sorry for the extra two updates, I found those two while working on the next clause :) https://github.com/llvm/llvm-project/pull/89151 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Fix the mangling of lambdas (PR #89204)

2024-04-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/89204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BitInt] Expose a _BitInt literal suffix in C++ (PR #86586)

2024-04-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. This is fine to me, I have some concerns about the out-of-bounds reads on the NumericLIteralParser, but if @cor3ntin and you have done the work to make sure it is ok, than I am ok with it.

[clang] [OpenACC] Implement 'num_workers' clause for compute constructs (PR #89151)

2024-04-18 Thread Erich Keane via cfe-commits
@@ -156,6 +156,64 @@ class OpenACCSelfClause : public OpenACCClauseWithCondition { Expr *ConditionExpr, SourceLocation EndLoc); }; +/// Represents one of a handful of classes that have integer expressions. +/// Semantically, many only

[clang] [OpenACC] Implement 'num_workers' clause for compute constructs (PR #89151)

2024-04-18 Thread Erich Keane via cfe-commits
@@ -156,6 +156,64 @@ class OpenACCSelfClause : public OpenACCClauseWithCondition { Expr *ConditionExpr, SourceLocation EndLoc); }; +/// Represents one of a handful of classes that have integer expressions. +/// Semantically, many only

[clang] [OpenACC] Implement 'num_workers' clause for compute constructs (PR #89151)

2024-04-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/89151 >From d3894971090921b92c71ba5a18151cb2033c8cfa Mon Sep 17 00:00:00 2001 From: erichkeane Date: Tue, 16 Apr 2024 09:43:55 -0700 Subject: [PATCH 1/3] [OpenACC] Implement 'num_workers' clause for compute

[clang] [Clang] Allow the value of unroll count to be zero in `#pragma GCC unroll` and `#pragma unroll` (PR #88666)

2024-04-18 Thread Erich Keane via cfe-commits
erichkeane wrote: > Wait for CI green, but seems windows bots fall into a trouble. Windows bot is typically pretty far behind(usually 4-5 hrs during the day), but 13 hours is a heck of a delay! I think all we can do is wait :/ https://github.com/llvm/llvm-project/pull/88666

[clang] [clang] Fix a "!CodeSynthesisContexts.empty()" assertion failure when constructing aggregate deduction guides. (PR #89227)

2024-04-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/89227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-18 Thread Erich Keane via cfe-commits
@@ -186,3 +186,74 @@ class E { #endif template using D = int; // expected-note {{declared here}} E ed; // expected-note {{instantiation of}} + +namespace non_functions { + +#if __cplusplus >= 201103L +namespace PR88832 { +template struct O { + static const T v = 0; +}; +

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-18 Thread Erich Keane via cfe-commits
@@ -186,3 +186,74 @@ class E { #endif template using D = int; // expected-note {{declared here}} E ed; // expected-note {{instantiation of}} + +namespace non_functions { + +#if __cplusplus >= 201103L +namespace PR88832 { +template struct O { + static const T v = 0; +}; +

[clang] Stop double-diagnosing explicit convert operator in switch condition (PR #89142)

2024-04-18 Thread Erich Keane via cfe-commits
erichkeane wrote: > Did you try to use `ExprDependence::Error`? I've only ever seen that used in regards to the `RecoveryExpr`, so I think I am? Also, `RecoveryExpr` doesn't really have a way of changing its dependence to anything but what it is.

[clang] Stop double-diagnosing explicit convert operator in switch condition (PR #89142)

2024-04-18 Thread Erich Keane via cfe-commits
erichkeane wrote: > I'm having second thoughts about leveraging recovery expressions as a > side-band mechanism to de-duplicate diagnostics, because not modeling things > properly in AST might backfire in the future. But I don't have anything > better on my mind, so I don't want to block the

[clang] [OpenACC] Implement 'num_workers' clause for compute constructs (PR #89151)

2024-04-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/89151 >From d3894971090921b92c71ba5a18151cb2033c8cfa Mon Sep 17 00:00:00 2001 From: erichkeane Date: Tue, 16 Apr 2024 09:43:55 -0700 Subject: [PATCH 1/2] [OpenACC] Implement 'num_workers' clause for compute

[clang] [OpenACC] Implement 'num_workers' clause for compute constructs (PR #89151)

2024-04-17 Thread Erich Keane via cfe-commits
@@ -0,0 +1,133 @@ +// RUN: %clang_cc1 %s -fopenacc -verify + +struct NotConvertible{} NC; +struct Incomplete *SomeIncomplete; // #INCOMPLETE +enum E{} SomeE; +enum class E2{} SomeE2; + +struct CorrectConvert { + operator int(); +} Convert; + +struct ExplicitConvertOnly { +

[clang] [OpenACC] Implement 'num_workers' clause for compute constructs (PR #89151)

2024-04-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/89151 This clause just takes an 'int expr', which is not optional. This patch implements the clause on compute constructs. >From d3894971090921b92c71ba5a18151cb2033c8cfa Mon Sep 17 00:00:00 2001 From: erichkeane

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-17 Thread Erich Keane via cfe-commits
@@ -2596,27 +2588,14 @@ class VarTemplateSpecializationDecl : public VarDecl, llvm::PointerUnion SpecializedTemplate; - /// Further info for explicit template specialization/instantiation. - struct ExplicitSpecializationInfo { -/// The type-as-written. -

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-17 Thread Erich Keane via cfe-commits
@@ -6390,6 +6394,7 @@ TEST(HasTemplateArgumentLoc, BindsToSpecializationWithDoubleArgument) { 0, hasTypeLoc(loc(asString("double"))); } +#if 0 erichkeane wrote: Ping on this.

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-17 Thread Erich Keane via cfe-commits
@@ -2596,27 +2588,14 @@ class VarTemplateSpecializationDecl : public VarDecl, llvm::PointerUnion SpecializedTemplate; - /// Further info for explicit template specialization/instantiation. - struct ExplicitSpecializationInfo { -/// The type-as-written. -

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-17 Thread Erich Keane via cfe-commits
@@ -1455,21 +1455,17 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream ) { // If this is a class template specialization, print the template // arguments. - if (const auto *Spec = dyn_cast(D)) { -ArrayRef Args; -TypeSourceInfo *TAW =

[clang] [Clang][Sema] Warn when 'exclude_from_explicit_instantiation' attribute is used on local classes and members thereof (PR #88777)

2024-04-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/88777 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] set declaration invalid earlier to prevent crash in calculating record layout (PR #87173)

2024-04-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/87173 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Allow the value of unroll count to be zero in `#pragma GCC unroll` and `#pragma unroll` (PR #88666)

2024-04-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/88666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Allow the value of unroll count to be zero in `#pragma GCC unroll` and `#pragma unroll` (PR #88666)

2024-04-17 Thread Erich Keane via cfe-commits
@@ -3903,7 +3904,14 @@ bool Sema::CheckLoopHintExpr(Expr *E, SourceLocation Loc) { if (R.isInvalid()) return true; - bool ValueIsPositive = ValueAPS.isStrictlyPositive(); + // GCC allows the value of unroll count to be 0. + //

[clang] Reapply "[Clang][Sema] placement new initializes typedef array with correct size (#83124)" (PR #89036)

2024-04-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: The original patch pointed out a regression: https://github.com/llvm/llvm-project/pull/83124#issuecomment-2060090590 Please contact that person and get a reproducer and make sure you aren't breaking them.

[clang] [Clang][Sema] placement new initializes typedef array with correct size (PR #83124)

2024-04-17 Thread Erich Keane via cfe-commits
erichkeane wrote: > Unless the original test was subtly broken, the forward fix in > [0a789ea](https://github.com/llvm/llvm-project/commit/0a789ea8a829da345e46d8224d73b2ddaba6969f) > seems erroneous. > > The forward fix changes the test to have a different declaration of `new`. > But I would

[clang] [Clang][Sema] Warn when 'exclude_from_explicit_instantiation' attribute is used on local classes and members thereof (PR #88777)

2024-04-16 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane Perhaps the release note should go under "Attribute Changes in > Clang"? That would be fine for me as well. https://github.com/llvm/llvm-project/pull/88777 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] placement new initializes typedef array with correct size (PR #88902)

2024-04-16 Thread Erich Keane via cfe-commits
@@ -1,5 +1,5 @@ -// RUN: %clang -S -fno-discard-value-names -emit-llvm -o - %s | FileCheck %s -// Issue no: 41441 +// RUN: %clang --target=x86_64-pc-linux -S -fno-discard-value-names -emit-llvm -o - %s | FileCheck %s + #include erichkeane wrote: Should be

[clang] [Clang][Sema] Improve support for explicit specializations of constrained member functions & member function templates (PR #88963)

2024-04-16 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Approach/fix looks fine, other than release notes + tests, LGTM. https://github.com/llvm/llvm-project/pull/88963 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] placement new initializes typedef array with correct size (PR #88902)

2024-04-16 Thread Erich Keane via cfe-commits
@@ -1,5 +1,5 @@ -// RUN: %clang -S -fno-discard-value-names -emit-llvm -o - %s | FileCheck %s -// Issue no: 41441 +// RUN: %clang --target=x86_64-pc-linux -S -fno-discard-value-names -emit-llvm -o - %s | FileCheck %s + #include erichkeane wrote: Blarg, the

[clang] [clang] Fix high memory consumption during pack deduction (PR #88637)

2024-04-16 Thread Erich Keane via cfe-commits
@@ -831,7 +831,7 @@ class PackDeductionScope { if (IsPartiallyExpanded) PackElements += NumPartialPackArgs; else if (IsExpanded) - PackElements += *FixedNumExpansions; + PackElements += FixedNumExpansions.value_or(1); erichkeane wrote:

[clang] Improve stack usage to increase recursive initialization depth (PR #88546)

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

[clang] [OpenACC] Implement `self` clause for compute constructs (PR #88760)

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

[clang] [OpenACC] Implement `self` clause for compute constructs (PR #88760)

2024-04-16 Thread Erich Keane via cfe-commits
@@ -72,3 +92,9 @@ void OpenACCClausePrinter::VisitDefaultClause(const OpenACCDefaultClause ) { void OpenACCClausePrinter::VisitIfClause(const OpenACCIfClause ) { OS << "if(" << C.getConditionExpr() << ")"; } + +void OpenACCClausePrinter::VisitSelfClause(const

[clang] [OpenACC] Implement `self` clause for compute constructs (PR #88760)

2024-04-16 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/88760 >From a96f008c7e4d97ca634f8ce24fc43843d5e19c91 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 12 Apr 2024 10:49:17 -0700 Subject: [PATCH 1/2] [OpenACC] Implement `self` clause for compute constructs

[clang] [OpenACC] Implement `self` clause for compute constructs (PR #88760)

2024-04-16 Thread Erich Keane via cfe-commits
@@ -160,12 +169,58 @@ SemaOpenACC::ActOnClause(ArrayRef ExistingClauses, // The parser has ensured that we have a proper condition expr, so there // isn't really much to do here. -// TODO OpenACC: When we implement 'self', this clauses causes us to -//

[clang] Reapply "[Clang][Sema] Fix crash when 'this' is used in a dependent class scope function template specialization that instantiates to a static member function (#87541, #88311)" (PR #88731)

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

[clang] [Clang][Sema] Warn when 'exclude_from_explicit_instantiation' attribute is used on local classes and members thereof (PR #88777)

2024-04-15 Thread Erich Keane via cfe-commits
@@ -9315,6 +9330,9 @@ ProcessDeclAttribute(Sema , Scope *scope, Decl *D, const ParsedAttr , case ParsedAttr::AT_Error: handleErrorAttr(S, D, AL); break; + case ParsedAttr::AT_ExcludeFromExplicitInstantiation: erichkeane wrote: It still needs to be

[clang] [Clang][Sema] Warn when 'exclude_from_explicit_instantiation' attribute is used on local classes and members thereof (PR #88777)

2024-04-15 Thread Erich Keane via cfe-commits
@@ -9315,6 +9330,9 @@ ProcessDeclAttribute(Sema , Scope *scope, Decl *D, const ParsedAttr , case ParsedAttr::AT_Error: handleErrorAttr(S, D, AL); break; + case ParsedAttr::AT_ExcludeFromExplicitInstantiation: erichkeane wrote: What is the previous

[clang] [Clang][Sema] Warn when 'exclude_from_explicit_instantiation' attribute is used on local classes and members thereof (PR #88777)

2024-04-15 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Needs a release note, probably int he 'potentially breaking changes' section? https://github.com/llvm/llvm-project/pull/88777 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Warn when 'exclude_from_explicit_instantiation' attribute is used on local classes and members thereof (PR #88777)

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

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-15 Thread Erich Keane via cfe-commits
@@ -91,11 +91,24 @@ static StringRef normalizeAttrName(StringRef Name) { /// isAttributeLateParsed - Return true if the attribute has arguments that /// require late parsing. -static bool isAttributeLateParsed(const IdentifierInfo ) { +bool Parser::isAttributeLateParsed(const

[clang] [OpenACC] Implement `self` clause for compute constructs (PR #88760)

2024-04-15 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/88760 `self` clauses on compute constructs take an optional condition expression. We again limit the implementation to ONLY compute constructs to ensure we get all the rules correct for others. However, this one

[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

2024-04-15 Thread Erich Keane via cfe-commits
@@ -91,11 +91,24 @@ static StringRef normalizeAttrName(StringRef Name) { /// isAttributeLateParsed - Return true if the attribute has arguments that /// require late parsing. -static bool isAttributeLateParsed(const IdentifierInfo ) { +bool Parser::isAttributeLateParsed(const

[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

2024-04-15 Thread Erich Keane via cfe-commits
@@ -252,16 +252,19 @@ static DeclPrinter::AttrPosAsWritten getPosAsWritten(const Attr *A, return DeclPrinter::AttrPosAsWritten::Right; } -void DeclPrinter::prettyPrintAttributes(const Decl *D, +// returns true if an attribute was printed. +bool

[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

2024-04-15 Thread Erich Keane via cfe-commits
@@ -275,13 +278,15 @@ void DeclPrinter::prettyPrintAttributes(const Decl *D, if (Pos != AttrPosAsWritten::Left) Out << ' '; A->printPretty(Out, Policy); + hasPrinted = true; if (Pos == AttrPosAsWritten::Left) Out

[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

2024-04-15 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 2 nits, else LGTM. Once you and @kimgr are in agreement with what to do next (and have looked into my nits), feel free to commit. https://github.com/llvm/llvm-project/pull/88600 ___

[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

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

[clang] [Clang][Sema] Fix issue on requires expression with templated base class member function (PR #85198)

2024-04-15 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Ah, I had missed (thanks github review tool!) that the 'ImplicitObjectMember' part already existed. Sorry for that. https://github.com/llvm/llvm-project/pull/85198 ___ cfe-commits mailing

[clang] [Clang] Allow the value of unroll count to be zero in `#pragma GCC unroll` and `#pragma unroll` (PR #88666)

2024-04-15 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: 1 nit, else this lgtm. https://github.com/llvm/llvm-project/pull/88666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Allow the value of unroll count to be zero in `#pragma GCC unroll` and `#pragma unroll` (PR #88666)

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

[clang] [Clang] Allow the value of unroll count to be zero in `#pragma GCC unroll` and `#pragma unroll` (PR #88666)

2024-04-15 Thread Erich Keane via cfe-commits
@@ -3903,7 +3904,14 @@ bool Sema::CheckLoopHintExpr(Expr *E, SourceLocation Loc) { if (R.isInvalid()) return true; - bool ValueIsPositive = ValueAPS.isStrictlyPositive(); + // GCC allows the value of unroll count to be 0. + //

[clang] [Clang][Sema] Fix issue on requires expression with templated base class member function (PR #85198)

2024-04-12 Thread Erich Keane via cfe-commits
@@ -7735,7 +7735,8 @@ ExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, } if (CXXMethodDecl *Method = dyn_cast_or_null(FDecl)) -if (Method->isImplicitObjectMemberFunction()) +if (!isa(CurContext) && erichkeane wrote: I still

[clang] [OpenACC] Implement 'if' clause for Compute Constructs (PR #88411)

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

[clang] Improve stack usage to increase template instantiation depth (PR #88546)

2024-04-12 Thread Erich Keane via cfe-commits
@@ -6113,8 +6113,10 @@ static bool TryOCLZeroOpaqueTypeInitialization(Sema , InitializationSequence::InitializationSequence( Sema , const InitializedEntity , const InitializationKind , MultiExprArg Args, bool TopLevelOfInitList, bool TreatUnavailableAsInvalid) -:

[clang] Improve stack usage to increase template instantiation depth (PR #88546)

2024-04-12 Thread Erich Keane via cfe-commits
@@ -203,6 +203,10 @@ Non-comprehensive list of changes in this release - ``__typeof_unqual__`` is available in all C modes as an extension, which behaves like ``typeof_unqual`` from C23, similar to ``__typeof__`` and ``typeof``. +- Improved stack usage with C++

[clang] Improve stack usage to increase template instantiation depth (PR #88546)

2024-04-12 Thread Erich Keane via cfe-commits
@@ -1057,16 +1057,15 @@ bool OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed( void OverloadCandidateSet::destroyCandidates() { for (iterator i = begin(), e = end(); i != e; ++i) { for (auto : i->Conversions) - C.~ImplicitConversionSequence(); +

[clang] [OpenACC] Implement 'if' clause for Compute Constructs (PR #88411)

2024-04-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/88411 >From 408f39f8ed0ee121aeaeb15c02603bb127e8cb73 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 10 Apr 2024 07:56:30 -0700 Subject: [PATCH 1/5] [OpenACC] Implement 'if' clause for Compute Constructs Like

[clang] [OpenACC] Implement 'if' clause for Compute Constructs (PR #88411)

2024-04-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/88411 >From 408f39f8ed0ee121aeaeb15c02603bb127e8cb73 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 10 Apr 2024 07:56:30 -0700 Subject: [PATCH 1/4] [OpenACC] Implement 'if' clause for Compute Constructs Like

[clang] [OpenACC] Implement 'if' clause for Compute Constructs (PR #88411)

2024-04-12 Thread Erich Keane via cfe-commits
erichkeane wrote: > General question. Should there be some support in > clang/tools/libclang/CIndex.cpp? Sorry, I only just saw this! I guess I don't have a good idea what the CIndex stuff does. I see there is quite a bit of this 'Enqueue' functionality in CIndex.cpp, but it isn't clear

[clang] [OpenACC] Implement 'if' clause for Compute Constructs (PR #88411)

2024-04-12 Thread Erich Keane via cfe-commits
@@ -11099,6 +11099,19 @@ OpenACCClause *TreeTransform::TransformOpenACCClause( ParsedClause.setDefaultDetails( cast(OldClause)->getDefaultClauseKind()); break; + case OpenACCClauseKind::If: { +Expr *Cond = const_cast( +

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

2024-04-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/84050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC] Implement 'if' clause for Compute Constructs (PR #88411)

2024-04-11 Thread Erich Keane via cfe-commits
@@ -7425,6 +7425,12 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) { writeEnum(DC->getDefaultClauseKind()); return; } + case OpenACCClauseKind::If: { +const auto *IC = cast(C); +writeSourceLocation(IC->getLParenLoc()); +

[clang] [OpenACC] Implement 'if' clause for Compute Constructs (PR #88411)

2024-04-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/88411 >From 408f39f8ed0ee121aeaeb15c02603bb127e8cb73 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 10 Apr 2024 07:56:30 -0700 Subject: [PATCH 1/3] [OpenACC] Implement 'if' clause for Compute Constructs Like

[clang] [OpenACC] Implement 'if' clause for Compute Constructs (PR #88411)

2024-04-11 Thread Erich Keane via cfe-commits
@@ -7425,6 +7425,12 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) { writeEnum(DC->getDefaultClauseKind()); return; } + case OpenACCClauseKind::If: { +const auto *IC = cast(C); +writeSourceLocation(IC->getLParenLoc()); +

[clang] [OpenACC] Implement 'if' clause for Compute Constructs (PR #88411)

2024-04-11 Thread Erich Keane via cfe-commits
@@ -27,10 +28,48 @@ OpenACCDefaultClause *OpenACCDefaultClause::Create(const ASTContext , return new (Mem) OpenACCDefaultClause(K, BeginLoc, LParenLoc, EndLoc); } +OpenACCIfClause *OpenACCIfClause::Create(const ASTContext , +

[clang] [Clang] Look through type sugar when accessing FunctionProtoType (PR #88428)

2024-04-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Ooof, yeah, good catch. I should have caught that in the review, I've fallen for that one before :) https://github.com/llvm/llvm-project/pull/88428 ___ cfe-commits mailing list

[clang] Rework the printing of attributes (PR #87281)

2024-04-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > A note from left field: I think this PR broke the IWYU test suite. We use > `TemplateDecl::print` + some postprocessing to generate template > forward-declarations. We're seeing this diff now: > > ```diff > -template class FinalTemplate; > +template class FinalTemplate;

[clang] [OpenACC] Implement 'if' clause for Compute Constructs (PR #88411)

2024-04-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/88411 >From 408f39f8ed0ee121aeaeb15c02603bb127e8cb73 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 10 Apr 2024 07:56:30 -0700 Subject: [PATCH 1/2] [OpenACC] Implement 'if' clause for Compute Constructs Like

[clang] [OpenACC] Implement 'if' clause for Compute Constructs (PR #88411)

2024-04-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/88411 Like with the 'default' clause, this is being applied to only Compute Constructs for now. The 'if' clause takes a condition expression which is used as a runtime value. This is not a particularly complex

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > What category should the release note go under? `Improvements to Clang's diagnostics` https://github.com/llvm/llvm-project/pull/88139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/88139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-11 Thread Erich Keane via cfe-commits
@@ -1581,26 +1581,33 @@ class TemplateTemplateParmDecl final DefaultArgStorage; DefArgStorage DefaultArgument; + /// Whether this template template parameter was declaration with + /// the 'typename' keyword. + /// + /// If false, it was declared with the 'class'

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

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

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: 1 nit, else LGTM https://github.com/llvm/llvm-project/pull/88139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane I'm thinking of keeping the use of `bool` to represent the > presence of `typename` in this patch, and opening another PR that changes > both `TemplateTemplateParmDecl` and `TypeTemplateParmDecl` to use > `TypeParmKeyword`... What do you think? I can live with

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. @endilll says 'Good to go' with the dr-status updated, so I'll approve. https://github.com/llvm/llvm-project/pull/88042 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > Could also get them from the CWG GitHub pages repository > (https://github.com/cplusplus/CWG/tree/gh-pages/issues)... anyways, am I good > to merge this? I believe we would still like you to re-generate with : www/make_cxx_dr_status

[clang] Reapply "[Clang][Sema] Fix crash when 'this' is used in a dependent class scope function template specialization that instantiates to a static member function (#87541)" (PR #88311)

2024-04-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Can you add the example that caused the revert to the tests? Else, LGTM. https://github.com/llvm/llvm-project/pull/88311 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > @Endilll `clang/www/make_cxx_dr_status` queries core issues from > https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_index.html. Since a new > revision of the index has not yet been published since CWG2858 was opened, > `clang/www/make_cxx_dr_status` doesn't add an entry

[clang] Reapply "[Clang][Sema] Fix crash when 'this' is used in a dependent class scope function template specialization that instantiates to a static member function (#87541)" (PR #88311)

2024-04-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Can you point out the 'diff' from the last patch for me? https://github.com/llvm/llvm-project/pull/88311 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix issue on requires expression with templated base class member function (PR #85198)

2024-04-11 Thread Erich Keane via cfe-commits
@@ -7735,7 +7735,8 @@ ExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, } if (CXXMethodDecl *Method = dyn_cast_or_null(FDecl)) -if (Method->isImplicitObjectMemberFunction()) +if (!isa(CurContext) && erichkeane wrote: I guess I

[clang] [Clang][Sema] Fix issue on requires expression with templated base class member function (PR #85198)

2024-04-11 Thread Erich Keane via cfe-commits
@@ -7735,7 +7735,8 @@ ExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, } if (CXXMethodDecl *Method = dyn_cast_or_null(FDecl)) -if (Method->isImplicitObjectMemberFunction()) +if (!isa(CurContext) && erichkeane wrote: I don't

[clang] [OpenACC] Implement Default clause for Compute Constructs (PR #88135)

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

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

2024-04-10 Thread Erich Keane via cfe-commits
@@ -6954,6 +6954,23 @@ static void HandleBTFTypeTagAttribute(QualType , const ParsedAttr , ::new (Ctx) BTFTypeTagAttr(Ctx, Attr, BTFTypeTag), Type); } +static void handleWrapsAttr(QualType , const ParsedAttr , +TypeProcessingState ) { +

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

2024-04-10 Thread Erich Keane via cfe-commits
@@ -147,6 +147,15 @@ struct BinOpInfo { return UnOp->getSubExpr()->getType()->isFixedPointType(); return false; } + + /// Does the BinaryOperator have the wraps attribute? + /// If so, we can ellide overflow sanitizer checks. + bool oneOfWraps() const { +

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

2024-04-10 Thread Erich Keane via cfe-commits
@@ -4077,6 +4077,9 @@ class BinaryOperator : public Expr { static unsigned sizeOfTrailingObjects(bool HasFPFeatures) { return HasFPFeatures * sizeof(FPOptionsOverride); } + + /// Do one of the subexpressions have the wraps attribute? + bool oneOfWraps(const

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

2024-04-10 Thread Erich Keane via cfe-commits
@@ -4506,3 +4506,9 @@ def CodeAlign: StmtAttr { static constexpr int MaximumAlignment = 4096; }]; } + +def Wraps : DeclOrTypeAttr { + let Spellings = [GNU<"wraps">]; erichkeane wrote: Typically we'd want to do a `Clang` spelling here, which will allow

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

2024-04-10 Thread Erich Keane via cfe-commits
@@ -4506,3 +4506,9 @@ def CodeAlign: StmtAttr { static constexpr int MaximumAlignment = 4096; }]; } + +def Wraps : DeclOrTypeAttr { + let Spellings = [GNU<"wraps">]; + let Subjects = SubjectList<[Var, TypedefName, Field]>; + let Documentation = [WrapsDocs]; +}

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

2024-04-10 Thread Erich Keane via cfe-commits
@@ -2237,6 +2237,21 @@ bool BinaryOperator::isNullPointerArithmeticExtension(ASTContext , return true; } +bool BinaryOperator::oneOfWraps(const ASTContext ) const { + llvm::SmallVector Both = {getLHS(), getRHS()}; erichkeane wrote: Suggest instead: ```

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

2024-04-10 Thread Erich Keane via cfe-commits
@@ -282,6 +282,15 @@ Attribute Changes in Clang This allows the ``_Nullable`` and ``_Nonnull`` family of type attributes to apply to this class. +- Introduced ``__attribute((wraps))__`` which can be added to type or variable + declarations. Using an attributed type or

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-04-10 Thread Erich Keane via cfe-commits
@@ -14527,20 +14525,24 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc, UnaryOperator::getOpcodeStr(Opc), OpLoc); return ExprError(); - case OR_Deleted: + case OR_Deleted: { // CreateOverloadedUnaryOp fills the first element of

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-04-10 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 set of 'nits' a few places, else LGTM. https://github.com/llvm/llvm-project/pull/86526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-04-10 Thread Erich Keane via cfe-commits
@@ -3092,30 +3092,65 @@ bool FunctionDecl::isVariadic() const { return false; } -FunctionDecl::DefaultedFunctionInfo * -FunctionDecl::DefaultedFunctionInfo::Create(ASTContext , -ArrayRef Lookups) { - DefaultedFunctionInfo *Info =

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-04-10 Thread Erich Keane via cfe-commits
@@ -3092,30 +3092,65 @@ bool FunctionDecl::isVariadic() const { return false; } -FunctionDecl::DefaultedFunctionInfo * -FunctionDecl::DefaultedFunctionInfo::Create(ASTContext , -ArrayRef Lookups) { - DefaultedFunctionInfo *Info =

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-04-10 Thread Erich Keane via cfe-commits
@@ -14527,20 +14525,24 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc, UnaryOperator::getOpcodeStr(Opc), OpLoc); return ExprError(); - case OR_Deleted: + case OR_Deleted: { // CreateOverloadedUnaryOp fills the first element of

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

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

[clang] [clang] Introduce `SemaSYCL` (PR #88086)

2024-04-10 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/88086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC] Implement Default clause for Compute Constructs (PR #88135)

2024-04-10 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/88135 >From b0595276f2b8d74d036ff9bf94c5baea86a57f17 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 8 Apr 2024 14:23:17 -0700 Subject: [PATCH 1/3] g This is a combination of 3 commits. [OpenACC] Implement

[clang] [OpenACC] Implement Default clause for Compute Constructs (PR #88135)

2024-04-10 Thread Erich Keane via cfe-commits
@@ -11074,13 +11079,44 @@ OMPClause *TreeTransform::TransformOMPXBareClause(OMPXBareClause *C) { //===--===// // OpenACC transformation

<    1   2   3   4   5   6   7   8   9   10   >