[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-17 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao added inline comments. Comment at: clang/test/CodeGenCXX/data_member_packs.cpp:73 + // CHECK: i32 @_Z3sumIJiiEEDaDpT_(i32 noundef %ts, i32 noundef %ts1) + sum_pack2(s6); + // Check instantiation of sum(int, long, float, double) cjdb wrote: > This

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-17 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 551348. SlaterLatiao marked an inline comment as done. SlaterLatiao added a comment. - Added test case for partial expansion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158006/new/ https://reviews.llvm.

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-17 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao marked 4 inline comments as done. SlaterLatiao added inline comments. Comment at: clang/lib/Sema/TreeTransform.h:4171 + if (CXXDependentScopeMemberExpr *MemberExpr = + dyn_cast(Pattern)) { dblaikie wrote: > Might be worth pulling

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-17 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 551342. SlaterLatiao added a comment. - Make transforming expressions for member packs a separate function. - Minor edits based on review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158006/new/

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-17 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 551337. SlaterLatiao added a comment. - Minor fix on comment. - Replace string '+' with Twine. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158006/new/ https://reviews.llvm.org/D158006 Files: clang/inc

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-17 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 551253. SlaterLatiao marked 2 inline comments as done. SlaterLatiao added a comment. Remove changes in D156546 which doesn't belong to this patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-17 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao marked 6 inline comments as done. SlaterLatiao added inline comments. Comment at: clang/lib/Sema/SemaExprMember.cpp:523-524 + auto *TD = TST->getTemplateName().getAsTemplateDecl(); + assert(isa(TD) && + "template decl in member access is not Cla

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-17 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 551249. SlaterLatiao added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158006/new/ https://reviews.llvm.org/D158006 Files: clang/include/clang/AST/ExprCXX.h clang

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-16 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/Sema/SemaExprMember.cpp:519-521 + if (const ElaboratedType *ET = dyn_cast(BaseType)) { +if (const TemplateSpecializationType *TST = +dyn_cast(ET->getNamedType())) { I think you can skip the `c

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-16 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Sema/TreeTransform.h:4218 + Outputs.push_back(Out.get()); + Arg++; +} https://llvm.org/docs/CodingStandards.html#prefer-preincrement Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-16 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:3292 + std::string NewFieldName = + PackedField->getName().str() + "@" + std::to_string(Arg); + PackedField->setDeclName(&Context.Idents.get(NewFieldName)); --

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-15 Thread Denis Nikitin via Phabricator via cfe-commits
denik added inline comments. Comment at: clang/lib/Sema/SemaExprMember.cpp:528-529 +if (Field->getDeclName() == NameInfo.getName()) { + if (const PackExpansionType *PET = + dyn_cast(Field->getType())) { +isMemberPack = true; -

[PATCH] D158006: [Clang][WIP]Experimental implementation of data member packs in dependent context.

2023-08-15 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:3292 + std::string NewFieldName = + PackedField->getName().str() + "@" + std::to_string(Arg); + PackedField->setDeclName(&Context.Idents.get(NewFieldName)); -