[clang] [clang] fix RecursiveASTVisitor traversal from type to decl (PR #132551)

2025-03-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/132551 For that visitor, it is not expected that a type can traverse into a declaration. This makes the MemberPointer visitor conform to that rule. This turns the base class visitor into a CXXRecordType visitor, and

[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-22 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Thanks, for the report, will be fixed by https://github.com/llvm/llvm-project/pull/132551 https://github.com/llvm/llvm-project/pull/132401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [clang] fix RecursiveASTVisitor traversal from type to decl (PR #132551)

2025-03-22 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: It is a change but within the parameters of what the regressing commit already was. This is just changing what had already been changed there. https://github.com/llvm/llvm-project/pull/132551 ___ cfe-commits mailing list cfe-commits@li

[clang] [Clang][Sema] Retain the expanding index for unevaluated type constraints (PR #109518)

2025-03-22 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @zyn0217 I am having second thoughts on both this PR and the follow up fix https://github.com/llvm/llvm-project/commit/adb0d8ddceb143749c519d14b8b31b481071da77 We shouldn't be adding information that is required for correct substitution into `SubstTemplateTypeParmType `, it's

[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)

2025-03-24 Thread Matheus Izvekov via cfe-commits
@@ -3239,61 +3162,11 @@ bool Sema::SubstTypeConstraint( TC->getTemplateArgsAsWritten(); if (!EvaluateConstraints) { -bool ShouldExpandExplicitTemplateArgs = -TemplArgInfo && ArgumentPackSubstitutionIndex != -1 && -llvm::any_of(TemplArgInfo->argument

[clang] [Clang] Do not create dependent CallExpr having UnresolvedLookupExpr inside non-dependent context (PR #124609)

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

[clang] [Clang] Do not create dependent CallExpr having UnresolvedLookupExpr inside non-dependent context (PR #124609)

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

[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)

2025-03-24 Thread Matheus Izvekov via cfe-commits
@@ -3239,61 +3162,11 @@ bool Sema::SubstTypeConstraint( TC->getTemplateArgsAsWritten(); if (!EvaluateConstraints) { -bool ShouldExpandExplicitTemplateArgs = -TemplArgInfo && ArgumentPackSubstitutionIndex != -1 && -llvm::any_of(TemplArgInfo->argument

[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)

2025-03-24 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > The patch looks good overall, but as you've suggested that this is > incomplete, I think we want to go over it again after the cache part gets > adapted. My intention is to leave the main branch in a better state, not necessarily to finish everything here in one go. I think

[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)

2025-03-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/132626 >From 17bbac4d1f447a448168de629f44d8c227d468e5 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 22 Mar 2025 17:29:16 -0300 Subject: [PATCH 1/3] Revert "[Clang] Distinguish expanding-pack-in-place cases

[clang] [Clang] Implement CWG2517 Useless restriction on use of parameter in constraint-expression (PR #132919)

2025-03-25 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Yeah I agree with @zyn0217 here. Otherwise I haven't been able to take a look at the crash yet. https://github.com/llvm/llvm-project/pull/132919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] e70fe9b - NFC: fix typo in clang/test/AST/ast-dump-templates.cpp

2025-03-28 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2025-03-28T14:39:11-03:00 New Revision: e70fe9b264b6f98fd3744b514d7166f75dd19872 URL: https://github.com/llvm/llvm-project/commit/e70fe9b264b6f98fd3744b514d7166f75dd19872 DIFF: https://github.com/llvm/llvm-project/commit/e70fe9b264b6f98fd3744b514d7166f75dd19872.dif

[clang] Disable alias template CTAD for C++17 (PR #133597)

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

[clang] [clang] remove unused frontend flag -fretain-subst-template-type-parm-type-ast-nodes (PR #134177)

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

[clang] [clang-tools-extra] [clang] NFC: introduce UnsignedOrNone as a replacement for std::optional (PR #134142)

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

[clang] [clang] NFC: introduce UnsignedOrNone as a replacement for std::optional (PR #134142)

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

[clang] [clang] NFC: introduce UnsignedOrNone as a replacement for std::optional (PR #134142)

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

[clang] [clang] ASTContex: fix getCommonSugaredType for array types (PR #132559)

2025-03-25 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/132559 >From c60a98049cf62956917f5cf8ab8a846cb3c2aada Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 22 Mar 2025 14:39:10 -0300 Subject: [PATCH] [clang] ASTContex: fix getCommonSugaredType for array types

[clang] Reapply "[Clang] Improve diagnostics for expansion length mismatch" (PR #121044)

2025-03-24 Thread Matheus Izvekov via cfe-commits
@@ -749,132 +759,124 @@ ExprResult Sema::CheckPackExpansion(Expr *Pattern, SourceLocation EllipsisLoc, PackExpansionExpr(Context.DependentTy, Pattern, EllipsisLoc, NumExpansions); } +static bool IsUnexpandedPackExpansion(const TemplateArgument &TA) { + if (!TA.isPackExp

[clang] [clang-tools-extra] [clang] support pack expansions for trailing requires clauses (PR #133190)

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

[clang] [clang-tools-extra] [clang] support pack expansions for trailing requires clauses (PR #133190)

2025-04-02 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: All done with the comments here. https://github.com/llvm/llvm-project/pull/133190 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] support pack expansions for trailing requires clauses (PR #133190)

2025-04-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/133190 >From 4a6c03876d9f106df9913aeb66d484afc362454f Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 26 Mar 2025 18:38:34 -0300 Subject: [PATCH] [clang] support pack expansions for trailing requires clauses

[clang] [Sema] Handle AttributedType in template deduction with derived-to-base conversions (PR #134361)

2025-04-04 Thread Matheus Izvekov via cfe-commits
@@ -4446,7 +4446,7 @@ static bool AdjustFunctionParmAndArgTypesForDeduction( // transformed A can be a pointer to a derived class pointed to by // the deduced A. if (isSimpleTemplateIdType(ParamType) || - (isa(ParamType) && + (ParamType->getAs() &&

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-04-04 Thread Matheus Izvekov via cfe-commits
@@ -1355,7 +1355,7 @@ class BlockPointerTypeLoc : public PointerLikeTypeLochttps://github.com/llvm/llvm-project/pull/130537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [clang-tools-extra] [clang] NFC: Clear some uses of MemberPointerType::getClass (PR #131965)

2025-04-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @aeubanks Done, reverted, needed to revert another PR first. https://github.com/llvm/llvm-project/pull/131965 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix handling of pack indexing types in constraints of redeclaration (PR #139057)

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

[clang] [Clang] Fix handling of pack indexing types in constraints of redeclaration (PR #139057)

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

[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

2025-05-07 Thread Matheus Izvekov via cfe-commits
@@ -3102,11 +3103,15 @@ void CXXNameMangler::mangleType(QualType T) { addSubstitution(T); } -void CXXNameMangler::mangleCXXRecordDecl(const CXXRecordDecl *Record) { +void CXXNameMangler::mangleCXXRecordDecl(const CXXRecordDecl *Record, +

[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

2025-05-07 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Can you confirm that the intent here is to restore mangler behavior to what > it was prior to #132401, making the pair of PRs ABI-neutral? I a bit confused here as well. The description on the PR doesn't say this, but the patch seems to claim that https://github.com/llvm/llvm

[clang] [ItaniumMangle] Make sure class types are added to the dictionary of substitution candidates when compiling for older ABIs (PR #138947)

2025-05-07 Thread Matheus Izvekov via cfe-commits
@@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -fblocks -std=c++11 | FileCheck %s +// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -fblocks -std=c++11 | FileCheck --check-prefixes=CHECK,CHECK-ABI-LATEST %s +// RUN: %clang_c

[clang] Fix missing initializer for inline static template member with auto caused by delayed template instantiation. (PR #138122)

2025-05-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/138122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Stop changing DC when instantiating dependent friend specializations (PR #139436)

2025-05-11 Thread Matheus Izvekov via cfe-commits
@@ -5751,14 +5751,16 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, RebuildTypeSourceInfoForDefaultSpecialMembers(); SetDeclDefaulted(Function, PatternDecl->getLocation()); } else { -NamedDecl *ND = Function; -DeclContext *DC

[clang] [Clang][RFC] Do not eat SFINAE diagnostics for explicit template arguments (PR #139066)

2025-05-08 Thread Matheus Izvekov via cfe-commits
@@ -12166,6 +12174,15 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, diag::note_ovl_candidate_explicit_arg_mismatch_unnamed) << (index + 1); } + +if (PartialDiagnosticAt *PDiag = DeductionFailure.getSFINAEDiagnost

[clang] [Clang] Fix handling of pack indexing types in constraints of redeclaration (PR #139057)

2025-05-08 Thread Matheus Izvekov via cfe-commits
@@ -4174,6 +4174,14 @@ PackIndexingType::computeDependence(QualType Pattern, Expr *IndexExpr, return TD; } +void PackIndexingType::Profile(llvm::FoldingSetNodeID &ID, + const ASTContext &Context) { + if (hasSelectedType() && isFullySubstituted

[clang] [Clang] Reland: Diagnose invalid function types in dependent contexts (PR #139246)

2025-05-09 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Hello, it is helpful to include link to original landing attempt, and a brief description of what changed since last time, or otherwise explanation of why we go ahead and reland with no changes anyway. https://github.com/llvm/llvm-project/pull/139246 ___

[clang] Revert "[Clang] Diagnose invalid function types in dependent contexts (#138731)" (PR #139176)

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

[clang] [Clang] Stop changing DC when instantiating dependent friend specializations (PR #139436)

2025-05-13 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. Perfect, thanks! https://github.com/llvm/llvm-project/pull/139436 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Diagnose invalid function types in dependent contexts (PR #138731)

2025-05-08 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: This is reverted now. https://github.com/llvm/llvm-project/pull/138731 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang] Diagnose invalid function types in dependent contexts (#138731)" (PR #139176)

2025-05-08 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/139176 This reverts commit cf9b4d1e7961214deabd99a9fc3b1d4c9e78a71f. Causes breakages as reported here: https://github.com/llvm/llvm-project/pull/138731#issuecomment-2864298000 >From 57f8029736da494f1702fe76514e8119

[clang] [clang-tools-extra] [Clang] Add builtins that deduplicate and sort types (PR #106730)

2025-05-13 Thread Matheus Izvekov via cfe-commits
@@ -1666,6 +1685,21 @@ namespace { return inherited::TransformTemplateArgument(Input, Output, Uneval); } +using TreeTransform::TransformTemplateSpecializationType; +QualType +TransformTemplateSpecializationType(TypeLocBuilder &TLB, +

[clang] [clang] Add new warning: not eliding copy on return (missed NRVO) (PR #139973)

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

[clang] [clang-tools-extra] [Clang] Add builtins that deduplicate and sort types (PR #106730)

2025-05-14 Thread Matheus Izvekov via cfe-commits
@@ -1666,6 +1685,21 @@ namespace { return inherited::TransformTemplateArgument(Input, Output, Uneval); } +using TreeTransform::TransformTemplateSpecializationType; +QualType +TransformTemplateSpecializationType(TypeLocBuilder &TLB, +

[clang] [NFC][Clang] Adopt simplified `getTrailingObjects` in DeclCXX (PR #140078)

2025-05-15 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Hi, no objections to the patch, but I am wondering if there is a larger reason behind this effort to simplify all these uses of getTrailingObjects. Are you planning on an API change in this area for instance? https://github.com/llvm/llvm-project/pull/140078

[clang] [clang-tools-extra] [Clang] Add builtins that deduplicate and sort types (PR #106730)

2025-05-14 Thread Matheus Izvekov via cfe-commits
@@ -6484,6 +6499,57 @@ class SubstTemplateTypeParmType final } }; +/// Represents the result of substituting a set of types as a template argument +/// that needs to be expanded later. +/// +/// These types are always dependent and produced depending on the situations: +///

[clang] [clang] Add new warning: not eliding copy on return (missed NRVO) (PR #139973)

2025-05-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Thanks. This needs a few more tests. * A few tests to make sure we don't produce false positives. * Tests with function templates with placeholder return types. We should never be performing copy elision for these, due to implementation limitations. htt

[clang] [clang] Fix assertion failure in constexpr union deserialization (PR #140179)

2025-05-16 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM Something like: * Fixes serialization of constexpr structs containing unions. (#GH140130) https://github.com/llvm/llvm-project/pull/140179 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] [clang] Add new warning: not eliding copy on return (missed NRVO) (PR #139973)

2025-05-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Thank you for your feedback. I added more tests. By "function templates with > placeholder return types", do you mean something similar to create_object4 in > my test case? Yep. That's what I meant. https://github.com/llvm/llvm-project/pull/139973 ___

[clang] [clang] Add new warning: not eliding copy on return (missed NRVO) (PR #139973)

2025-05-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, Thanks! > I added several tests with dead branches. I noticed that Clang missed NRVO > opportunity in create_object5 test. I wonder if it is a know issue or not. > GCC seems to handle it. Yeah I think so, the current NRVO algorithm

[clang] [clang] Fix bad error recovery when classes are defined inside template (PR #142278)

2025-06-01 Thread Matheus Izvekov via cfe-commits
@@ -220,6 +220,14 @@ static ExprResult EvaluateAtomicConstraint( if (Inst.isInvalid()) return ExprError(); +if (const TemplateTypeParmType *TTPT = + dyn_cast(AtomicExpr->getType().getDesugaredType(S.Context))) { + TemplateTypeParmDecl *TTPD = TTPT->

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-02 Thread Matheus Izvekov via cfe-commits
@@ -1458,6 +1458,20 @@ will be processed from the PCH file. Otherwise, Clang will report an error. ``test.h`` since ``test.h`` was included directly in the source file and not specified on the command line using ``-include-pch``. +Ignoring a PCH File +^^^

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-02 Thread Matheus Izvekov via cfe-commits
@@ -31,6 +31,16 @@ option: $ clang -cc1 -include-pch test.h.pch test.c -o test.s +To ignore PCH options using ``clang -cc1``, use the option `-ignore-pch`: mizvekov wrote: That's not true, what happens is that some times, such as in this case, we have fla

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-02 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Thanks @mizvekov for your quick code review. I got a `Test Doc build` failure > https://github.com/llvm/llvm-project/actions/runs/15397135588. Following the > build steps, I managed to reproduce the error, but I am not sure how to fix > it. Is there any command to format *.rs

[clang] [clang] Serialization: support hashing null template arguments (PR #141890)

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

[clang] [clang] Serialization: support hashing null template arguments (PR #141890)

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

[clang] [clang] Serialization: support hashing null template arguments (PR #141890)

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

[clang] [clang] NFC: new tests and some cleanups on existing ones (PR #142293)

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

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-02 Thread Matheus Izvekov via cfe-commits
@@ -31,6 +31,16 @@ option: $ clang -cc1 -include-pch test.h.pch test.c -o test.s +To ignore PCH options using ``clang -cc1``, use the option `-ignore-pch`: mizvekov wrote: Ah okay, my bad for confusing those two options. Still, emit-pch isn't documented o

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-02 Thread Matheus Izvekov via cfe-commits
@@ -31,6 +31,16 @@ option: $ clang -cc1 -include-pch test.h.pch test.c -o test.s +To ignore PCH options using ``clang -cc1``, use the option `-ignore-pch`: mizvekov wrote: Here is how the flag is defined: ``` def include_pch : Separate<["-"], "include-pch"

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

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

[clang] [clang] Fix bad error recovery when classes are defined inside template (PR #142278)

2025-05-31 Thread Matheus Izvekov via cfe-commits
@@ -220,6 +220,14 @@ static ExprResult EvaluateAtomicConstraint( if (Inst.isInvalid()) return ExprError(); +if (const TemplateTypeParmType *TTPT = + dyn_cast(AtomicExpr->getType().getDesugaredType(S.Context))) { + TemplateTypeParmDecl *TTPD = TTPT->

[clang] [clang] NFC: introduce UnsignedOrNone as a replacement for std::optional (PR #134142)

2025-06-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Just noticed that this is not using `std::optional`. If this is > good, why don't we put this to `llvm/ADT`? I feel that is a better place. I don't disagree in principle, we just don't need to preempt making this available for all of llvm, if no one has the time to make a pat

[clang] [Clang] Fix the clang/test/PCH/ignored-pch.c test. (PR #144737)

2025-06-18 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/144737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

2025-06-23 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. The fix doesn't look quite right. It's not correct to say that canonicalization changes the declaration name. We don't canonicalize declarations after all. It's just that a canonical template parameter type doesn't refer to a

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-06-14 Thread Matheus Izvekov via cfe-commits
@@ -1480,6 +1480,14 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, return false; break; } + case Type::PredefinedSugar: { +const auto *TP1 = cast(T1); +const auto *TP2 = cast(T2); + +if (TP1->getKind() != TP2->getKind())

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-06-14 Thread Matheus Izvekov via cfe-commits
@@ -5148,6 +5153,14 @@ QualType ASTContext::getDependentBitIntType(bool IsUnsigned, return QualType(New, 0); } +QualType ASTContext::getPredefinedSugarType(uint32_t KD, +QualType UnderlyingType) const { + auto *New = new (*this,

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-06-14 Thread Matheus Izvekov via cfe-commits
@@ -2528,8 +2528,13 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const { Align = static_cast(Width); } } + break; + case Type::PredefinedSugar: +return getTypeInfo(cast(T)->desugar().getTypePtr()); +break; mizvekov wrote: `

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-06-14 Thread Matheus Izvekov via cfe-commits
@@ -7246,6 +7250,24 @@ QualType TreeTransform::TransformDependentBitIntType( return Result; } +template +QualType TreeTransform::TransformPredefinedSugarType( +TypeLocBuilder &TLB, PredefinedSugarTypeLoc TL) { + const PredefinedSugarType *EIT = TL.getTypePtr(); + Qua

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-06-14 Thread Matheus Izvekov via cfe-commits
@@ -1894,6 +1894,12 @@ ExpectedType clang::ASTNodeImporter::VisitDependentBitIntType( *ToNumBitsExprOrErr); } +ExpectedType clang::ASTNodeImporter::VisitPredefinedSugarType( +const clang::PredefinedSugarType *T) { +

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-06-14 Thread Matheus Izvekov via cfe-commits
@@ -8054,6 +8054,41 @@ class DependentBitIntType final : public Type, public llvm::FoldingSetNode { } }; +class PredefinedSugarType final : public Type { +public: + enum Kind { SizeT, SignedSizeT, PtrdiffT }; + friend class ASTContext; + +private: + Kind K; + QualType U

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-06-14 Thread Matheus Izvekov via cfe-commits
@@ -8054,6 +8054,41 @@ class DependentBitIntType final : public Type, public llvm::FoldingSetNode { } }; +class PredefinedSugarType final : public Type { +public: + enum Kind { SizeT, SignedSizeT, PtrdiffT }; + friend class ASTContext; + +private: + Kind K; + QualType U

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-06-14 Thread Matheus Izvekov via cfe-commits
@@ -117,3 +117,4 @@ def PipeType : TypeNode; def AtomicType : TypeNode; def BitIntType : TypeNode; def DependentBitIntType : TypeNode, AlwaysDependent; +def PredefinedSugarType : TypeNode, NeverCanonical; mizvekov wrote: Missing newline at the end of the file.

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-06-14 Thread Matheus Izvekov via cfe-commits
@@ -14536,6 +14589,9 @@ static QualType getCommonSugarTypeNode(ASTContext &Ctx, const Type *X, DX->isCountInBytes(), DX->isOrNull(), CDX); } + case Type::PredefinedSugar: { +return QualType(); +

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

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

[clang] [clang] AST: fix dependency calculation for TypedefTypes (PR #143291)

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

[clang] [clang][AST] Fix spaces in TypePrinter for some calling convs (PR #143160)

2025-06-06 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. Thanks, LGTM! You might want to consider adding a change to the ReleaseNotes before merging this. https://github.com/llvm/llvm-project/pull/143160 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [clang][AST] Fix spaces in TypePrinter for some calling convs (PR #143160)

2025-06-06 Thread Matheus Izvekov via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -triple aarch64 -ast-dump -ast-dump-filter foo %s \ +// RUN: | FileCheck --strict-whitespace %s + +// CHECK: {{foo1 'void \(\) __attribute__\(\(device_kernel\)\)'$}} mizvekov wrote: ```suggestion // CHECK: foo1 'void () __attr

[clang] [clang][AST] Fix spaces in TypePrinter for some calling convs (PR #143160)

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

[clang] [clang] AST: fix dependency calculation for TypedefTypes (PR #143291)

2025-06-08 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/143291 >From d623054729e75adc5299ecd426b19863962cafbc Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 7 Jun 2025 21:33:07 -0300 Subject: [PATCH] [clang] AST: fix dependency calculation for TypedefTypes The

[clang] [C++20][Modules] Fix false compilation error with constexpr (PR #143168)

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

[clang] add6acc - NFC: stray whitespace cleanup from clang/test/SemaCXX/destructor.cpp

2025-06-09 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2025-06-09T19:08:15-03:00 New Revision: add6acc333740542705eedd185f45f69e3d25f30 URL: https://github.com/llvm/llvm-project/commit/add6acc333740542705eedd185f45f69e3d25f30 DIFF: https://github.com/llvm/llvm-project/commit/add6acc333740542705eedd185f45f69e3d25f30.dif

[clang] [Clang][RFC] Resugar attributed type alias (PR #143143)

2025-06-06 Thread Matheus Izvekov via cfe-commits
@@ -6998,6 +7007,31 @@ namespace { else return C.getRValueReferenceType(New); } + case Elaborated: { +auto *ET = cast(Old); +return C.getElaboratedType(ET->getKeyword(), ET->getQualifier(), + wrap(C,

[clang] [Clang][RFC] Resugar attributed type alias (PR #143143)

2025-06-06 Thread Matheus Izvekov via cfe-commits
@@ -6998,6 +7007,31 @@ namespace { else return C.getRValueReferenceType(New); } + case Elaborated: { +auto *ET = cast(Old); +return C.getElaboratedType(ET->getKeyword(), ET->getQualifier(), + wrap(C,

[clang] [Clang][RFC] Resugar attributed type alias (PR #143143)

2025-06-06 Thread Matheus Izvekov via cfe-commits
@@ -6998,6 +7007,31 @@ namespace { else return C.getRValueReferenceType(New); } + case Elaborated: { +auto *ET = cast(Old); +return C.getElaboratedType(ET->getKeyword(), ET->getQualifier(), + wrap(C,

[clang] [Clang][RFC] Resugar attributed type alias (PR #143143)

2025-06-06 Thread Matheus Izvekov via cfe-commits
@@ -6998,6 +7007,31 @@ namespace { else return C.getRValueReferenceType(New); } + case Elaborated: { +auto *ET = cast(Old); +return C.getElaboratedType(ET->getKeyword(), ET->getQualifier(), + wrap(C,

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-09 Thread Matheus Izvekov via cfe-commits
@@ -324,6 +324,8 @@ New Compiler Flags - New option ``-Wnrvo`` added and disabled by default to warn about missed NRVO opportunities. +- New option ``-ignore-pch`` added to disable precompiled headers, override ``-emit-pch`` and ``-include-pch`` (#GH142409, `PCHDocs

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/142409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-06-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Thanks for this! I have left a small review, but since I am traveling to the WG21 meeting, I can't look much into it for the next couple of weeks. Also, please try this on the llvm compile time tracker, and take a look at any changes to the amount of AST

[clang] [clang] ms-abi: member pointer inheritance model lock-down fix (PR #145958)

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

[clang] [clang] ms-abi: member pointer inheritance model lock-down fix (PR #145958)

2025-06-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/145958 Lock down the inheritance model for member pointers even when converting from nullptr. This fixes a regression introduced in https://github.com/llvm/llvm-project/pull/131966 There are no release notes, since

[clang-tools-extra] [clang-tidy] NFCI: remove non-functional matcher from SizeofExpressionCheck (PR #142654)

2025-06-03 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/142654 This matcher would never match anything, because all record types as-written would be wrappen in an ElaboratedType. Just fixing that leads to a matcher which has too many false positives to be useful. The wa

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-04 Thread Matheus Izvekov via cfe-commits
@@ -3348,6 +3348,9 @@ defm pch_codegen: OptInCC1FFlag<"pch-codegen", "Generate ", "Do not generate ", "code for uses of this PCH that assumes an explicit object file will be built for the PCH">; defm pch_debuginfo: OptInCC1FFlag<"pch-debuginfo", "Generate ", "Do not generat

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-04 Thread Matheus Izvekov via cfe-commits
@@ -31,6 +31,16 @@ option: $ clang -cc1 -include-pch test.h.pch test.c -o test.s +To ignore PCH options, use the option `-ignore-pch`: + +.. code-block:: bash + + $ clang -cc1 test.h -emit-pch -ignore-pch -o test.h.pch + $ clang -cc1 -include-pch test.h.pch -ignore-pch te

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-04 Thread Matheus Izvekov via cfe-commits
@@ -4286,6 +4286,16 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args, YcArg = YuArg = nullptr; } + Arg *IncludePCHArg = Args.getLastArg(options::OPT_include_pch); + if (IncludePCHArg && (FinalPhase == phases::Preprocess || +

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-04 Thread Matheus Izvekov via cfe-commits
@@ -813,19 +813,19 @@ changes to one object won't affect the others, the object's initializer will run once per copy, etc. Specifically, this warning fires when it detects an object which: - 1. Is defined as ``inline`` in a header file (so it might get compiled into multipl

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-04 Thread Matheus Izvekov via cfe-commits
@@ -2982,6 +2982,7 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, #undef FRONTEND_OPTION_WITH_MARSHALLING Opts.ProgramAction = frontend::ParseSyntaxOnly; + mizvekov wrote: Unrelated change. https://github.com/llvm/llvm-project/pull

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-02 Thread Matheus Izvekov via cfe-commits
@@ -31,6 +31,16 @@ option: $ clang -cc1 -include-pch test.h.pch test.c -o test.s +To ignore PCH options using ``clang -cc1``, use the option `-ignore-pch`: mizvekov wrote: Do we really need to have this option in the frontend? Can't this all be implemented

[clang] [Frontend][PCH]-Add support for ignoring PCH options (-ignore-pch). (PR #142409)

2025-06-02 Thread Matheus Izvekov via cfe-commits
@@ -0,0 +1,6 @@ +#ifndef IGNORED_PCH_H +#define IGNORED_PCH_H +inline int f() { + return 42; +} +#endif // IGNORED_PCH_H mizvekov wrote: missing newline at the end of the file. https://github.com/llvm/llvm-project/pull/142409 ___

[clang] [clang] member pointer class qualification fix (PR #142081)

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

[clang] [clang] Serialization: support hashing null template arguments (PR #141890)

2025-05-29 Thread Matheus Izvekov via cfe-commits
@@ -65,7 +65,9 @@ void TemplateArgumentHasher::AddTemplateArgument(TemplateArgument TA) { switch (Kind) { case TemplateArgument::Null: -llvm_unreachable("Expected valid TemplateArgument"); +// These can occur in incomplete substitutions performed with code +//

[clang] [clang] Serialization: support hashing null template arguments (PR #141890)

2025-05-29 Thread Matheus Izvekov via cfe-commits
@@ -65,7 +65,9 @@ void TemplateArgumentHasher::AddTemplateArgument(TemplateArgument TA) { switch (Kind) { case TemplateArgument::Null: -llvm_unreachable("Expected valid TemplateArgument"); +// These can occur in incomplete substitutions performed with code +//

<    11   12   13   14   15   16   17   >