[PATCH] D155396: [Sema][ObjC] Propagating value-dependent errors into BlockExpr

2023-07-21 Thread Ding Fei via Phabricator via cfe-commits
danix800 updated this revision to Diff 542950. danix800 added a comment. 1. Remove unnecessary condition & cleanup code 2. Move testcase into correct place. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155396/new/ https://reviews.llvm.org/D155396

[PATCH] D155396: [Sema][ObjC] Propagating value-dependent errors into BlockExpr

2023-07-21 Thread Ding Fei via Phabricator via cfe-commits
danix800 added inline comments. Comment at: clang/test/SemaObjC/crash-on-val-dep-block-expr.m:1 +// RUN: %clang_cc1 -fblocks -fsyntax-only -verify %s +// no crash danix800 wrote: > hokein wrote: > > can you move these tests to > >

[PATCH] D155396: [Sema][ObjC] Propagating value-dependent errors into BlockExpr

2023-07-21 Thread Ding Fei via Phabricator via cfe-commits
danix800 added inline comments. Comment at: clang/lib/Sema/SemaStmt.cpp:3736 +BlockDecl *BD = CurBlock->TheDecl; +if (!BD->isInvalidDecl() && RetValExp && RetValExp->containsErrors()) + BD->setInvalidDecl(); hokein wrote: > nit: the `isInvalidDecl`

[PATCH] D155396: [Sema][ObjC] Propagating value-dependent errors into BlockExpr

2023-07-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. thanks! Comment at: clang/lib/Sema/SemaStmt.cpp:3736 +BlockDecl *BD = CurBlock->TheDecl; +if (!BD->isInvalidDecl() && RetValExp && RetValExp->containsErrors()) + BD->setInvalidDecl(); nit: the `isInvalidDecl` check is not

[PATCH] D155396: [Sema][ObjC] Propagating value-dependent errors into BlockExpr

2023-07-20 Thread Ding Fei via Phabricator via cfe-commits
danix800 updated this revision to Diff 542735. danix800 edited the summary of this revision. danix800 added a comment. Herald added a reviewer: gkistanova. Update clang/docs/ReleaseNotes.rst to reflect this fix. Repository: rZORG LLVM Github Zorg CHANGES SINCE LAST ACTION

[PATCH] D155396: [Sema][ObjC] Propagating value-dependent errors into BlockExpr

2023-07-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. This looks pretty good to me. Can you also add a release note for the fix to `clang/docs/ReleaseNotes.rst`? Comment at: clang/lib/Sema/SemaStmt.cpp:3733-3734 + BlockScopeInfo *CurBlock = dyn_cast(CurCap); + if (CurBlock &&

[PATCH] D155396: [Sema][ObjC] Propagating value-dependent errors into BlockExpr

2023-07-20 Thread Ding Fei via Phabricator via cfe-commits
danix800 updated this revision to Diff 542559. danix800 edited the summary of this revision. danix800 added a comment. Invalidate `BlockDecl` with implicit return type, in case any of the return value exprs is invalid. Propagating the error info up by replacing `BlockExpr` with a `RecoveryExpr`.

[PATCH] D155396: [Sema][ObjC] Propagating value-dependent errors into BlockExpr

2023-07-20 Thread Ding Fei via Phabricator via cfe-commits
danix800 added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:16749-16753 + bool ContainsError = llvm::any_of(BSI->Returns, [](const ReturnStmt *Return) { +const auto *RetValExpr = Return->getRetValue(); +return RetValExpr && RetValExpr->containsErrors(); +

[PATCH] D155396: [Sema][ObjC] Propagating value-dependent errors into BlockExpr

2023-07-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Comment at: clang/lib/Sema/SemaExpr.cpp:16749-16753 + bool ContainsError = llvm::any_of(BSI->Returns, [](const ReturnStmt *Return) { +const auto *RetValExpr = Return->getRetValue(); +return RetValExpr && RetValExpr->containsErrors(); + }); +

[PATCH] D155396: [Sema][ObjC] Propagating value-dependent errors into BlockExpr

2023-07-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: hokein. aaron.ballman added a subscriber: rjmccall. aaron.ballman added inline comments. Comment at: clang/include/clang/AST/ComputeDependence.h:134 ExprDependence computeDependence(ExtVectorElementExpr *E); -ExprDependence

[PATCH] D155396: [Sema][ObjC] Propagating value-dependent errors into BlockExpr

2023-07-16 Thread Ding Fei via Phabricator via cfe-commits
danix800 created this revision. danix800 added a reviewer: aaron.ballman. danix800 added a project: clang. Herald added a project: All. danix800 requested review of this revision. Herald added a subscriber: cfe-commits. Fix https://github.com/llvm/llvm-project/issues/63863 Repository: rG LLVM