[clang] [clang][Index] Use canonical function parameter types in USRs (PR #68222)

2023-10-04 Thread Matheus Izvekov via cfe-commits
@@ -265,10 +265,13 @@ void USRGenerator::VisitFunctionDecl(const FunctionDecl *D) { Out << '>'; } + QualType CanonicalType = D->getType().getCanonicalType(); // Mangle in type information for the arguments. - for (auto *PD : D->parameters()) { -Out << '#'; -

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

2023-10-04 Thread Matheus Izvekov via cfe-commits
@@ -146,6 +146,13 @@ Non-comprehensive list of changes in this release New Compiler Flags -- +* ``-fverify-intermediate-code`` and it's complement ``-fno-verify-intermediate-code``. + Enables or disables verification of the generated LLVM IR. + It's strongly

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

2023-10-04 Thread Matheus Izvekov via cfe-commits
@@ -146,6 +146,13 @@ Non-comprehensive list of changes in this release New Compiler Flags -- +* ``-fverify-intermediate-code`` and it's complement ``-fno-verify-intermediate-code``. + Enables or disables verification of the generated LLVM IR. + It's strongly

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

2023-10-04 Thread Matheus Izvekov via cfe-commits
@@ -146,6 +146,13 @@ Non-comprehensive list of changes in this release New Compiler Flags -- +* ``-fverify-intermediate-code`` and it's complement ``-fno-verify-intermediate-code``. + Enables or disables verification of the generated LLVM IR. + It's strongly

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

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

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

2023-10-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/68172 >From a5414db5e14cb40d062e54e780293cabc432197a Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 4 Oct 2023 04:39:11 +0200 Subject: [PATCH] [Clang][Driver] Add new flags to control IR verification ---

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

2023-10-04 Thread Matheus Izvekov via cfe-commits
@@ -146,6 +146,13 @@ Non-comprehensive list of changes in this release New Compiler Flags -- +* ``-fverify-intermediate-code`` and it's complement ``-fno-verify-intermediate-code``. + Enables or disables verification of the generated LLVM IR. + It's strongly

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

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

[clang] 0fb1ad5 - [Clang][CodeGen][NFC] Add (broken) test case for GH67937

2023-10-04 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2023-10-04T22:36:20+02:00 New Revision: 0fb1ad564e59a7259b81b7828fca272c762d30f5 URL: https://github.com/llvm/llvm-project/commit/0fb1ad564e59a7259b81b7828fca272c762d30f5 DIFF: https://github.com/llvm/llvm-project/commit/0fb1ad564e59a7259b81b7828fca272c762d30f5.dif

[clang] [Clang][CodeGen] Fix use of CXXThisValue with StrictVTablePointers (PR #68169)

2023-10-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/68169 >From bd6cb19d6261b46ff1c7014140eff59609134272 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 4 Oct 2023 02:40:25 +0200 Subject: [PATCH] [Clang][CodeGen] Fix use of CXXThisValue with StrictVTablePoin

[clang] [Clang][CodeGen] Fix use of CXXThisValue with StrictVTablePointers (PR #68169)

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

[clang] [Clang][CodeGen] Fix use of CXXThisValue with StrictVTablePointers (PR #68169)

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

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

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

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

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

[clang] [clang][Index] Use canonical function parameter types in USRs (PR #68222)

2023-10-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Also, would you make sure to add a test case for this? Thanks. https://github.com/llvm/llvm-project/pull/68222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

2023-10-05 Thread Matheus Izvekov via cfe-commits
@@ -5150,9 +5150,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, const bool IsAssertBuild = true; #endif - // Disable the verification pass in -asserts builds. mizvekov wrote: I edited the line to append the `unless otherwise specified

[clang] [AST] Only dump desugared type when visibly different (PR #65214)

2023-09-08 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Yep, I definitely I agree this is a good change, thanks for working on it! I thought about doing the same at the time, but I just didn't have the bandwidth for yet another patch with a lot of test churn :) https://github.com/llvm/llvm-project/pull/65214 _

[clang] [Clang][Sema] Treat explicit specializations of static data member templates declared without 'static' as static data members when diagnosing uses of 'auto' (PR #97425)

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

[clang] [Clang][Sema] Correctly transform dependent operands of overloaded binary operator& (PR #97596)

2024-07-03 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/97596 ___ 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 rebuilding MemberExprs with invalid object expressions (PR #97455)

2024-07-03 Thread Matheus Izvekov via cfe-commits
@@ -2896,6 +2896,9 @@ class TreeTransform { SS.Adopt(QualifierLoc); Base = BaseResult.get(); +if (Base->containsErrors()) + return ExprError(); mizvekov wrote: I am still traveling back from St Louis, so I can't double check this: Why is thi

[clang] [clang] Diagnose use of deprecated template alias (PR #97619)

2024-07-03 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: For reference, see https://reviews.llvm.org/D136533 for similar expansion of diagnostics for uses of declarations, and how that lead to trouble in MacOS land. I'd suggest building libc++ on MacOS, to be sure this won't cause regressions and a future revert. I have a MacOS mac

[clang] [Clang][Sema] Fix crash when rebuilding MemberExprs with invalid object expressions (PR #97455)

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

[clang] [clang] CTAD alias: fix transformation for require-clause expr Part2. (PR #93533)

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

[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

2024-07-08 Thread Matheus Izvekov via cfe-commits
@@ -99,3 +99,28 @@ BFoo b2(1.0, 2.0); // CHECK-NEXT: | | |-ParmVarDecl {{.*}} 'type-parameter-0-0' // CHECK-NEXT: | | `-ParmVarDecl {{.*}} 'type-parameter-0-0' // CHECK-NEXT: | `-CXXDeductionGuideDecl {{.*}} implicit used 'auto (double, double) -> Foo' implicit_instantiation +

[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

2024-07-08 Thread Matheus Izvekov via cfe-commits
@@ -2653,20 +2653,34 @@ struct ConvertConstructorToDeductionGuideTransform { // Find all template parameters that appear in the given DeducedArgs. // Return the indices of the template parameters in the TemplateParams. SmallVector TemplateParamsReferencedInTemplateArgumentList(

[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

2024-07-08 Thread Matheus Izvekov via cfe-commits
@@ -2653,20 +2653,34 @@ struct ConvertConstructorToDeductionGuideTransform { // Find all template parameters that appear in the given DeducedArgs. // Return the indices of the template parameters in the TemplateParams. SmallVector TemplateParamsReferencedInTemplateArgumentList(

[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

2024-07-08 Thread Matheus Izvekov via cfe-commits
@@ -2653,20 +2653,34 @@ struct ConvertConstructorToDeductionGuideTransform { // Find all template parameters that appear in the given DeducedArgs. // Return the indices of the template parameters in the TemplateParams. SmallVector TemplateParamsReferencedInTemplateArgumentList(

[clang] [Clang][Index] Add support for dependent class scope explicit specializations of function templates to USRGenerator (PR #98027)

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

[clang] [Sema] Fix crash in Sema::FindInstantiatedDecl (PR #96509)

2024-07-08 Thread Matheus Izvekov via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -6300,7 +6300,7 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, getTrivialTemplateArgumentLoc(UnpackedArg, QualType(), Loc)); } QualType T = CheckT

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

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

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

2024-09-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Thanks for the reduction. I can work with this reduction, but keep in mind that it's better to disable the c-reduce pass which renames things. The reason is that if this is a problem in SPEC that needs to be fixed, then having the names preserved would help locate which part o

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

2024-09-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: The problem is that I am not sure yet whether this is a breakage that is intended by this patch, and so SPEC should be fixed, or if that is otherwise something that could be fixed in this patch. It's bedtime now, my shift for today is over, so I'll only be able to take a look

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Oh cool, this is CWG2398 TTP-on-Class, this is fixed by https://github.com/llvm/llvm-project/pull/94981 :) On the SPEC source code side, this is probably similar to the xtensor breakage we got a while ago, there is probably a macro guard somewhere that should be expanded to co

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Yep, there is probably a macro somewhere guarding against GCC and possibly also c++ standards from C++17 up. That should be replaced by a macro guarding for `__cpp_template_template_args <= 201611L` instead. https://github.com/llvm/llvm-project/pull/100692 _

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Yep, GCC gates __cpp_template_template_args on C++17 and above. We went with unrestricted enablement on clang, mainly because we thought we would have a full backwards compatibility solution by now. As I said, this is fixed by https://github.com/llvm/llvm-project/pull/94981, b

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: By the way, just realized I should mention this, but we still support '-fno-relaxed-template-template-args', if anything, you could compile SPEC with that flag in order to workaround this breakage meanwhile, until the above patch is merged. https://github.com/llvm/llvm-project

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
@@ -9219,7 +9222,8 @@ class Sema final : public SemaBase { /// \returns true if an error occurred, false otherwise. bool CheckTemplateArgumentList( TemplateDecl *Template, SourceLocation TemplateLoc, - TemplateArgumentListInfo &TemplateArgs, bool PartialTemplateA

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
@@ -412,6 +445,30 @@ class SubstTemplateTemplateParmStorage std::optional PackIndex); }; +class DeducedTemplateStorage : public UncommonTemplateNameStorage, mizvekov wrote: This one is a too internal detail of how the different kinds of

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
@@ -645,6 +645,9 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, // It is sufficient to check value of getAsTemplateDecl. break; + case TemplateName::DeducedTemplate: + // FIXME: We can't reach here. + llvm_unreachable("unimp

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
@@ -1371,11 +1371,17 @@ class TemplateDiff { /// argument info into a tree. void DiffTemplate(const TemplateSpecializationType *FromTST, const TemplateSpecializationType *ToTST) { +// FIXME: With P3310R0, A TST formed from a DeducedTemplateName might

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
@@ -326,6 +320,48 @@ namespace classes { // expected-error@-1 {{no matching function for call}} } } // namespace packs + namespace nested { mizvekov wrote: The test case from 100692 doesn't have anything interesting new on top of this one. There

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
@@ -139,28 +165,63 @@ TemplateName::NameKind TemplateName::getKind() const { return AssumedTemplate; if (uncommon->getAsSubstTemplateTemplateParm()) return SubstTemplateTemplateParm; + if (uncommon->getAsDeducedTemplateName()) +return DeducedTemplate; + + assert

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
@@ -1198,6 +1198,18 @@ void TextNodeDumper::dumpBareTemplateName(TemplateName TN) { dumpTemplateName(STS->getReplacement(), "replacement"); return; } + case TemplateName::DeducedTemplate: { +OS << " deduced"; +const DeducedTemplateStorage *DTS = TN.getAsDedu

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
@@ -5327,9 +5332,29 @@ bool Sema::CheckTemplateArgumentList( SmallVector CanonicalArgumentPack; unsigned ArgIdx = 0, NumArgs = NewArgs.size(); LocalInstantiationScope InstScope(*this, true); - for (TemplateParameterList::iterator Param = Params->begin(), -

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
@@ -139,28 +165,63 @@ TemplateName::NameKind TemplateName::getKind() const { return AssumedTemplate; if (uncommon->getAsSubstTemplateTemplateParm()) return SubstTemplateTemplateParm; + if (uncommon->getAsDeducedTemplateName()) +return DeducedTemplate; + + assert

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
@@ -2143,15 +2107,17 @@ static TemplateDeductionResult DeduceTemplateArgumentsByTypeMatch( unsigned SubTDF = TDF & TDF_IgnoreQualifiers; if (auto Result = DeduceTemplateArgumentsByTypeMatch( S, TemplateParams, PPT, APT, Info, Deduced, SubTDF, -

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

2024-09-05 Thread Matheus Izvekov via cfe-commits
@@ -6803,9 +6809,6 @@ bool CXXNameMangler::mangleSubstitution(QualType T) { } bool CXXNameMangler::mangleSubstitution(TemplateName Template) { - if (TemplateDecl *TD = Template.getAsTemplateDecl()) -return mangleSubstitution(TD); - mizvekov wrote: This o

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

2024-09-07 Thread Matheus Izvekov via cfe-commits
@@ -6753,16 +6758,41 @@ ASTContext::getNameForTemplate(TemplateName Name, case TemplateName::UsingTemplate: return DeclarationNameInfo(Name.getAsUsingShadowDecl()->getDeclName(), NameLoc); + case TemplateName::DeducedTemplate: { +Deduce

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

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

[clang] [clang-tools-extra] [clang] Finish implementation of P0522 (PR #96023)

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

[clang] [clang] Finish implementation of P0522 (PR #96023)

2024-09-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/96023 >From b29e3d3285a414df74a75404c6fe4a39f4a0725d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 17 Jun 2024 21:39:08 -0300 Subject: [PATCH] [clang] Finish implementation of P0522 This finishes the clan

[clang] [clang] Finish implementation of P0522 (PR #96023)

2024-09-07 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I believe we have achieved consensus on getting rid of the fallback rules, and this patch does not do much beyond that, if anything. https://github.com/llvm/llvm-project/pull/96023 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [clang] correct argument offset for function template partial ordering (PR #107972)

2024-09-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/107972 This fixes a bug in #18291, that was reported in the PR. Since this is a bug fix for a patch that was never released, no entries are added to the changelog. >From 395ddd73b4dd366155a8718c13410b03bf8c6d32 Mon

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

2024-09-09 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @alexfh That's a bug in the patch, thanks for reporting. This patch fixes it: https://github.com/llvm/llvm-project/pull/107972 https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [clang] correct argument offset for function template partial ordering (PR #107972)

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

[clang] [clang-tools-extra] [llvm] [clang] WIP: Improved Context Declaration tracking (PR #107942)

2024-09-10 Thread Matheus Izvekov via cfe-commits
@@ -6291,7 +6307,8 @@ bool Parser::isDeclarationSpecifier( bool Parser::isConstructorDeclarator(bool IsUnqualified, bool DeductionGuide, DeclSpec::FriendSpecified IsFriend, const ParsedTemplateInfo *Templ

[clang] [clang-tools-extra] [llvm] [clang] WIP: Improved Context Declaration tracking (PR #107942)

2024-09-10 Thread Matheus Izvekov via cfe-commits
@@ -254,6 +254,33 @@ class CXXBaseSpecifier { TypeSourceInfo *getTypeSourceInfo() const { return BaseTypeInfo; } }; +class ContextDeclOrSentinel { + uintptr_t Pointer; + +public: + ContextDeclOrSentinel(Decl *Pointer) : Pointer(uintptr_t(Pointer)) {} + explicit ContextDec

[clang] [clang-tools-extra] [llvm] [clang] WIP: Improved Context Declaration tracking (PR #107942)

2024-09-10 Thread Matheus Izvekov via cfe-commits
@@ -961,6 +961,7 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction( if (MLTAL.getNumSubstitutedLevels() == 0) return ConstrExpr; + MLTAL.setKind(TemplateSubstitutionKind::Rewrite); mizvekov wrote: The new difference introduced in

[clang] [clang-tools-extra] [llvm] [clang] WIP: Improved Context Declaration tracking (PR #107942)

2024-09-10 Thread Matheus Izvekov via cfe-commits
@@ -18770,12 +18832,6 @@ bool Sema::tryCaptureVariable( if (CapturingFunctionScopes == 0 && (!BuildAndDiagnose || VarDC == DC)) return true; - // Exception: Function parameters are not tied to the function's DeclContext - // until we enter the function definition. Capt

[clang] [clang-tools-extra] [llvm] [clang] WIP: Improved Context Declaration tracking (PR #107942)

2024-09-10 Thread Matheus Izvekov via cfe-commits
@@ -19000,7 +19056,7 @@ bool Sema::tryCaptureVariable( Explicit = false; FunctionScopesIndex--; if (IsInScopeDeclarationContext) - DC = ParentDC; + DC = skipRequiresBody(ParentDC); mizvekov wrote: That is one of your tests actually: `cla

[clang] [clang] correct argument offset for function template partial ordering (PR #107972)

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

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

2024-08-08 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/102551 This reverts commit 748371183ae769bfb485f1e7466a864bf1db93d5. Reverted due to both regression reported on PR and #102253 >From cce965741a7496f792e3f94f47ae5acba06c4c39 Mon Sep 17 00:00:00 2001 From: Matheus Iz

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

2024-08-08 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/102551 >From c70e98cef58982fd7afb896fe08ebacc8b752009 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 8 Aug 2024 20:18:01 -0300 Subject: [PATCH] Revert "[clang] Reland: Instantiate concepts with sugared tem

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

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

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

2024-08-08 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > (It's #102353) Updated, thanks for the correction. https://github.com/llvm/llvm-project/pull/102551 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

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

2024-08-08 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > The description specifies "Reverted due to both regression reported on PR and > https://github.com/llvm/llvm-project/issues/102353"; but somehow the commit > message does not include the reason. > > (I just tried to look at reverts without reasons and remind the authors.) I

[clang] Resolve FIXME: Look at E, not M (PR #85541)

2024-08-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Hmm. The best solution there is probably to use a consistent representation > but introduce some sort of `GLValueThatTheStandardAbsurdlyPretendsIsAnRValue` > (definitely the only and best word for this, ship it) that we can use as the > value category. IIRC, something similar

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

2024-08-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > It is not only valuable to external resugarers. Another point that warrants > an introduction of it is for unevaluated lambdas. These lambdas e.g. > appearing as part of the `using Alias = decltype(lambda)` could carry a > requires expression and thus evaluating it requires t

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

2024-08-13 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I think using "broken" in the name of the diagnostic and the internal option > is a bit problematic -- that's too much of a value judgement, IMO. After all, > the previous functionality worked well enough for those folks. > > > > Would it make more sense to name it somethin

[clang] [Clang][NFCI] Slightly refactor getTemplateInstantiationArgs() (PR #102922)

2024-08-13 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: I think I'd need to see how you would use it, to say if this would be the best approach. It's not clear to me why we would want to navigate to a DC that is unrelated to the passed ND. Can we at least assert the DC would be a parent (Lexical or Semantic)

[clang] [Clang][NFCI] Slightly refactor getTemplateInstantiationArgs() (PR #102922)

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

[clang] [Clang][NFCI] Slightly refactor getTemplateInstantiationArgs() (PR #102922)

2024-08-13 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I think we could instead simplify the function to the following signature: ```C++ MultiLevelTemplateArgumentList Sema::getTemplateInstantiationArgs( const Decl *D, bool LexicalParent, bool Final, .) ``` Ie we take a single decl, which we will assume is a NamedDecl in case

[clang] [Clang][NFCI] Slightly refactor getTemplateInstantiationArgs() (PR #102922)

2024-08-13 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Thinking twice, I think this is probably feasible to go. As an internal flag > wouldn't be exposed to users, but we might have to refactor the function a > lot more. Yep. Just don't forget to assert in case the template arguments wouldn't get added, to diagnose users passing

[clang] [Clang][Sema] Rebuild template parameters for out-of-line template definitions and partial specializations (PR #104030)

2024-08-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM As a note, it's helpful to pre-commit on an NFC patch all these test cases, and then on the main PR we can see just which test cases changed behavior. Which I see here are the three test cases at lines 76-78, 84-86, and 96-98. htt

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

2024-08-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed 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] Add frontend flag to enable support for broken external resugarers (PR #102510)

2024-08-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Closed as completed elsewhere. 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] check deduction consistency when partial ordering function templates (PR #100692)

2024-08-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @zygoloid ping, this is ready for another look. 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] prevent null explicit object argument from being deduced (PR #104328)

2024-08-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: I'd have expected we would have a previous step analogous to CheckTemplateArgument which would have diagnosed null explicit arguments, before we started trying to deduce anything. https://github.com/llvm/llvm-project/pull/104328 __

[clang] [Clang] prevent null explicit object argument from being deduced (PR #104328)

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

[clang] [Clang] prevent null explicit object argument from being deduced (PR #104328)

2024-08-15 Thread Matheus Izvekov via cfe-commits
@@ -4462,6 +4462,9 @@ TemplateDeductionResult Sema::DeduceTemplateArguments( ParamTypesForArgChecking.push_back(ParamType); if (ParamIdx == 0 && HasExplicitObject) { +if (ObjectType.isNull()) + return TemplateDeductionResult::InvalidExplicitArgumen

[clang] [Clang] prevent null explicit object argument from being deduced (PR #104328)

2024-08-15 Thread Matheus Izvekov via cfe-commits
@@ -4462,6 +4462,9 @@ TemplateDeductionResult Sema::DeduceTemplateArguments( ParamTypesForArgChecking.push_back(ParamType); if (ParamIdx == 0 && HasExplicitObject) { +if (ObjectType.isNull()) + return TemplateDeductionResult::InvalidExplicitArgumen

[clang] [Clang] prevent null explicit object argument from being deduced (PR #104328)

2024-08-15 Thread Matheus Izvekov via cfe-commits
@@ -4462,6 +4462,9 @@ TemplateDeductionResult Sema::DeduceTemplateArguments( ParamTypesForArgChecking.push_back(ParamType); if (ParamIdx == 0 && HasExplicitObject) { +if (ObjectType.isNull()) + return TemplateDeductionResult::InvalidExplicitArgumen

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

2024-04-14 Thread Matheus Izvekov via cfe-commits
@@ -831,7 +831,7 @@ class PackDeductionScope { if (IsPartiallyExpanded) PackElements += NumPartialPackArgs; else if (IsExpanded) - PackElements += *FixedNumExpansions; + PackElements += FixedNumExpansions.value_or(1); mizvekov wrote: Th

[clang] [clang][Index] Use canonical function parameter types in USRs (PR #68222)

2024-04-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @sdkrystian ping, do you still intend to continue this? Just adding your example as a test case would be fine. https://github.com/llvm/llvm-project/pull/68222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

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

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-14 Thread Matheus Izvekov via cfe-commits
@@ -13435,8 +13435,7 @@ void Sema::checkNonTrivialCUnion(QualType QT, SourceLocation Loc, void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { // If there is no declaration, there was an error parsing it. Just ignore // the initializer. - if (!R

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-14 Thread Matheus Izvekov via cfe-commits
@@ -13456,6 +13455,14 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { return; } + if (VDecl->isInvalidDecl()) { +CorrectDelayedTyposInExpr(Init, VDecl); +VDecl->setInit( +CreateRecoveryExpr(Init->getBeginLoc(), Init->ge

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. Thanks for the improvement! Can you also add a test case? https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-14 Thread Matheus Izvekov via cfe-commits
@@ -1061,6 +1070,16 @@ CodeGenAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { CI.getPreprocessor().addPPCallbacks(std::move(Callbacks)); } + if (CI.getFrontendOpts().GenReducedBMI && + !CI.getFrontendOpts().ModuleOutputPath.empty()) { +std:

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

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

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-14 Thread Matheus Izvekov via cfe-commits
@@ -4045,6 +4045,24 @@ static bool RenderModulesOptions(Compilation &C, const Driver &D, // module fragment. CmdArgs.push_back("-fskip-odr-check-in-gmf"); + if (Args.hasArg(options::OPT_modules_reduced_bmi) && + (Input.getType() == driver::types::TY_CXXModule || +

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. I share the objections that it may be too soon to introduce a driver flag for this. Only a frontend flag is ok for now, but it's non blocking on my side because it doesn't look like it will be particularly hard to deprecate it later. http

[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I would normally have no issue making the changes needed to other projects, and I mostly try to do that. But lldb sets itself apart in how hard it is to get a project setup going, and how impactful it is. It's a bit concerning when the changes needed are quite trivial, for exam

[clang] [clang] NFCI: Make ASTContext optional again (PR #94522)

2024-06-05 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/94522 Previous patches 3cabbf60393cc8d55fe635e35e89e5973162de33 and 1a2f3309765fdc143fdc3809211fb85d2e2ca341 broke the assumption that the AST Context was optional for the text node dumper. While missing an ASTConte

[clang] [clang] NFCI: Make ASTContext optional in the AST text dumper again (PR #94522)

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

[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Can you elaborate on what specifically you find hard? Building should be > fairly straightforward, besides Python and SWIG, which are required to run > the tests, most of our dependencies are optional. Unlike the compiler, the > debugger is (1) tied to the system it's running

[clang] [clang] NFCI: Make ASTContext optional in the AST text dumper again (PR #94522)

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

[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > > 2. Build system does not support Multi-config generators. You can grep for > > https://cmake.org/cmake/help/latest/variable/CMAKE_CFG_INTDIR.html as an > > example. > > This simply isn't true. Xcode is a multi-config build system and we have [a > bot](https://ci.swift.org/

[clang] [Clang][Sema][TemplateDeduction] Skip pack expansion type at the end of default template argument list if unneeded (PR #94659)

2024-06-06 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. Please include test case. https://github.com/llvm/llvm-project/pull/94659 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

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