summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorGor Nishanov <GorNishanov@gmail.com>2017-05-23 05:04:01 +0000
committerGor Nishanov <GorNishanov@gmail.com>2017-05-23 05:04:01 +0000
commit5efc61866d24b11e8aabba8d7d9443cb1f1e3215 (patch)
tree2f9574d626f78b388092a2da91fced7d1851dfcb /clang/lib
parentc46203eaf557f738b25e1d261272d51ef953e561 (diff)
downloadbcm5719-llvm-5efc61866d24b11e8aabba8d7d9443cb1f1e3215.tar.gz
bcm5719-llvm-5efc61866d24b11e8aabba8d7d9443cb1f1e3215.zip
[coroutines] Add emission of initial and final suspends
https://reviews.llvm.org/D31608 llvm-svn: 303603
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGCoroutine.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCoroutine.cpp b/clang/lib/CodeGen/CGCoroutine.cpp
index 26291c9978b..bb98c248908 100644
--- a/clang/lib/CodeGen/CGCoroutine.cpp
+++ b/clang/lib/CodeGen/CGCoroutine.cpp
@@ -388,7 +388,10 @@ void CodeGenFunction::EmitCoroutineBody(const CoroutineBodyStmt &S) {
CurCoro.Data->FinalJD = getJumpDestInCurrentScope(FinalBB);
- // FIXME: Emit initial suspend and more before the body.
+ // FIXME: Emit param moves.
+
+ CurCoro.Data->CurrentAwaitKind = AwaitKind::Init;
+ EmitStmt(S.getInitSuspendStmt());
CurCoro.Data->CurrentAwaitKind = AwaitKind::Normal;
@@ -410,7 +413,8 @@ void CodeGenFunction::EmitCoroutineBody(const CoroutineBodyStmt &S) {
const bool HasCoreturns = CurCoro.Data->CoreturnCount > 0;
if (CanFallthrough || HasCoreturns) {
EmitBlock(FinalBB);
- // FIXME: Emit final suspend.
+ CurCoro.Data->CurrentAwaitKind = AwaitKind::Final;
+ EmitStmt(S.getFinalSuspendStmt());
}
}
OpenPOWER on IntegriCloud