[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: We usually create new tests under the latest standard. https://github.com/llvm/llvm-project/pull/93265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/93265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix crash when diagnosing candidates with parameter packs (PR #93079)

2024-05-24 Thread Matheus Izvekov via cfe-commits
@@ -11298,8 +11298,9 @@ static void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand, Expr *FromExpr = Conv.Bad.FromExpr; QualType FromTy = Conv.Bad.getFromType(); QualType ToTy = Conv.Bad.getToType(); - SourceRange ToParamRange = - !isObjectArgument ? Fn->ge

[clang] [clang][Sema] Fix crash when diagnosing candidates with parameter packs (PR #93079)

2024-05-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/93079 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix crash when diagnosing candidates with parameter packs (PR #93079)

2024-05-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. Can you also add a test based on my example? With also a variant on that in which the bad conversion happens on the last element of the pack, instead of the last parameter. Lastly, please namespace the tests with the name of, or add a com

[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93265 >From 2546c2c5d9e1bc6d1d4ddd818b4017073f17cec0 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 23 May 2024 21:23:21 -0300 Subject: [PATCH] [clang] Avoid crash due to unimplemented StructuralValue supp

[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/93265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] add fallback to expr in the template differ when comparing ValueDecl (PR #93266)

2024-05-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/93266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] add fallback to expr in the template differ when comparing ValueDecl (PR #93266)

2024-05-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93266 >From 5b592204ddef177d612f8455f4e14ab9cf9c06bd Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 23 May 2024 23:57:01 -0300 Subject: [PATCH] [clang] add fallback to expr in the template differ when comp

[clang] [clang] add fallback to expr in the template differ when comparing ValueDecl (PR #93266)

2024-05-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/93266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement resolution for CWG1835 (PR #92957)

2024-05-24 Thread Matheus Izvekov via cfe-commits
@@ -55,15 +55,21 @@ namespace PR11856 { template T *end(T*); - class X { }; + struct X { }; + struct Y { +int end; + }; template void Foo2() { T it1; -if (it1->end < it1->end) { -} +if (it1->end < it1->end) { } X *x; -if (x->end <

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/93431 This improves and unifies our approach to printing all template arguments. The same approach to printing types is extended to all TemplateArguments: A sugared version is printed in quotes, followed by printing

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93431 >From c23a96038a8233b44b49bc0a1d2a2475e4d2a8ae Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 24 May 2024 12:22:55 -0300 Subject: [PATCH] [clang] Improve ast-dumper text printing of TemplateArgument

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93431 >From 031e7c235ce5cbae31504c21eeecc7655fbd1566 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 24 May 2024 12:22:55 -0300 Subject: [PATCH] [clang] Improve ast-dumper text printing of TemplateArgument

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: The problem here is the loss of the qualification on the TemplateNames This patch fixes the problem, without taking any workarounds: https://github.com/llvm/llvm-project/pull/93433 It also doesn't cause any change in diagnostics in `clang/test/SemaTempla

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93431 >From f9892ebed002d73c74f44629e926386006f7bec1 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 24 May 2024 12:22:55 -0300 Subject: [PATCH] [clang] Improve ast-dumper text printing of TemplateArgument

[clang] 0f85b25 - [clang] NFC: add a test case for TemplateName canonical type print issue

2024-05-27 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2024-05-27T04:45:20-03:00 New Revision: 0f85b25f51a3e06c48b3fe8042a3de1cf0e635d7 URL: https://github.com/llvm/llvm-project/commit/0f85b25f51a3e06c48b3fe8042a3de1cf0e635d7 DIFF: https://github.com/llvm/llvm-project/commit/0f85b25f51a3e06c48b3fe8042a3de1cf0e635d7.dif

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-27 Thread Matheus Izvekov via cfe-commits
@@ -947,6 +947,26 @@ void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) { }); } +void TextNodeDumper::dumpTemplateArgument(const TemplateArgument &TA) { + llvm::SmallString<128> Str; + { +llvm::raw_svector_ostream SS(Str); +TA.print(PrintPolicy, SS,

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-27 Thread Matheus Izvekov via cfe-commits
@@ -947,6 +947,26 @@ void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) { }); } +void TextNodeDumper::dumpTemplateArgument(const TemplateArgument &TA) { + llvm::SmallString<128> Str; + { +llvm::raw_svector_ostream SS(Str); +TA.print(PrintPolicy, SS,

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-27 Thread Matheus Izvekov via cfe-commits
@@ -1086,45 +1106,100 @@ void TextNodeDumper::VisitNullTemplateArgument(const TemplateArgument &) { void TextNodeDumper::VisitTypeTemplateArgument(const TemplateArgument &TA) { OS << " type"; - dumpType(TA.getAsType()); + dumpTemplateArgument(TA); } void TextNodeDumpe

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-27 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93431 >From 86e3852d0501bd24738c094359799c72781ad808 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 24 May 2024 12:22:55 -0300 Subject: [PATCH] [clang] Improve ast-dumper text printing of TemplateArgument

[clang] [clang] create class-type injected NTTP with correct value kind (PR #101395)

2024-07-31 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/101395 A template parameter object is an lvalue, which was not being respected for injected parameters. Fixes GH101394 >From 2d6d367408277b912c3db09cbbc7398c247c32c5 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov D

[clang] [clang] create class-type injected NTTP with correct value kind (PR #101395)

2024-07-31 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/101395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix classification of a string literal expression used as initializer (PR #101447)

2024-07-31 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/101447 Since 3bf72d7d64b8465acd4f4af1a469d68d9dc86058 we have made a simplification where we transform a string literal into a prvalue, where normally they would always be lvalues. This patch fixes expression classi

[clang] [clang] concepts: perform parameter mapping subsitution in correct context (PR #101745)

2024-08-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/101745 Prior to this patch, during constraint normalization we could forget from which declaration an atomic constraint was normalized from. Subsequently when performing parameter mapping substitution for that atomic

[clang] [clang] concepts: perform parameter mapping subsitution in correct context (PR #101745)

2024-08-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/101745 >From 5fa1cc61f46b14b06dc9c219add164d2f4eafe0d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 2 Aug 2024 16:53:11 -0300 Subject: [PATCH] [clang] concepts: perform parameter mapping subsitution in co

[clang] [Clang][Sema] Ensure that the selected candidate for a member function explicit specialization is more constrained than all others (PR #101721)

2024-08-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM But please give it some time for @zygoloid to take a look in case we are missing anything else. I see there are a few diagnostics sugar regressions, but they are not the fault of this patch, the issues are unrelated. https://github

[clang] [clang] concepts: perform parameter mapping substitution in correct context (PR #101745)

2024-08-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/101745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] support import return with UnaryTransformType (PR #101517)

2024-08-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/101517 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] support import return with UnaryTransformType (PR #101517)

2024-08-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM You can limit the amount of nodes traversed, but I don't expect this will have a significant impact. https://github.com/llvm/llvm-project/pull/101517 ___ cfe-commits mailing list cfe-commit

[clang] [clang][ASTImporter] support import return with UnaryTransformType (PR #101517)

2024-08-02 Thread Matheus Izvekov via cfe-commits
@@ -3636,6 +3636,10 @@ class IsTypeDeclaredInsideVisitor return {}; } + std::optional VisitUnaryTransformType(const UnaryTransformType *T) { +return CheckType(T->getBaseType()); mizvekov wrote: Strictly speaking, you only need to visit the base typ

[clang] [clang] create class-type injected NTTP with correct value kind (PR #101395)

2024-08-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/101395 >From 9e2dc4d465f2dc3d31bace2fca95b0656538b655 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 31 Jul 2024 16:54:02 -0300 Subject: [PATCH] [clang] create class-type injected NTTP with correct value k

[clang] [clang] create class-type injected NTTP with correct value kind (PR #101395)

2024-08-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/101395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] concepts: perform parameter mapping substitution in correct context (PR #101745)

2024-08-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I think this is simple enough that we could backport. https://github.com/llvm/llvm-project/pull/101745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] concepts: perform parameter mapping substitution in correct context (PR #101745)

2024-08-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/101745 >From 56c022ef412d311a82a34ae2add05457e53d31ec Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 2 Aug 2024 16:53:11 -0300 Subject: [PATCH] [clang] concepts: perform parameter mapping subsitution in co

[clang] [clang] concepts: perform parameter mapping substitution in correct context (PR #101745)

2024-08-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/101745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] remove unneeded template deduction canonicalizations (PR #101594)

2024-08-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/101594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] remove unneeded template deduction canonicalizations (PR #101594)

2024-08-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/101594 >From fd9bdcc17821be3d22e0787759cbdd6b077dbd90 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 1 Aug 2024 19:18:52 -0300 Subject: [PATCH] [clang] remove unneeded template deduction canonicalizations

[clang] [clang] remove unneeded template deduction canonicalizations (PR #101594)

2024-08-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/101594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [clang] Reland: Instantiate concepts with sugared template arguments (PR #101782)

2024-08-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/101782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [clang] Reland: Instantiate concepts with sugared template arguments (PR #101782)

2024-08-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/101782 >From 6a172a93121fdbeb0e58b33ec3140f150ecb524a Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sun, 23 Oct 2022 11:37:20 +0200 Subject: [PATCH] [clang] Reland: Instantiate concepts with sugared template a

[clang] [libcxx] [clang] Reland: Instantiate concepts with sugared template arguments (PR #101782)

2024-08-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Since this is relanding of patch that has been previously reviewed, with no notable changes except rebase and canonicalization when indexing the satisfaction cache, I am going to go ahead and merge. https://github.com/llvm/llvm-project/pull/101782 __

[clang] [libcxx] [clang] Reland: Instantiate concepts with sugared template arguments (PR #101782)

2024-08-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/101782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/101858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/101858 >From 1c6bfceea2a50b822a111996a481afe8fb8e522d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sun, 23 Oct 2022 16:57:12 +0200 Subject: [PATCH] [clang] Reland: Instantiate alias templates with sugar This

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/101858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > @mizvekov, do you have any idea how to get back the lost > `SubstTemplateTypeParmType`? It plays an important role in the IWYU tool > analysis. Thanks! So from my undertstanding, IWYU only needs the SubstTemplateTypeParmType for resugaring purposes, in order to recover the t

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

2024-08-05 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/100692 >From 3771ffabce14ab67f53d2a2f4357b0bd13c8088a Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 24 Jul 2024 03:59:41 -0300 Subject: [PATCH] [clang] check deduction consistency when partial ordering fu

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

2024-08-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @zygoloid ping, this is ready for another round of review. https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-05 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/100692 >From 561c9125d28c21676e4c28f0f04247433a860d62 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 24 Jul 2024 03:59:41 -0300 Subject: [PATCH] [clang] check deduction consistency when partial ordering fu

[clang] [Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (PR #100392)

2024-08-05 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/100392 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (PR #100392)

2024-08-05 Thread Matheus Izvekov via cfe-commits
@@ -8629,13 +8629,14 @@ ASTNodeImporter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) { return UnresolvedLookupExpr::Create( Importer.getToContext(), *ToNamingClassOrErr, *ToQualifierLocOrErr, *ToTemplateKeywordLocOrErr, ToNameInfo, E->requiresADL(),

[clang] [Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (PR #100392)

2024-08-05 Thread Matheus Izvekov via cfe-commits
@@ -8629,13 +8629,14 @@ ASTNodeImporter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) { return UnresolvedLookupExpr::Create( Importer.getToContext(), *ToNamingClassOrErr, *ToQualifierLocOrErr, *ToTemplateKeywordLocOrErr, ToNameInfo, E->requiresADL(),

[clang] [Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (PR #100392)

2024-08-05 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: I agree that the issue with many parameters is pre-existing. So you add a new flag to the UnresolvedLookupExpr which just forwards to the same flag in the base class OverloadExpr. OverloadExpr already suffers, even worse, from this problem of too many pa

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: The basic premise here was implemented back in D134604, and this has been for a few years applied in some cases, like substitution of default arguments. We leave a Subst* node behind with the purpose of somewhere down the line changing it back to what the user wrote. So we do

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: One possibility here is that if you have the type, then you will have a template specialization type for the template alias, and that gives you the template arguments used to specialize the alias. Which should answer this need. But of course, if you have a lossy semantic adjust

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I agree that we don't need `SubstTemplateTypeParmType` nodes if all > resuraging that we ever do is related to types that the Clang frontend itself > knows. However that is not universally true. > > For example, we (Google) have a tool for inferring and checking nullability

[clang] Return available function types for BindingDecls. (PR #102196)

2024-08-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Is this a bug fix? If so, do you have a test case for this? If the change is supposed to be user or API visible, a release note explaining it would also be useful. https://github.com/llvm/llvm-project/pull/102196 ___ cfe-commits maili

[clang] Return available function types for BindingDecls. (PR #102196)

2024-08-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Do you have a C++ source file example which presents misbehaviour when compiled through clang, which this change fixes? If so, you can reduce that example and add is as a regression test. These go in `clang/test/` and are basically composed of C++ source and some annotations to

[clang] Return available function types for BindingDecls. (PR #102196)

2024-08-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Is this a dataflow analysis in upstream clang, or is this something you are developing? https://github.com/llvm/llvm-project/pull/102196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [CodeGen][NFCI] Don't re-implement parts of ASTContext::getIntWidth (PR #101765)

2024-08-06 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. Yeah, looks NFC to me as well. LGTM https://github.com/llvm/llvm-project/pull/101765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [Clang] Fix crash when transforming a `DependentAddressSpaceType` (PR #102206)

2024-08-06 Thread Matheus Izvekov via cfe-commits
@@ -5838,7 +5839,7 @@ QualType TreeTransform::TransformDependentAddressSpaceType( } else { TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo( Result, getDerived().getBaseLocation()); -TransformType(TLB, DI->getTypeLoc()); +TLB.TypeWasModifie

[clang] [Clang] Fix crash when transforming a `DependentAddressSpaceType` (PR #102206)

2024-08-06 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, Thanks! https://github.com/llvm/llvm-project/pull/102206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [Frontend] fix crash on parsing ternary operator with `vector_size` condition (PR #102004)

2024-08-06 Thread Matheus Izvekov via cfe-commits
@@ -6719,6 +6719,16 @@ QualType Sema::CheckVectorConditionalTypes(ExprResult &Cond, ExprResult &LHS, : UsualArithmeticConversions(LHS, RHS, QuestionLoc, ACK_Conditional); +if (ResultElementTy.isNull()) { + Diag(Que

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I don't know, but it would be a lot of work, and would likely still mean > preserving the same information as `SubstTemplateTypeParmType` nodes > currently provide. > > Our scope is also larger than what Clang's resugarer aims to do, because for > our purposes sometimes ther

[clang] [C++20] [Modules] Don't set modules owner ship information for builtin declarations (PR #102115)

2024-08-06 Thread Matheus Izvekov via cfe-commits
@@ -2376,6 +2376,12 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, FunctionDecl *New = CreateBuiltin(II, R, ID, Loc); RegisterLocallyScopedExternCDecl(New, S); + // Builtin functions shouldn't be owned by any module. + if (New->hasOwningModule(

[clang] [C++20] [Modules] Don't set modules owner ship information for builtin declarations (PR #102115)

2024-08-06 Thread Matheus Izvekov via cfe-commits
@@ -2376,6 +2376,12 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, FunctionDecl *New = CreateBuiltin(II, R, ID, Loc); RegisterLocallyScopedExternCDecl(New, S); + // Builtin functions shouldn't be owned by any module. + if (New->hasOwningModule(

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Thanks! The functional part LGTM, there are just a few nits. https://github.com/llvm/llvm-project/pull/102287 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/102287 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -790,6 +790,11 @@ class ASTReader /// the consumer eagerly. SmallVector EagerlyDeserializedDecls; + /// The IDs of all vtables to emit. The referenced declarations are passed + /// to the consumers's HandleVTable eagerly after passing mizvekov wrote:

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -12432,7 +12432,7 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) { return false; // Variables in other module units shouldn't be forced to be emitted. - if (VD->isInAnotherModuleUnit()) + if (VD->shouldEmitInExternalSource()) mizvekov wrote:

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -5163,6 +5168,13 @@ void ASTWriter::PrepareWritingSpecialDecls(Sema &SemaRef) { // Write all of the DeclsToCheckForDeferredDiags. for (auto *D : SemaRef.DeclsToCheckForDeferredDiags) GetDeclRef(D); + + // Write all classes need to emit the vtable definitions if req

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -1216,6 +1228,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the cla

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -1081,29 +1081,41 @@ llvm::GlobalVariable::LinkageTypes CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) { if (!RD->isExternallyVisible()) return llvm::GlobalVariable::InternalLinkage; - - // We're at the end of the translation unit, so the current key - // f

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -1124,20 +1124,36 @@ bool Decl::isInAnotherModuleUnit() const { if (!M) return false; + // FIXME or NOTE: maybe we need to be clear about the semantics + // of clang header modules. e.g., if this lives in a clang header + // module included by the current unit, sho

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -5317,6 +5329,17 @@ void ASTWriter::WriteSpecialDeclRecords(Sema &SemaRef) { } if (!DeleteExprsToAnalyze.empty()) Stream.EmitRecord(DELETE_EXPRS_TO_ANALYZE, DeleteExprsToAnalyze); + + RecordData VTablesToEmit; + for (CXXRecordDecl *RD : PendingEmittingVTables) { +

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -1529,8 +1529,14 @@ void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) { if (D->isThisDeclarationADefinition()) Record.AddCXXDefinitionData(D); + if (D->isCompleteDefinition() && D->isInNamedModule()) +Writer.AddDeclRef(D, Writer.ModularCodegenDecls); +

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -18484,11 +18484,15 @@ bool Sema::DefineUsedVTables() { bool DefineVTable = true; -// If this class has a key function, but that key function is -// defined in another translation unit, we don't need to emit the -// vtable even though we're using it. c

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -1225,13 +1252,7 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { const FunctionDecl *Def; // Otherwise, if we don't have a definition of the key function, the // vtable must be defined somewhere else. - if (!keyFunction->hasBody(Def)) -return

[clang] [C++20] [Modules] Don't set modules owner ship information for builtin declarations (PR #102115)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -2376,6 +2376,12 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, FunctionDecl *New = CreateBuiltin(II, R, ID, Loc); RegisterLocallyScopedExternCDecl(New, S); + // Builtin functions shouldn't be owned by any module. + if (New->hasOwningModule(

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-07 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > We keep track of propagated and inferred nullability annotations in a [side > data > structure](https://github.com/google/crubit/blob/main/nullability/type_nullability.h#L185). > Our approach allows us to save on memory by not actually re-instantiating > everything with new

[clang] [C++20] [Modules] Don't set modules owner ship information for builtin declarations (PR #102115)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -2376,6 +2376,12 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, FunctionDecl *New = CreateBuiltin(II, R, ID, Loc); RegisterLocallyScopedExternCDecl(New, S); + // Builtin functions shouldn't be owned by any module. + if (New->hasOwningModule(

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/102287 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, Thanks! https://github.com/llvm/llvm-project/pull/102287 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -18075,6 +18075,15 @@ void Sema::ActOnTagFinishDefinition(Scope *S, Decl *TagD, if (NumInitMethods > 1 || !Def->hasInitMethod()) Diag(RD->getLocation(), diag::err_sycl_special_type_num_init_method); } + +// If we're defining a dynamic class in a module

[clang] Reland [C++20] [Modules] [Itanium ABI] Generate the vtable in the mod… (PR #102287)

2024-08-07 Thread Matheus Izvekov via cfe-commits
@@ -18075,6 +18075,15 @@ void Sema::ActOnTagFinishDefinition(Scope *S, Decl *TagD, if (NumInitMethods > 1 || !Def->hasInitMethod()) Diag(RD->getLocation(), diag::err_sycl_special_type_num_init_method); } + +// If we're defining a dynamic class in a module

[clang] [Clang][AST][NFC] Store template parameter position for TemplateTypeParmType in TypeBit (PR #102481)

2024-08-08 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM Are there any performance numbers worth mentioning? https://github.com/llvm/llvm-project/pull/102481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #102510)

2024-08-08 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/102510 There are some external projects that can't rely on our own sugar propagation for templated entities, because they need to resugar types which only exist within their framework, and so are entirely invisible t

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #102510)

2024-08-08 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/102510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-08 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > @mizvekov I will provide a more detailed response to the points you made in > your last message separately, but for now I would like to ask you to revert > the commit to unbreak us. @gribozavr see https://github.com/llvm/llvm-project/pull/102510 for alternative. > which mea

[clang] [Clang][AST][NFC] Store template parameter position for TemplateTypeParmType in TypeBit (PR #102481)

2024-08-08 Thread Matheus Izvekov via cfe-commits
@@ -6131,52 +6149,30 @@ class BTFTagAttributedType : public Type, public llvm::FoldingSetNode { class TemplateTypeParmType : public Type, public llvm::FoldingSetNode { friend class ASTContext; // ASTContext creates these - // Helper data collector for canonical types. - s

[clang] 3ad6dd5 - [clang] Use decltype((E)) for compound requirement type constraint

2021-03-30 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2021-03-30T22:00:33+02:00 New Revision: 3ad6dd5d8f0a70756f665e8179ad7c5210022c11 URL: https://github.com/llvm/llvm-project/commit/3ad6dd5d8f0a70756f665e8179ad7c5210022c11 DIFF: https://github.com/llvm/llvm-project/commit/3ad6dd5d8f0a70756f665e8179ad7c5210022c11.dif

[clang] bac74a5 - [clang] NFC: remove trailing white spaces from some tests

2021-04-02 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2021-04-03T03:18:22+02:00 New Revision: bac74a50e99f3d014d6e5a67272fd3b20eeb7fed URL: https://github.com/llvm/llvm-project/commit/bac74a50e99f3d014d6e5a67272fd3b20eeb7fed DIFF: https://github.com/llvm/llvm-project/commit/bac74a50e99f3d014d6e5a67272fd3b20eeb7fed.dif

[clang] 1819222 - [clang] tests: cleanup, update and add some new ones

2021-04-09 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2021-04-09T17:24:08+02:00 New Revision: 18192228602c6a8093fb0eefa863ab854dd03e59 URL: https://github.com/llvm/llvm-project/commit/18192228602c6a8093fb0eefa863ab854dd03e59 DIFF: https://github.com/llvm/llvm-project/commit/18192228602c6a8093fb0eefa863ab854dd03e59.dif

[clang] 489561d - [clang] fix typo correction not looking for candidates in base classes.

2021-10-15 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2021-10-16T00:35:22+02:00 New Revision: 489561d46381d41a068beed1a2e18e00f0660248 URL: https://github.com/llvm/llvm-project/commit/489561d46381d41a068beed1a2e18e00f0660248 DIFF: https://github.com/llvm/llvm-project/commit/489561d46381d41a068beed1a2e18e00f0660248.dif

[clang] d98c34f - [clang] fix error recovery ICE on copy elision when returing invalid variable

2021-09-03 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2021-09-03T20:34:08+02:00 New Revision: d98c34f4d7950f531661ba3f498222ccf6239a0f URL: https://github.com/llvm/llvm-project/commit/d98c34f4d7950f531661ba3f498222ccf6239a0f DIFF: https://github.com/llvm/llvm-project/commit/d98c34f4d7950f531661ba3f498222ccf6239a0f.dif

[clang] 68b9d8e - [clang] fix transformation of template arguments of 'auto' type constraints

2021-09-07 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2021-09-08T03:22:34+02:00 New Revision: 68b9d8ed7abe4046992ae1557990edfbb3a772bc URL: https://github.com/llvm/llvm-project/commit/68b9d8ed7abe4046992ae1557990edfbb3a772bc DIFF: https://github.com/llvm/llvm-project/commit/68b9d8ed7abe4046992ae1557990edfbb3a772bc.dif

[clang] 2d6829b - [clang] disable implicit moves when not in CPlusPLus

2021-09-14 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2021-09-14T11:29:47+02:00 New Revision: 2d6829bbbe6877920d9be1db93b9f3fc85b43d10 URL: https://github.com/llvm/llvm-project/commit/2d6829bbbe6877920d9be1db93b9f3fc85b43d10 DIFF: https://github.com/llvm/llvm-project/commit/2d6829bbbe6877920d9be1db93b9f3fc85b43d10.dif

[clang] [Clang] fix generic lambda inside requires-clause of friend function template (PR #99813)

2024-08-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. The assert was never added to the template template parameter case, but I think a test case might be good here. But in any case this LGTM. https://github.com/llvm/llvm-project/pull/99813 ___ cfe

[clang] [clang][ASTImporter] New fix for default template parameter values. (PR #101836)

2024-08-19 Thread Matheus Izvekov via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -5934,8 +5928,8 @@ ASTNodeImporter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) { ExpectedDecl ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { // For template arguments, we adopt the translat

<    3   4   5   6   7   8   9   10   11   12   >