[PATCH] D133683: [c++] implements tentative DR1432 for partial ordering of function template

2022-09-18 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:5455-5456 if (!ClangABICompat15) { - // Consider this a fix for CWG1432. Similar to the fix for CWG1395. auto *TST1 = T1->castAs(); auto *TST2 = T2->castAs(); + const

[PATCH] D133683: [c++] implements tentative DR1432 for partial ordering of function template

2022-09-18 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:5179-5231 if (!Better1 && !Better2) // Neither is better than the other return JudgeByConstraints(); // C++ [temp.deduct.partial]p11: // ... and if G has a trailing function par

[PATCH] D134143: [clang] Misc type sugar preservation improvements

2022-09-18 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov created this revision. Herald added a project: All. mizvekov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. WIP - Not ready for review Missing standalone tests. Signed-off-by: Matheus Izvekov Depends on D134115

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-09-19 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D133468#3799475 , @erichkeane wrote: > I'm still having trouble from the description and test figuring out what this > means. Can you better clarify the intent/effect of this? The effect is that you can effectively have a

[PATCH] D132816: [clang] AST: SubstTemplateTypeParmType support for non-canonical underlying type

2022-09-19 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D132816#3799484 , @erichkeane wrote: > Patch generally seems OK to me. I would vastly prefer a better commit message > explaining the intent here. Also, not quite sure I see the need for the > extra bit? Well mechanically

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-09-19 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D133468#3799522 , @erichkeane wrote: > as far as `Divergent`, I wonder if we should call it something more > descriptive, since it isn't just that it 'differs', it is that it is a > non-canonical version, right? Well, curr

[PATCH] D132816: [clang] AST: SubstTemplateTypeParmType support for non-canonical underlying type

2022-09-19 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D132816#3799543 , @erichkeane wrote: > As far as the "commit summary", the patch summary at least is empty... Yeah I meant the one line title of the commit, but I will update it to include a summary with further elaboration

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-09-19 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D133468#3799572 , @erichkeane wrote: > I agree with all of that, but still am not thrilled at 'Divergent', it isn't > particularly descriptive... `Divergent` has some additional implications that > I'm not sure we mean as w

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-09-20 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D133468#3801838 , @davrec wrote: > If I understand this correctly: whenever isDivergent() is true, `getDecl()` > or `getFoundDecl()` is an arbitrary choice between multiple candidate > (re)declarations of a typedef or using

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-09-20 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D133468#3802727 , @davrec wrote: > what is the different principle behind choosing a different underlying type? > Why can't the underlying type for `t29`/`t32` be sugar for X1 and friends > too? The underlying type is tak

[PATCH] D134286: [C2x] implement typeof and typeof_unqual

2022-09-20 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/include/clang/AST/Type.h:4537 Expr *TOExpr; + bool IsUnqual; You can use the Type Bitfields in order to avoid bumping the size of the node. Comment at: clang/lib/AST/ASTContext.cpp:12910-

[PATCH] D134286: [C2x] implement typeof and typeof_unqual

2022-09-20 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/include/clang/AST/Type.h:4601 +QualType QT = getUnderlyingType(); +return IsUnqual ? QT.getTypeofUnqualType() : QT; + } shafik wrote: > It is interesting that you do `getTypeofUnqualType` in the construct

[PATCH] D134286: [C2x] implement typeof and typeof_unqual

2022-09-20 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/include/clang/AST/Type.h:4592 + T->getDependence()), TOType(T), IsUnqual(IsUnqual) { +assert(!isa(Can) && "Invalid canonical type"); } erichkeane wrote: > Are `TypedefType`'s EVER canonical? Shoul

[PATCH] D134286: [C2x] implement typeof and typeof_unqual

2022-09-20 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:12910-12916 +// FIXME:: is this assumption correct or do we need to do work here to find +// the common type sugar regarding the stripped qualifiers if only one side +// is unqual? +assert(ca

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-09-20 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 461627. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133468/new/ https://reviews.llvm.org/D133468 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/JSONNodeDumper.h clang/include/clang/

[PATCH] D132816: [clang] AST: SubstTemplateTypeParmType support for non-canonical underlying type

2022-09-20 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov edited the summary of this revision. mizvekov updated this revision to Diff 461628. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132816/new/ https://reviews.llvm.org/D132816 Files: clang/include/clang/AST/Type.h clang/include/clang/AST

[PATCH] D134295: [clang] Fix missing template arguments in AST of access to member variable template

2022-09-20 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov created this revision. Herald added a project: All. mizvekov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Signed-off-by: Matheus Izvekov Depends on D132816 Repository: rG LLVM Github Mono

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-09-20 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D133468#3803449 , @sammccall wrote: > The descriptions here are pretty general and opaque nad it's hard to follow > what this means in practice. > It sounds like the motivating cases are to do with template instantiation - >

[PATCH] D134295: [clang] Fix missing template arguments in AST of access to member variable template

2022-09-20 Thread Matheus Izvekov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc493d49cefee: [clang] Fix missing template arguments in AST of access to member variable… (authored by mizvekov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 461850. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133468/new/ https://reviews.llvm.org/D133468 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/JSONNodeDumper.h clang/include/clang/

[PATCH] D132816: [clang] AST: SubstTemplateTypeParmType support for non-canonical underlying type

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 461851. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132816/new/ https://reviews.llvm.org/D132816 Files: clang/include/clang/AST/Type.h clang/include/clang/AST/TypeProperties.td clang/lib/AST/ASTContext.

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 461852. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131858/new/ https://reviews.llvm.org/D131858 Files: clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp clang-tools-extra/clang-tidy/performa

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov marked an inline comment as done. mizvekov added inline comments. Comment at: clang/lib/Serialization/ASTReaderDecl.cpp:890-893 + struct { +bool DoIt; +FunctionDecl *Existing = nullptr; + } Merge = {false}; ChuanqiXu wrote: > Is this struct nec

[PATCH] D132816: [clang] AST: SubstTemplateTypeParmType support for non-canonical underlying type

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGef4bbfe338bd: [clang] AST: SubstTemplateTypeParmType support for n

[PATCH] D134286: [C2x] implement typeof and typeof_unqual

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/AST/Type.cpp:3504-3507 + // We strip all qualifier-like attributes as well. + if (const auto *AT = dyn_cast(Ret.getTypePtr()); + AT && AT->isQualifier()) +Ret = AT->getModifiedType(); I think this b

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 461966. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133468/new/ https://reviews.llvm.org/D133468 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/JSONNodeDumper.h clang/include/clang/

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 461967. mizvekov marked an inline comment as done. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131858/new/ https://reviews.llvm.org/D131858 Files: clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.

[PATCH] D133874: [clang] Implement sugar retention for converted template arguments

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 461968. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133874/new/ https://reviews.llvm.org/D133874 Files: clang/include/clang/Sema/Sema.h clang/include/clang/Sema/TemplateDeduction.h clang/lib/Sema/SemaLo

[PATCH] D134115: [clang] Store in exprs the deduced arguments for function calls.

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov edited the summary of this revision. mizvekov updated this revision to Diff 461970. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134115/new/ https://reviews.llvm.org/D134115 Files: clang/include/clang/AST/ASTImporter.h clang/include/cl

[PATCH] D134143: [clang] Misc type sugar preservation improvements

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov edited the summary of this revision. mizvekov updated this revision to Diff 461971. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134143/new/ https://reviews.llvm.org/D134143 Files: clang/lib/Sema/SemaCXXScopeSpec.cpp clang/lib/Sema/Sem

[PATCH] D134381: [clang-tidy] Add option WarnOnSizeOfPointerToAggregate.

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. This is OK, within existing practice, but it's unfortunate that we have no tests at all for any of these flags. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134381/new/ https://reviews.llvm.org/D134381 _

[PATCH] D134381: [clang-tidy] Add option WarnOnSizeOfPointerToAggregate.

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D134381#3806929 , @mbenfield wrote: > I'll add a couple simple tests. Thanks!! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134381/new/ https://reviews.llvm.org/D134381

[PATCH] D134381: [clang-tidy] Add option WarnOnSizeOfPointerToAggregate.

2022-09-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov accepted this revision. mizvekov added a comment. This revision is now accepted and ready to land. Thank you again. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134381/new/ https://reviews.llvm.org/D134381 ___

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-09-22 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added subscribers: joanahalili, alexfh. mizvekov added a comment. FYI, I fixed all known points made, I think this review can progress. Another thing, which I noticed only after we improved and merged D128113 , is that it does have an impact similar to

[PATCH] D134604: [clang] Instiantiate early substituted entities with sugared template arguments

2022-09-25 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov created this revision. Herald added a project: All. mizvekov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. WIP - Not ready for review Signed-off-by: Matheus Izvekov Depends on D133874 Repos

[PATCH] D134604: [clang] Instiantiate early substituted entities with sugared template arguments

2022-09-25 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov edited the summary of this revision. mizvekov updated this revision to Diff 462735. Herald added a project: libc++. Herald added a subscriber: libcxx-commits. Herald added a reviewer: libc++. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1346

[PATCH] D134604: [clang] Instiantiate early substituted entities with sugared template arguments

2022-09-25 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 462738. Herald added subscribers: kadircet, arphaman. Herald added a project: clang-tools-extra. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134604/new/ https://reviews.llvm.org/D134604 Files: clang-tools-e

[PATCH] D134604: [clang] Instiantiate early substituted entities with sugared template arguments

2022-09-26 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D134604#3814986 , @ldionne wrote: > As explained in more details here > (https://reviews.llvm.org/D133249#inline-1289205), it would be nice to stop > using the `DELETE.ME` idiom to kick off libc++ CI, unless you really think

[PATCH] D133683: [c++] implements tentative DR1432 for partial ordering of function template

2022-09-27 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov accepted this revision. mizvekov added a comment. This revision is now accepted and ready to land. Looks good, aside some points: - Please add test for the conditioning on `ClangABICompat15`. - Missing release notes. - FWIW GCC treats the `g(42)` case as not ambiguous, as I expected, so

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-09-27 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D131858#3815057 , @davrec wrote: >> So this patch at least puts that into consistency. > > Is there already an analogous breakage for classes then? I am not sure I follow the question, but I meant that classes were already d

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-09-27 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D131858#3817750 , @davrec wrote: > Question was referring to @ChuanqiXu 's comment about this patch breaking > modules for function importing, see his repro (which I haven't looked at > closely). I was asking if this meant

[PATCH] D133683: [c++] implements tentative DR1432 for partial ordering of function template

2022-09-27 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D133683#3818752 , @ychen wrote: > I didn't add that because this patch is logically part of D128745 > which has a release note already. Okay, I see that the existing release note entry talk

[PATCH] D133683: [c++] implements tentative DR1432 for partial ordering of function template

2022-09-27 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D133683#3818858 , @ychen wrote: > It is clear cut by https://eel.is/c++draft/temp.deduct.partial#3.1. It is > orthogonal to the DRs implemented in D128745 > and here. > https://godbolt.org/

[PATCH] D133683: [c++] implements tentative DR1432 for partial ordering of function template

2022-09-27 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D133683#3818935 , @ychen wrote: > This is described in https://eel.is/c++draft/temp.deduct.partial#13. Parietal > ordering currently doesn't consider the number of deduced arguments. During > the partial ordering stage, by h

[PATCH] D134772: [Clang] Make constraints of auto part of NTTP instead of AutoType

2022-09-27 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. I don't think the problem here is an uniquing problem per se, it's just that the constraints are part of the canonical type of undeduced auto, which is undesirable for the NTTP. Maybe it would work to just add a new flag parameter to `ASTContext::getAutoType` which ma

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-09-28 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. @sammccall ping, is the explanation above reasonable? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133468/new/ https://reviews.llvm.org/D133468 ___ cfe-commits mailing list cfe

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-09-29 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D133468#3823143 , @sammccall wrote: > Sorry about the delay, I've been juggling too many things :-( No worries, thanks! > TL;DR: yes, I think it's reasonable. I think the implementation complexity is > justified by what we

[PATCH] D134115: [clang] Store in exprs the deduced arguments for function calls.

2022-09-30 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 464190. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134115/new/ https://reviews.llvm.org/D134115 Files: clang/include/clang/AST/ASTImporter.h clang/include/clang/AST/Expr.h clang/include/clang/Sema/Init

[PATCH] D134143: [clang] Misc type sugar preservation improvements

2022-09-30 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 464191. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134143/new/ https://reviews.llvm.org/D134143 Files: clang/lib/Sema/SemaCXXScopeSpec.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaType.cpp Index

[PATCH] D134143: [clang] Misc type sugar preservation improvements

2022-09-30 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 464435. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134143/new/ https://reviews.llvm.org/D134143 Files: clang/lib/Sema/SemaCXXScopeSpec.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaType.cpp Index

[PATCH] D134115: [clang] Store in exprs the deduced arguments for function calls.

2022-09-30 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 464434. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134115/new/ https://reviews.llvm.org/D134115 Files: clang/include/clang/AST/ASTImporter.h clang/include/clang/AST/Expr.h clang/include/clang/Sema/Init

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-10-03 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 464774. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133468/new/ https://reviews.llvm.org/D133468 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/JSONNodeDumper.h clang/include/clang/

[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

2022-10-03 Thread Matheus Izvekov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG69a6417406a1: [clang] Implement divergence for TypedefType and UsingType (authored by mizvekov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133468/new/ h

[PATCH] D135088: [Clang] make canonical AutoType constraints-free

2022-10-03 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:5730-5732 if (TypeConstraintConcept) TypeConstraintConcept = TypeConstraintConcept->getCanonicalDecl(); Pre-existing problem: This was not good to begin with, since we would not c

[PATCH] D135088: [Clang] make canonical AutoType constraints-free

2022-10-03 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:8664-8668 + if (QualType RT = FD->getDeclaredReturnType(); + DCK == DefaultedComparisonKind::ThreeWay && + RT->getContainedDeducedType() && + (!Context.hasSameType(RT, Context.getAutoDeduct

[PATCH] D135088: [Clang] make canonical AutoType constraints-free

2022-10-03 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:5745-5746 + if (TypeConstraintConcept) { +Canon = getAutoTypeInternal(QualType(), Keyword, false, IsPack, nullptr, +{}, true); // Find the insert po

[PATCH] D135088: [Clang] make canonical AutoType constraints-free

2022-10-03 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov accepted this revision. mizvekov added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:5768-5769 if (!IsCanon) { if (DeducedType.isNull()) { - SmallVector CanonArgs; - bool AnyNonCanonArgs = - ::getCanonicalTemplateArguments(*this, Ty

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-10-04 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 464937. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131858/new/ https://reviews.llvm.org/D131858 Files: clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp clang-tools-extra/clang-tidy/performa

[PATCH] D134286: [C2x] implement typeof and typeof_unqual

2022-10-04 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/include/clang/AST/Type.h:4564 + /// Returns true if this is a typeof_unqual type. + bool isUnqual() const { return TypeOfBits.IsUnqual; } + I only noticed this after rebasing some of my patches, I missed this on

[PATCH] D134286: [C2x] implement typeof and typeof_unqual

2022-10-04 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/include/clang/AST/Type.h:4564 + /// Returns true if this is a typeof_unqual type. + bool isUnqual() const { return TypeOfBits.IsUnqual; } + aaron.ballman wrote: > mizvekov wrote: > > I only noticed this after re

[PATCH] D135362: [clang] Make variables of undeduced types to have dependent alignment

2022-10-06 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov accepted this revision. mizvekov added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135362/new/ https://reviews.llvm.org/D135362 ___

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-10-08 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/include/clang/AST/Type.h:1836 +// The index of the template parameter this substitution represents. +unsigned Index : 15; + erichkeane wrote: > Is it a problem for this to be a different number of bits use

[PATCH] D134604: [clang] Instiantiate early substituted entities with sugared template arguments

2022-10-09 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 466365. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134604/new/ https://reviews.llvm.org/D134604 Files: clang-tools-extra/clangd/unittests/HoverTests.cpp clang/include/clang/Sema/Sema.h clang/lib/AST/AS

[PATCH] D134115: [clang] Store in exprs the deduced arguments for function calls.

2022-10-09 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 466367. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134115/new/ https://reviews.llvm.org/D134115 Files: clang/include/clang/AST/ASTImporter.h clang/include/clang/AST/Expr.h clang/include/clang/Sema/Init

[PATCH] D134143: [clang] Misc type sugar preservation improvements

2022-10-09 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 466368. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134143/new/ https://reviews.llvm.org/D134143 Files: clang/lib/Sema/SemaCXXScopeSpec.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaType.cpp Index

[PATCH] D127695: [clang] Implement Template Specialization Resugaring

2022-10-09 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D127695#3829020 , @davrec wrote: > The larger issues: > > 1. Performance - can we see some numbers? and There are still work left to do on a couple of enablers, and some other changes, in order to get performance on a level

[PATCH] D128750: [C++20] Implement P2113R0: Changes to the Partial Ordering of Constrained Functions

2022-10-11 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/include/clang/Sema/SemaConcept.h:53-62 + if (const auto *SubstB = + ArgB.getAsType()->getAs()) { +QualType ReplacementA = SubstA->getReplacementType(); +QualType ReplacementB = Sub

[PATCH] D128750: [C++20] Implement P2113R0: Changes to the Partial Ordering of Constrained Functions

2022-10-12 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:5511-5539 + template ::value, bool> = true> + bool operator()(T1 *PS1, T2 *PS2) { +return hasEqualTemplateArgumentList( +PS1->getTemplateArgsAsWritten()->arguments(), +PS2->

[PATCH] D133874: [clang] Implement sugar retention for converted template arguments

2022-10-14 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 467919. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133874/new/ https://reviews.llvm.org/D133874 Files: clang/include/clang/Sema/Sema.h clang/include/clang/Sema/TemplateDeduction.h clang/lib/Sema/SemaLo

[PATCH] D134604: [clang] Instiantiate early substituted entities with sugared template arguments

2022-10-14 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 467920. Herald added a project: LLDB. Herald added a subscriber: lldb-commits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134604/new/ https://reviews.llvm.org/D134604 Files: clang-tools-extra/clangd/unitte

[PATCH] D134115: [clang] Store in exprs the deduced arguments for function calls.

2022-10-14 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 467922. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134115/new/ https://reviews.llvm.org/D134115 Files: clang/include/clang/AST/ASTImporter.h clang/include/clang/AST/Expr.h clang/include/clang/Sema/Init

[PATCH] D134143: [clang] Misc type sugar preservation improvements

2022-10-14 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 467923. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134143/new/ https://reviews.llvm.org/D134143 Files: clang/lib/Sema/SemaCXXScopeSpec.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaType.cpp Index

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-10-14 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. I pushed some late changes: - Implement this new scheme uniformly across all template parameter kinds. Before we were doing only type parameters, now we are doing non-type and template template parameters. While the diff is not very small, it's more of the same stuff.

[PATCH] D127695: [clang] Implement Template Specialization Resugaring

2022-10-14 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D127695#3860237 , @rjmccall wrote: > What is this work about? I have written more about it in this discourse thread: https://discourse.llvm.org/t/rfc-improving-diagnostics-with-template-specialization-resugaring/64294 Repo

[PATCH] D128750: [C++20] Implement P2113R0: Changes to the Partial Ordering of Constrained Functions

2022-10-15 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:5511-5539 + template ::value, bool> = true> + bool operator()(T1 *PS1, T2 *PS2) { +return hasEqualTemplateArgumentList( +PS1->getTemplateArgsAsWritten()->arguments(), +PS2->

[PATCH] D128750: [C++20] Implement P2113R0: Changes to the Partial Ordering of Constrained Functions

2022-10-15 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:5511-5539 + template ::value, bool> = true> + bool operator()(T1 *PS1, T2 *PS2) { +return hasEqualTemplateArgumentList( +PS1->getTemplateArgsAsWritten()->arguments(), +PS2->

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-10-15 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/include/clang/AST/DeclTemplate.h:3427 +TemplateParameterList *getReplacedTemplateParameterList(Decl *D); + davrec wrote: > davrec wrote: > > I don't object with making this public, and I can see the argument for

[PATCH] D131858: [clang] Track the templated entity in type substitution.

2022-10-15 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/include/clang/AST/DeclTemplate.h:3427 +TemplateParameterList *getReplacedTemplateParameterList(Decl *D); + mizvekov wrote: > davrec wrote: > > davrec wrote: > > > I don't object with making this public, and I ca

[PATCH] D128750: [C++20] Implement P2113R0: Changes to the Partial Ordering of Constrained Functions

2022-10-15 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:5511-5539 + template ::value, bool> = true> + bool operator()(T1 *PS1, T2 *PS2) { +return hasEqualTemplateArgumentList( +PS1->getTemplateArgsAsWritten()->arguments(), +PS2->

[PATCH] D128750: [C++20] Implement P2113R0: Changes to the Partial Ordering of Constrained Functions

2022-10-15 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:5511-5539 + template ::value, bool> = true> + bool operator()(T1 *PS1, T2 *PS2) { +return hasEqualTemplateArgumentList( +PS1->getTemplateArgsAsWritten()->arguments(), +PS2->

[PATCH] D128750: [C++20] Implement P2113R0: Changes to the Partial Ordering of Constrained Functions

2022-10-17 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:5511-5539 + template ::value, bool> = true> + bool operator()(T1 *PS1, T2 *PS2) { +return hasEqualTemplateArgumentList( +PS1->getTemplateArgsAsWritten()->arguments(), +PS2->

[PATCH] D136533: [clang] Fix missing diagnostic of declaration use when accessing TypeDecls through typename access

2022-11-01 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D136533#3899628 , @ldionne wrote: > It might be a problem, but I would argue we should still do it after fixing > any problematic cases. It seems like Clang's current behavior is broken, as > it basically ignores the `[[depr

[PATCH] D136533: [clang] Fix missing diagnostic of declaration use when accessing TypeDecls through typename access

2022-11-01 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 472414. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136533/new/ https://reviews.llvm.org/D136533 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaDecl.cpp clang/li

[PATCH] D134113: [clang] store sugared converted arguments on TemplateSpecializationType

2022-11-01 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 472415. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134113/new/ https://reviews.llvm.org/D134113 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/RecursiveASTVisitor.h clang/include/c

[PATCH] D127695: [clang] Template Specialization Resugaring - TypeDecl

2022-11-01 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov retitled this revision from "[clang] Implement Template Specialization Resugaring" to "[clang] Template Specialization Resugaring - TypeDecl". mizvekov edited the summary of this revision. mizvekov updated this revision to Diff 472416. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D137199: [clang] Template Specialization Resugaring - Template Type Alias

2022-11-01 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov created this revision. Herald added subscribers: jeroen.dobbelaere, ChuanqiXu. Herald added a project: All. mizvekov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This implements resugaring of the pattern of template type aliases

[PATCH] D134115: [clang] Store in exprs the deduced arguments for function calls.

2022-11-01 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 472421. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134115/new/ https://reviews.llvm.org/D134115 Files: clang/include/clang/AST/ASTImporter.h clang/include/clang/AST/Expr.h clang/include/clang/Sema/Init

[PATCH] D134143: [clang] Misc type sugar preservation improvements

2022-11-01 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 472422. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134143/new/ https://reviews.llvm.org/D134143 Files: clang/lib/Sema/SemaCXXScopeSpec.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaType.cpp Index

[PATCH] D137200: [clang] Template Specialization Resugaring - Expressions

2022-11-01 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov created this revision. Herald added subscribers: ChuanqiXu, jdoerfert, arphaman. Herald added a reviewer: aaron.ballman. Herald added a project: All. mizvekov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. WIP Signed-off-by: Math

[PATCH] D127695: [clang] Template Specialization Resugaring - TypeDecl

2022-11-01 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D127695#3860316 , @rjmccall wrote: > I see, thank you. I know you've marked this a WIP, but it's always good to > describe these things in the patch description; that's what it's for. Done! I have also removed the WIP. While

[PATCH] D136533: [clang] Fix missing diagnostic of declaration use when accessing TypeDecls through typename access

2022-11-03 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. FYI just another data point, I haven't taken a closer look yet, but with the resugaring patches applied on top of this, we start diagnosing some deprecated uses of `std::experimental::pmr::polymorphic_allocator` on current libc++ linux CI: https://buildkite.com/llvm-p

[PATCH] D137200: [clang] Template Specialization Resugaring - Expressions

2022-11-03 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov edited the summary of this revision. mizvekov updated this revision to Diff 472886. Herald added a project: libc++. Herald added a subscriber: libcxx-commits. Herald added a reviewer: libc++. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1372

[PATCH] D136565: [clang] Instantiate alias templates with sugar

2022-11-07 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D136565#3911884 , @alexfh wrote: > Hi Matheus, 279fe6281d2ca5b2318c7437316c28750feaac8d > causes > compilation timeout on some of our internal files. Hi

[PATCH] D136565: [clang] Instantiate alias templates with sugar

2022-11-07 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. @alexfh Thanks! While there is a huge increase in the amount of UsingTypes, it seems the total amount is still reasonable and does not explain the perf hit. Perhaps this is a case of bad hashing and they are all falling into the same bucket? cc @sam.mcall for awarene

[PATCH] D127351: clang: fix early substitution of alias templates

2022-06-10 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:1872 QualType Result = getSema().Context.getTemplateTypeParmType( - T->getDepth() - TemplateArgs.getNumSubstitutedLevels(), T->getIndex(), - T->isParameterPack(), NewTTPDecl); +

[PATCH] D127351: clang: fix early substitution of alias templates

2022-06-10 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:1872 QualType Result = getSema().Context.getTemplateTypeParmType( - T->getDepth() - TemplateArgs.getNumSubstitutedLevels(), T->getIndex(), - T->isParameterPack(), NewTTPDecl); +

[PATCH] D127351: clang: fix early substitution of alias templates

2022-06-11 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov updated this revision to Diff 436155. mizvekov added a comment. - much smaller patch, puts the new flag as a mutable member of MultiLevelTemplateArgumentList Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127351/new/ https://reviews.llvm.o

[PATCH] D127351: clang: fix early substitution of alias templates

2022-06-11 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added inline comments. Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:1872 QualType Result = getSema().Context.getTemplateTypeParmType( - T->getDepth() - TemplateArgs.getNumSubstitutedLevels(), T->getIndex(), - T->isParameterPack(), NewTTPDecl); +

[PATCH] D127690: [NFC] clang/Parser: remove dead code

2022-06-13 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov created this revision. Herald added a project: All. mizvekov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Signed-off-by: Matheus Izvekov Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D127690 Files: clang/

[PATCH] D126620: [clang] AST/Print: honor AlwaysIncludeTypeForTemplateArgument policy

2022-06-14 Thread Matheus Izvekov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG671eb7dc1e69: [clang] AST/Print: honor AlwaysIncludeTypeForTemplateArgument policy (authored by mizvekov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1266

<    3   4   5   6   7   8   9   10   >