[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/

[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:

[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

[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

[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

[PATCH] D156546: [Clang][WIP]Experimental implementation of data member packs declarations

2023-08-16 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 550927. SlaterLatiao added a comment. - Refactor instantiating members into 2 functions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156546/new/ https://reviews.llvm.org/D156546 Files:

[PATCH] D158006: Member pack access in dependent context.

2023-08-15 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao created this revision. Herald added a project: All. SlaterLatiao requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D158006 Files:

[PATCH] D156546: [Clang][WIP]Experimental implementation of data member packs declarations

2023-08-01 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao marked an inline comment as done. SlaterLatiao added inline comments. Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:3289-3290 + Fields.push_back(PackedField); + if (NewMember->isInvalidDecl()) +Instantiation->setInvalidDecl();

[PATCH] D156546: [Clang][WIP]Experimental implementation of data member packs declarations

2023-08-01 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 546257. SlaterLatiao added a comment. - Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156546/new/ https://reviews.llvm.org/D156546 Files:

[PATCH] D156546: [Clang][WIP]Experimental implementation of data member packs declarations

2023-07-31 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao marked an inline comment as done. SlaterLatiao added inline comments. Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:3292-3295 + // FIXME: Eventually, a NULL return will mean that one of the + // instantiations was a semantic disaster, and

[PATCH] D156546: [Clang][WIP]Experimental implementation of data member packs declarations

2023-07-31 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 545804. SlaterLatiao added a comment. Fix code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156546/new/ https://reviews.llvm.org/D156546 Files: clang/lib/Sema/SemaTemplateInstantiate.cpp

[PATCH] D156546: [Clang][WIP]Experimental implementation of data member packs declarations

2023-07-28 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao added inline comments. Comment at: clang/test/CodeGenCXX/packed_data_member.cpp:8-12 +template struct S2 { +T t[2]; +Ts... ts; +}; + dblaikie wrote: > Did this test case come out of any particular bug discovered during > implementation? No.

[PATCH] D156546: [Clang][WIP]Experimental implementation of data member packs declarations

2023-07-28 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao added a comment. In D156546#4543697 , @dblaikie wrote: > (just a side note about the title of this patch: I got "packed data members" > confused and thought this was referring to struct packing > `__attribute__((packed))` - so perhaps

[PATCH] D156546: [Clang][WIP]Experimental implementation of data member packs declarations

2023-07-28 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 545297. SlaterLatiao added a comment. Address comments. - Added test case of duplicate types in template arguments. - Added ending new line to test case file. - Renamed "packed data members" -> "data member packs" Repository: rG LLVM Github Monorepo

[PATCH] D156546: [Clang][WIP]Experimental implementation of data member packs declarations

2023-07-28 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 545291. SlaterLatiao marked 2 inline comments as done. SlaterLatiao added a comment. Revert last commit. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156546/new/ https://reviews.llvm.org/D156546 Files:

[PATCH] D156546: [Clang][WIP]Experimental implementation of data member packs declarations

2023-07-28 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 545286. SlaterLatiao added a comment. - Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156546/new/ https://reviews.llvm.org/D156546 Files: clang/lib/AST/DeclPrinter.cpp

[PATCH] D156546: Experimental implementation of packed data member declaration

2023-07-28 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao created this revision. Herald added a project: All. SlaterLatiao requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D156546 Files:

[PATCH] D151575: [clang][diagnostics] Always show include stacks on errors

2023-07-07 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 538197. SlaterLatiao added a comment. - Emit include stack on all top-level diagnostics. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151575/new/ https://reviews.llvm.org/D151575 Files:

[PATCH] D151575: [clang][diagnostics] Always show include stacks on errors

2023-06-15 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 531885. SlaterLatiao added a comment. Remove unnecessary condition and assignment in implementation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151575/new/ https://reviews.llvm.org/D151575 Files:

[PATCH] D153068: Remove unnecessary condition and assignment.

2023-06-15 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao created this revision. Herald added a project: All. SlaterLatiao requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D153068 Files:

[PATCH] D151575: [clang][diagnostics] Always show include stacks on errors

2023-05-30 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 526717. SlaterLatiao added a comment. - Added release note. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151575/new/ https://reviews.llvm.org/D151575 Files: clang/docs/ReleaseNotes.rst

[PATCH] D151575: [clang][diagnostics] Always show include stacks on errors

2023-05-26 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 526144. SlaterLatiao added a comment. - Add newline to end of file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151575/new/ https://reviews.llvm.org/D151575 Files:

[PATCH] D151575: [clang][diagnostics] Always show include stacks on errors

2023-05-26 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao created this revision. Herald added a project: All. SlaterLatiao requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. - Fixes PR#62001. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D151575 Files:

[PATCH] D151162: Add -Wpacked-non-pod to -Wall

2023-05-25 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 525744. SlaterLatiao added a comment. Adding back the `-triple` flag - The padding size can be different on different architectures. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151162/new/

[PATCH] D151162: Add -Wpacked-non-pod to -Wall

2023-05-25 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao added a comment. I shouldn't remove `-triple=x86_64-none-none` in the test case. I'll add it back. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151162/new/ https://reviews.llvm.org/D151162

[PATCH] D151162: Add -Wpacked-non-pod to -Wall

2023-05-25 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao added a comment. In D151162#4373027 , @aaron.ballman wrote: > LGTM! Do you need someone to commit on your behalf? If so, what name and > email address would you like us to use for patch attribution? Thank you, Aaron! Please use Zenong

[PATCH] D151162: Add -Wpacked-non-pod to -Wall

2023-05-25 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 525654. SlaterLatiao added a comment. - Fix missing parenthesis. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151162/new/ https://reviews.llvm.org/D151162 Files: clang/docs/ReleaseNotes.rst

[PATCH] D151162: Add -Wpacked-non-pod to -Wall

2023-05-25 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 525653. SlaterLatiao added a comment. - Test behavior of `-Wpacked-non-pod` in `-Wall` and update test case name. - Update release note. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151162/new/

[PATCH] D151162: Add -Wpacked-non-pod to -Wall

2023-05-24 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao added a comment. In D151162#4369584 , @aaron.ballman wrote: > Please be sure to add a release note for the change, and it'd probably be > good to have a test case that shows this triggers under `-Wall` (the modified > test case explicitly

[PATCH] D151162: Add -Wpacked-non-pod to -Wall

2023-05-24 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao added inline comments. Comment at: clang/test/CodeGenCXX/warn-padded-packed.cpp:5 +// RUN: %clang_cc1 -triple=x86_64-none-none -Wpacked-non-pod -verify=top %s -emit-llvm-only +// RUN: %clang_cc1 -triple=x86_64-none-none -Wpacked-non-pod -fclang-abi-compat=15 %s

[PATCH] D151162: Add -Wpacked-non-pod to -Wall

2023-05-24 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 525280. SlaterLatiao added a comment. - Removed the -triple flag from warn-padded-packed testcase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151162/new/ https://reviews.llvm.org/D151162 Files:

[PATCH] D151162: Add -Wpacked-non-pod to -Wall

2023-05-23 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao updated this revision to Diff 524909. SlaterLatiao added a comment. Test -packed-non-pod not omitting warnings of "packed attribute is unnecessary". Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151162/new/

[PATCH] D151264: Test -Wpacked-non-pod does not emit warnings of "packed attribute is unnecessary"

2023-05-23 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao created this revision. Herald added a project: All. SlaterLatiao requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D151264 Files:

[PATCH] D151162: Add -Wpacked-non-pod to -Wall

2023-05-22 Thread Zenong Zhang via Phabricator via cfe-commits
SlaterLatiao created this revision. Herald added a project: All. SlaterLatiao requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D151162 Files: