summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/TreeTransform.h
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2018-01-24 22:15:42 +0000
committerBrian Gesiak <modocache@gmail.com>2018-01-24 22:15:42 +0000
commit61f4ac98e019e0e7ce5adbc58474fdcf7f49c300 (patch)
treeb0027f41c94b5e5b1aba481557ef6fdb42c8fc8b /clang/lib/Sema/TreeTransform.h
parent292617e7003efdbc4dd84bc49423dc662f856fb6 (diff)
downloadbcm5719-llvm-61f4ac98e019e0e7ce5adbc58474fdcf7f49c300.tar.gz
bcm5719-llvm-61f4ac98e019e0e7ce5adbc58474fdcf7f49c300.zip
[coroutines] Pass coro func args to promise ctor
Summary: Use corutine function arguments to initialize a promise type, but only if the promise type defines a constructor that takes those arguments. Otherwise, fall back to the default constructor. Test Plan: check-clang Reviewers: rsmith, GorNishanov, eric_niebler Reviewed By: GorNishanov Subscribers: toby-allsopp, lewissbaker, EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D41820 llvm-svn: 323381
Diffstat (limited to 'clang/lib/Sema/TreeTransform.h')
-rw-r--r--clang/lib/Sema/TreeTransform.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 4eb45bc0c9a..c33a1fc2ecf 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -6944,6 +6944,8 @@ TreeTransform<Derived>::TransformCoroutineBodyStmt(CoroutineBodyStmt *S) {
// The new CoroutinePromise object needs to be built and put into the current
// FunctionScopeInfo before any transformations or rebuilding occurs.
+ if (!SemaRef.buildCoroutineParameterMoves(FD->getLocation()))
+ return StmtError();
auto *Promise = SemaRef.buildCoroutinePromise(FD->getLocation());
if (!Promise)
return StmtError();
@@ -7034,8 +7036,6 @@ TreeTransform<Derived>::TransformCoroutineBodyStmt(CoroutineBodyStmt *S) {
Builder.ReturnStmt = Res.get();
}
}
- if (!Builder.buildParameterMoves())
- return StmtError();
return getDerived().RebuildCoroutineBodyStmt(Builder);
}
OpenPOWER on IntegriCloud