[coroutines] Build GRO declaration and return GRO statement
Summary:
1. build declaration of the gro local variable that keeps the result of get_return_object.
2. build return statement returning the gro variable
3. emit them during CodeGen
4. sema and CodeGen tests updated
Reviewers: EricWF, rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31646
llvm-svn: 303573
diff --git a/clang/lib/Sema/CoroutineStmtBuilder.h b/clang/lib/Sema/CoroutineStmtBuilder.h
index 4958576..954a0f1 100644
--- a/clang/lib/Sema/CoroutineStmtBuilder.h
+++ b/clang/lib/Sema/CoroutineStmtBuilder.h
@@ -28,7 +28,6 @@
sema::FunctionScopeInfo &Fn;
bool IsValid = true;
SourceLocation Loc;
- QualType RetType;
SmallVector<Stmt *, 4> ParamMovesVector;
const bool IsPromiseDependentType;
CXXRecordDecl *PromiseRecordDecl = nullptr;
@@ -61,6 +60,7 @@
bool makeOnFallthrough();
bool makeOnException();
bool makeReturnObject();
+ bool makeGroDeclAndReturnStmt();
bool makeReturnOnAllocFailure();
bool makeParamMoves();
};