[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/77465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/77465 >From 781201c5c0a526821f51ce6aa0e2c972a9f5f51f Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 9 Jan 2024 14:02:01 +0100 Subject: [PATCH 1/2] [AST] Mark the fallthrough coreturn statement implicit. --- clang/lib/Sema/SemaCoroutine.cpp | 2 +- clang/test/AST/ast-dump-coroutine.cpp | 6 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp index 4e600fd29ee7395..a171ab579cba838 100644 --- a/clang/lib/Sema/SemaCoroutine.cpp +++ b/clang/lib/Sema/SemaCoroutine.cpp @@ -1748,7 +1748,7 @@ bool CoroutineStmtBuilder::makeOnFallthrough() { return false; } else if (HasRVoid) { Fallthrough = S.BuildCoreturnStmt(FD.getLocation(), nullptr, - /*IsImplicit*/false); + /*IsImplicit*/true); Fallthrough = S.ActOnFinishFullStmt(Fallthrough.get()); if (Fallthrough.isInvalid()) return false; diff --git a/clang/test/AST/ast-dump-coroutine.cpp b/clang/test/AST/ast-dump-coroutine.cpp index 5e7736300f9fee8..8741c7b35b155aa 100644 --- a/clang/test/AST/ast-dump-coroutine.cpp +++ b/clang/test/AST/ast-dump-coroutine.cpp @@ -52,8 +52,7 @@ Task test() { // CHECK-NEXT: |-CXXMemberCallExpr {{.*}} 'std::suspend_always' // CHECK-NEXT: | | `-MemberExpr {{.*}} .initial_suspend // ... -// FIXME: the CoreturnStmt should be marked as implicit -// CHECK: CoreturnStmt {{.*}} {{$}} +// CHECK: CoreturnStmt {{.*}} implicit Task test2() { // Writen souce code, verify no implicit bit for the co_return expr. @@ -65,5 +64,4 @@ Task test2() { // CHECK:|-DeclStmt {{.*}} // CHECK-NEXT: | `-VarDecl {{.*}} implicit used __promise // ... -// FIXME: the CoreturnStmt should be marked as implicit -// CHECK: CoreturnStmt {{.*}} {{$}} +// CHECK: CoreturnStmt {{.*}} implicit >From 7ac002e371e2b3c089c5f7f771da9064481f551b Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 24 Jan 2024 11:51:53 +0100 Subject: [PATCH 2/2] Address a comment. --- clang/lib/Sema/SemaCoroutine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp index a171ab579cba838..a969b9383563b22 100644 --- a/clang/lib/Sema/SemaCoroutine.cpp +++ b/clang/lib/Sema/SemaCoroutine.cpp @@ -1748,7 +1748,7 @@ bool CoroutineStmtBuilder::makeOnFallthrough() { return false; } else if (HasRVoid) { Fallthrough = S.BuildCoreturnStmt(FD.getLocation(), nullptr, - /*IsImplicit*/true); + /*IsImplicit=*/true); Fallthrough = S.ActOnFinishFullStmt(Fallthrough.get()); if (Fallthrough.isInvalid()) return false; ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)
https://github.com/ChuanqiXu9 approved this pull request. LGTM then. https://github.com/llvm/llvm-project/pull/77465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)
https://github.com/ilya-biryukov approved this pull request. Approve from my side too, but please make sure to apply suggestion from @cor3ntin and clang-format before submitting. https://github.com/llvm/llvm-project/pull/77465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)
ilya-biryukov wrote: > Can you provide more context for this? I believe this is a follow-up to #77311. https://github.com/llvm/llvm-project/pull/77465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)
ChuanqiXu9 wrote: Can you provide more context for this? https://github.com/llvm/llvm-project/pull/77465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)
https://github.com/cor3ntin approved this pull request. LGTM modulo nit https://github.com/llvm/llvm-project/pull/77465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)
@@ -1743,7 +1743,7 @@ bool CoroutineStmtBuilder::makeOnFallthrough() { return false; } else if (HasRVoid) { Fallthrough = S.BuildCoreturnStmt(FD.getLocation(), nullptr, - /*IsImplicit*/false); + /*IsImplicit*/true); cor3ntin wrote: ```suggestion /*IsImplicit=*/true); ``` https://github.com/llvm/llvm-project/pull/77465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/77465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)
llvmbot wrote: @llvm/pr-subscribers-coroutines Author: Haojian Wu (hokein) Changes --- Patch is 157.19 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/77465.diff 2 Files Affected: - (modified) clang/lib/Sema/SemaCoroutine.cpp (+1-1) - (modified) clang/test/AST/ast-dump-coroutine.cpp (+2-4) ``diff Server Error GitHub body { background-color: #f1f1f1; margin: 0; } body, input, button { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } .container { margin: 50px auto 40px auto; width: 600px; text-align: center; } a { color: #4183c4; text-decoration: none; } a:hover { text-decoration: underline; } h1 { letter-spacing: -1px; line-height: 60px; font-size: 60px; font-weight: 100; margin: 0px; text-shadow: 0 1px 0 #fff; } p { color: rgba(0, 0, 0, 0.5); margin: 10px 0 10px; font-size: 18px; font-weight: 200; line-height: 1.6em;} ul { list-style: none; margin: 25px 0; padding: 0; } li { display: table-cell; font-weight: bold; width: 1%; } .logo { display: inline-block; margin-top: 35px; } .logo-img-2x { display: none; } @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min--moz-device-pixel-ratio: 2), only screen and ( -o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) { .logo-img-1x { display: none; } .logo-img-2x { display: inline-block; } } #suggestions { margin-top: 35px; color: #ccc; } #suggestions a { color: #66; font-weight: 200; font-size: 14px; margin: 0 10px; } #parallax_wrapper { position: relative; z-index: 0; } #parallax_field { overflow: hidden; position: absolute; left: 0; top: 0; height: 380px; width: 100%; } #parallax_illustration { display: block; margin: 0 auto; width: 940px; height: 380px; position: relative; overflow: hidden; } #parallax_illustration #parallax_sign { position: absolute; top: 25px; left: 582px; z-index: 10; } #parallax_illustration #parallax_octocat { position: absolute; top: 66px; left: 431px; z-index: 8; } #parallax_illustration #parallax_error_text { display: block; width: 400px; height: 144px; position: absolute; top: 165px; left: 152px; font-family:Arial, Helvetica, sans-serif; font-weight: bold; font-size: 14px; line-height: 18px; background-image:
[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/77465 None >From 17afb4cb0e43ae77268ad406cd2510af69756fae Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 9 Jan 2024 14:02:01 +0100 Subject: [PATCH] [AST] Mark the fallthrough coreturn statement implicit. --- clang/lib/Sema/SemaCoroutine.cpp | 2 +- clang/test/AST/ast-dump-coroutine.cpp | 6 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp index bee80db8d166a6..86afa9b719db69 100644 --- a/clang/lib/Sema/SemaCoroutine.cpp +++ b/clang/lib/Sema/SemaCoroutine.cpp @@ -1743,7 +1743,7 @@ bool CoroutineStmtBuilder::makeOnFallthrough() { return false; } else if (HasRVoid) { Fallthrough = S.BuildCoreturnStmt(FD.getLocation(), nullptr, - /*IsImplicit*/false); + /*IsImplicit*/true); Fallthrough = S.ActOnFinishFullStmt(Fallthrough.get()); if (Fallthrough.isInvalid()) return false; diff --git a/clang/test/AST/ast-dump-coroutine.cpp b/clang/test/AST/ast-dump-coroutine.cpp index 5e7736300f9fee..8741c7b35b155a 100644 --- a/clang/test/AST/ast-dump-coroutine.cpp +++ b/clang/test/AST/ast-dump-coroutine.cpp @@ -52,8 +52,7 @@ Task test() { // CHECK-NEXT: |-CXXMemberCallExpr {{.*}} 'std::suspend_always' // CHECK-NEXT: | | `-MemberExpr {{.*}} .initial_suspend // ... -// FIXME: the CoreturnStmt should be marked as implicit -// CHECK: CoreturnStmt {{.*}} {{$}} +// CHECK: CoreturnStmt {{.*}} implicit Task test2() { // Writen souce code, verify no implicit bit for the co_return expr. @@ -65,5 +64,4 @@ Task test2() { // CHECK:|-DeclStmt {{.*}} // CHECK-NEXT: | `-VarDecl {{.*}} implicit used __promise // ... -// FIXME: the CoreturnStmt should be marked as implicit -// CHECK: CoreturnStmt {{.*}} {{$}} +// CHECK: CoreturnStmt {{.*}} implicit ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits