[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-11-19 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D153701#4656920 , @Endill wrote: > @yronglin We are sorry it takes so much time to get feedback. Richard and > Hubert have little bandwidth for reviews. Others, including me, don't feel > qualified to provide good feedback.

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-11-16 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-11-07 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. friendly ping~ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-11-02 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. ping~ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-10-24 Thread Yurong via Phabricator via cfe-commits
yronglin marked an inline comment as done. yronglin added a comment. ping~ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 ___ cfe-commits mailing list cfe-comm

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-10-14 Thread Yurong via Phabricator via cfe-commits
yronglin marked 2 inline comments as done. yronglin added a comment. @rsmith Thanks a lot for your comments and sorry for the very late reply, I was on vacation some time ago. In D153701#4643609 , @rsmith wrote: > The changes in `SemaInit.cpp` don't loo

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-10-14 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 557705. yronglin added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse/ParseDecl.cpp c

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-09-11 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. ping~ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-09-06 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 556035. yronglin added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse/ParseDecl.cpp c

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-09-04 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. ping~ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[PATCH] D158296: [clang] Diagnose overly complex Record in __builtin_dump_struct

2023-09-01 Thread Yurong via Phabricator via cfe-commits
yronglin marked 4 inline comments as done. yronglin added a comment. Thank you for your review @aaron.ballman @rsmith , I will be happy to continue cook this patch once we reach a consensus. Comment at: clang/lib/Sema/SemaChecking.cpp:732-733 +int RDKind = RD->isClass() ?

[PATCH] D158296: [clang] Diagnose overly complex Record in __builtin_dump_struct

2023-09-01 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 555376. yronglin added a comment. Address Aaron's comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158296/new/ https://reviews.llvm.org/D158296 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-08-30 Thread Yurong via Phabricator via cfe-commits
yronglin marked 2 inline comments as done. yronglin added inline comments. Comment at: clang/include/clang/AST/Stmt.h:596-597 -// These don't need to be particularly wide, because they're -// strictly limited by the forms of expressions we permit. -unsigned NumSubEx

[PATCH] D158296: [NFC][Clang] Add assertion to check the value of NumSubExprs/ResultIndex does not overflow

2023-08-30 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 554770. yronglin added a comment. Addres the comments that we talked in D154784 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158296/new/ https://reviews.llvm.org/D158296

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-29 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. friendly ping~ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-08-24 Thread Yurong via Phabricator via cfe-commits
yronglin marked 2 inline comments as done. yronglin added inline comments. Comment at: clang/include/clang/AST/Stmt.h:596-597 -// These don't need to be particularly wide, because they're -// strictly limited by the forms of expressions we permit. -unsigned NumSubEx

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-24 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. ping~ @hubert.reinterpretcast @rsmith Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 ___ cfe-commits mailing list cfe-commits@lists.l

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-21 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 552009. yronglin marked 7 inline comments as done. yronglin added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/include/

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-21 Thread Yurong via Phabricator via cfe-commits
yronglin marked 4 inline comments as done. yronglin added a comment. @cor3ntin Thanks for your review! Comment at: clang/include/clang/Sema/Sema.h:1357 +/// Whether rewrite the default argument. +bool IsRewriteDefaultArgument = false; + cor3ntin wrote:

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-20 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 551871. yronglin added a comment. Do not spass MaterializePRValueInDiscardStatement in PushExpressionEvaluationContext. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D1537

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-20 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 551851. yronglin added a comment. Fix ci Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse/ParseDecl.cpp c

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-20 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 551845. yronglin added a comment. Fix ci failure, and introduce an variable in ExpressionEvaluationContextRecord to rewrite default argument. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-08-19 Thread Yurong via Phabricator via cfe-commits
yronglin added inline comments. Comment at: clang/include/clang/AST/Stmt.h:596-597 -// These don't need to be particularly wide, because they're -// strictly limited by the forms of expressions we permit. -unsigned NumSubExprs : 8; -unsigned ResultIndex : 32 - 8

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-08-19 Thread Yurong via Phabricator via cfe-commits
yronglin marked an inline comment as done. yronglin added inline comments. Comment at: clang/include/clang/AST/Stmt.h:596-597 -// These don't need to be particularly wide, because they're -// strictly limited by the forms of expressions we permit. -unsigned NumSubEx

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-08-18 Thread Yurong via Phabricator via cfe-commits
yronglin marked 3 inline comments as done. yronglin added inline comments. Comment at: clang/include/clang/AST/Stmt.h:596-597 -// These don't need to be particularly wide, because they're -// strictly limited by the forms of expressions we permit. -unsigned NumSubEx

[PATCH] D158296: [Clang] Add assertion to check the value of NumSubExprs/ResultIndex does not overflow

2023-08-18 Thread Yurong via Phabricator via cfe-commits
yronglin created this revision. Herald added a subscriber: arphaman. Herald added a project: All. yronglin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Signed-off-by: yronglin Repository: rG LLVM Github Monorepo https://reviews.llv

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-16 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. friendly ping~ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-14 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D153701#4563919 , @yronglin wrote: > Sorry for the late reply. I tried to investigate the memory impact of > creating these additional materializations by build the whole llvm-project > and compare the number of `Materializ

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-14 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. @cor3ntin I have reused `EnsureImmediateInvocationInDefaultArgs` to rewrite `CXXDefaultArgExpr`, does this is a correct approach? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-14 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 549896. yronglin added a comment. Add test to check generated LLVM IR, and fix crash. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/include/clang/Se

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-13 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. Should we dump the real default argument AST but not only `CXXDefaultArgExpr` if `CXXDefaultArgExpr` has been rewritted? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-13 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. FIXME: Need add test in `clang/test/CXX/special/class.temporary/p6.cpp` to check generated LLVM IR. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 _

[PATCH] D153701: [WIP][Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-13 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 549715. yronglin added a comment. Handle default argument and dependent context. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/include/clang/Sema/Se

[PATCH] D153701: [WIP][Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-11 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 549449. yronglin added a comment. Only create addational metarialized temporary in for-range-init. FIXME: Need to handle function default argument, and add more test to make sure the generated LLVM IR is correct. Repository: rG LLVM Github Monorepo CHAN

[PATCH] D153701: [WIP][Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-10 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D153701#4575056 , @hubert.reinterpretcast wrote: > In D153701#4563919 , @yronglin > wrote: > >> The gap between these two numbers is very large. So I'think we can create >> addition

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-08-08 Thread Yurong via Phabricator via cfe-commits
yronglin marked 4 inline comments as done. yronglin added inline comments. Comment at: clang/include/clang/AST/Stmt.h:596-597 -// These don't need to be particularly wide, because they're -// strictly limited by the forms of expressions we permit. -unsigned NumSubEx

[PATCH] D157195: [Clang] Fix the do while statement disappearing in AST when an error occurs in the conditional expression of the do while statement

2023-08-08 Thread Yurong via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. yronglin marked 2 inline comments as done. Closed by commit rGa2132d72bed1: [Clang] Fix the do while statement disappearing in AST when an error occurs in… (authored by yronglin). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D157195: [Clang] Fix the do while statement disappearing in AST when an error occurs in the conditional expression of the do while statement

2023-08-07 Thread Yurong via Phabricator via cfe-commits
yronglin marked 2 inline comments as done. yronglin added a comment. Thanks for your review! @hokein @tbaeder Comment at: clang/lib/Parse/ParseStmt.cpp:1897-1898 if (Cond.isUsable()) -Cond = Actions.CorrectDelayedTyposInExpr(Cond); +Cond = Actions.CorrectDelayedTypos

[PATCH] D157195: [Clang] Fix the do while statement disappearing in AST when an error occurs in the conditional expression of the do while statement

2023-08-07 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 547712. yronglin added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157195/new/ https://reviews.llvm.org/D157195 Files: clang/lib/Parse/ParseStmt.cpp clang/test/AST/ast-dump-

[PATCH] D153701: [WIP][Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-06 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. Sorry for the late reply. I tried to investigate the memory impact of creating these additional materializations by build the whole llvm-project and compare the number of `MaterializedTemporaryExpr` created during parsing. Steps: 1. Add a public member `uint64_t NumM

[PATCH] D157195: [Clang] Fix the do while statement disappearing in AST when an error occurs in the conditional expression of the do while statement

2023-08-05 Thread Yurong via Phabricator via cfe-commits
yronglin created this revision. Herald added a project: All. yronglin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Signed-off-by: yrong Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D157195 Files: clang/lib/Parse/

[PATCH] D153701: [WIP][Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-07-26 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. This is a very early implement, please give me some time to add and fix tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 ___ cfe

[PATCH] D153701: [WIP][Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-07-26 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. Thanks for your comments and sorry for the very late reply, I have been investigating how to achieve it these days. Comment at: clang/lib/Sema/SemaExprCXX.cpp:8901-8914 + // [P2718R0] Lifetime extension in range-based for loops. + // + // 6.7.7 [cl

[PATCH] D153701: [WIP][Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-07-26 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 544386. yronglin added a comment. Try implement Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/include/clang/AST/ExprCXX.h clang/include/clang/Sema

[PATCH] D153701: [WIP][Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-07-13 Thread Yurong via Phabricator via cfe-commits
yronglin marked 2 inline comments as done. yronglin added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:8901-8914 + // [P2718R0] Lifetime extension in range-based for loops. + // + // 6.7.7 [class.temporary] p5: + // There are four contexts in which temporaries

[PATCH] D153701: [WIP][Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-07-13 Thread Yurong via Phabricator via cfe-commits
yronglin added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:8901-8914 + // [P2718R0] Lifetime extension in range-based for loops. + // + // 6.7.7 [class.temporary] p5: + // There are four contexts in which temporaries are destroyed at a different + // point th

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-12 Thread Yurong via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG677a1da6fafd: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow (authored by yronglin). Changed prior to commit: https://reviews.llvm.org/D154784?vs=539563&id=539798#toc Repos

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-12 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. Wait for CI green Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154784/new/ https://reviews.llvm.org/D154784 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-12 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 539563. yronglin added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154784/new/ https://reviews.llvm.org/D154784 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/Stmt.h clan

[PATCH] D153701: [WIP][Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-07-12 Thread Yurong via Phabricator via cfe-commits
yronglin marked an inline comment as done. yronglin added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:8901-8914 + // [P2718R0] Lifetime extension in range-based for loops. + // + // 6.7.7 [class.temporary] p5: + // There are four contexts in which temporaries

[PATCH] D153701: [WIP][Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-07-12 Thread Yurong via Phabricator via cfe-commits
yronglin marked 2 inline comments as done. yronglin added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:8901-8914 + // [P2718R0] Lifetime extension in range-based for loops. + // + // 6.7.7 [class.temporary] p5: + // There are four contexts in which temporaries

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-12 Thread Yurong via Phabricator via cfe-commits
yronglin marked an inline comment as done. yronglin added a comment. Thanks for your review! @aaron.ballman @rjmccall Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154784/new/ https://reviews.llvm.org/D154784 __

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-12 Thread Yurong via Phabricator via cfe-commits
yronglin marked an inline comment as done. yronglin added inline comments. Comment at: clang/include/clang/AST/Stmt.h:603 -// These don't need to be particularly wide, because they're -// strictly limited by the forms of expressions we permit. -unsigned NumSubExprs

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-12 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 539493. yronglin added a comment. Address comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154784/new/ https://reviews.llvm.org/D154784 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/Stmt

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-11 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 539152. yronglin added a comment. Address John's comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154784/new/ https://reviews.llvm.org/D154784 Files: clang/docs/ReleaseNotes.rst clang/include/clang/

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-11 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D154784#4486721 , @rjmccall wrote: > We had that discussion in the bug report. Let's just increase the widths > unconditionally; this is not such a common expression class that we need to > worry about using an extra word.

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-10 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D154784#4485752 , @aaron.ballman wrote: > In general, I think this is a good approach. However, it sort of kicks the > can down the road a bit; we will still overflow the member if there are > enough fields. Would it make s

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-10 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 538712. yronglin marked 2 inline comments as done. yronglin added a comment. Update comments in PseudoObjectExpr. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154784/new/ https://reviews.llvm.org/D154784 Fil

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-10 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 538709. yronglin added a comment. Address Aaron's comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154784/new/ https://reviews.llvm.org/D154784 Files: clang/docs/ReleaseNotes.rst clang/include/clan

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-09 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. I'm not sure if we should limit the value of `NumSubExprs` when build `PseudoObjectExpr` for `__builtin_dump_struct`, This cost too much memory when the nested members of the record are very deep and the num of member is very large. Repository: rG LLVM Github Mono

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-09 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 538418. yronglin added a comment. Format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154784/new/ https://reviews.llvm.org/D154784 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/Expr.h clan

[PATCH] D154784: [clang] Fix crash caused by PseudoObjectExprBitfields::NumSubExprs overflow

2023-07-09 Thread Yurong via Phabricator via cfe-commits
yronglin created this revision. Herald added a project: All. yronglin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Signed-off-by: yrong Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D154784 Files: clang/docs/Relea

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-07-07 Thread Yurong via Phabricator via cfe-commits
yronglin marked an inline comment as done. yronglin added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:8901-8914 + // [P2718R0] Lifetime extension in range-based for loops. + // + // 6.7.7 [class.temporary] p5: + // There are four contexts in which temporaries

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-07 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. Thanks, landed! I have benefited a lot from your comments! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 ___ cfe-commits mailing lis

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-07 Thread Yurong via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG36f67434f724: [AST] Stop evaluate constant expression if the condition expression which in… (authored by yronglin). Repository: rG LLVM Github Mon

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-07 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D153296#4479718 , @hokein wrote: > Thanks, this looks good. Thanks for your review! I don't know why the reversion status still `Needs Review`, and the `libcxx ci` often fails to start. Repository: rG LLVM Github Monorep

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-06 Thread Yurong via Phabricator via cfe-commits
yronglin marked 2 inline comments as done. yronglin added a comment. Thanks for your review! Comment at: clang/lib/AST/ExprConstant.cpp:4914 static bool EvaluateDependentExpr(const Expr *E, EvalInfo &Info) { assert(E->isValueDependent()); aaron.ballman wr

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-06 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 537929. yronglin added a comment. Format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 Files: clang/docs/ReleaseNotes.rst clang/lib/AST/ExprConstant.cpp clan

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-06 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 537928. yronglin marked an inline comment as done. yronglin added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 Files: clang/docs/Rel

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-06 Thread Yurong via Phabricator via cfe-commits
yronglin marked an inline comment as done. yronglin added a comment. Many thanks for all of your comments, I learned a lot from the discussions, your incredible depth of knowledge have helped fundamentally shape Clang into a great compiler! It seems the common denominator is that constant evalu

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-06 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 537714. yronglin added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 Files: clang/docs/ReleaseNotes.rst clang/lib/AST/ExprConstant

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-04 Thread Yurong via Phabricator via cfe-commits
yronglin added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4921 + // value is. + if (isa(E)) +return false; yronglin wrote: > aaron.ballman wrote: > > yronglin wrote: > > > hokein wrote: > > > > The constant evaluator is not aware of the "er

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-04 Thread Yurong via Phabricator via cfe-commits
yronglin marked 3 inline comments as done. yronglin added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4921 + // value is. + if (isa(E)) +return false; aaron.ballman wrote: > yronglin wrote: > > hokein wrote: > > > The constant evaluator is n

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-04 Thread Yurong via Phabricator via cfe-commits
yronglin marked 3 inline comments as done. yronglin added a comment. Thanks a lot for your comments! @hokein Comment at: clang/lib/AST/ExprConstant.cpp:4921 + // value is. + if (isa(E)) +return false; hokein wrote: > The constant evaluator is not aware of

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-03 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 536802. yronglin added a comment. Address comment. - Change `EvaluateDependentExpr`. - Add more test for do/while/for/return/ctor. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llv

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-03 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D153296#4468373 , @aaron.ballman wrote: > In D153296#4459769 , @yronglin > wrote: > >> Please help me, I have no better idea on this issue, do you have any better >> ideas? @erichke

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-07-02 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. friendly ping~ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[PATCH] D139586: [Clang][C++23] Lifetime extension in range-based for loops

2023-06-29 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D139586#4403533 , @cor3ntin wrote: > FYI, I'm not actively working on this, > I did mess around with it a bit > https://github.com/cor3ntin/llvm-project/commit/478ff7f1aa7a4046fa8b293dfb86489b930a > but I'm extremely unf

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-29 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. Please help me, I have no better idea on this issue, do you have any better idea? @erichkeane @shafik Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 ___

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-06-29 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D153701#4459036 , @cor3ntin wrote: > Sorry, I missed the ping on Discord. > Thanks for working on this > > I don't feel qualified to review this, but I don't think there are nearly > enough tests. > FYI there is a previous at

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-06-29 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D153701#4459036 , @cor3ntin wrote: > Sorry, I missed the ping on Discord. > Thanks for working on this > > I don't feel qualified to review this, but I don't think there are nearly > enough tests. > FYI there is a previous at

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-06-28 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 535414. yronglin added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/Decl.h clan

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-06-28 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. friendly ping~ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-27 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. Seems the diagnostic message `:5:9: note: constexpr evaluation hit maximum step limit; possible infinite loop?` was redundant, also gcc dose not emit this message. https://godbolt.org/z/v55P88cdT Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-06-27 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 534920. yronglin added a comment. Poke CI Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/Decl.h cla

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-06-26 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 534610. yronglin added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/Decl.h clan

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-26 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 534606. yronglin added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 Files: clang/docs/ReleaseNotes.rst clang/lib/AST/ExprConstant.

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-26 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. Can we both check `SS->getCond()->containsErrors()` ? Maybe it can avoid bitint's effect. WDYT? @erichkeane @shafik Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 _

[PATCH] D153701: [clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-06-26 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 534559. yronglin added a comment. Format and rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/De

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-24 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D153296#612 , @erichkeane wrote: > So I think I'm pretty confident that the only time we would call > `EvaluateDependentExpr` is when we are in an error condition, so I'm > convinced the fix 'as is' is incorrect. The c

[PATCH] D153701: [clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-06-24 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 534212. yronglin added a comment. Update c++ status Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153701/new/ https://reviews.llvm.org/D153701 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/De

[PATCH] D153701: [clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-06-24 Thread Yurong via Phabricator via cfe-commits
yronglin created this revision. Herald added a project: All. yronglin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Signed-off-by: yronglin Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D153701 Files: clang/docs/Re

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-22 Thread Yurong via Phabricator via cfe-commits
yronglin added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4893 + // Stop evaluate if E is a RecoveryExpr. + if (isa(E)) +return false; yronglin wrote: > erichkeane wrote: > > I'd probably suggest `E->containsErrors()` instead, to cover case

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-22 Thread Yurong via Phabricator via cfe-commits
yronglin added a comment. In D153296#4442363 , @erichkeane wrote: > Just a rewording of the message, else LGTM. Thanks a lot for you're review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ h

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-22 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 533738. yronglin marked an inline comment as done. yronglin added a comment. Update wording. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 Files: clang/docs/Rele

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-22 Thread Yurong via Phabricator via cfe-commits
yronglin marked an inline comment as done. yronglin added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4893 + // Stop evaluate if E is a RecoveryExpr. + if (isa(E)) +return false; erichkeane wrote: > I'd probably suggest `E->containsErrors()`

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-22 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 533735. yronglin marked an inline comment as done. yronglin added a comment. Add ReleaseNotes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 Files: clang/docs/Rel

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-22 Thread Yurong via Phabricator via cfe-commits
yronglin marked an inline comment as done. yronglin added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4988 + if (SS->getCond()->containsErrors() || + !EvaluateDependentExpr(SS->getCond(), Info)) return ESR_Failed; erichkeane

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-22 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 533714. yronglin added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 Files: clang/lib/AST/ExprConstant.cpp clang/test/SemaCXX/switc

[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

2023-06-20 Thread Yurong via Phabricator via cfe-commits
yronglin updated this revision to Diff 532853. yronglin added a comment. Fix test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153296/new/ https://reviews.llvm.org/D153296 Files: clang/lib/AST/ExprConstant.cpp clang/test/SemaCXX/switch.cpp

  1   2   >