summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCoroutine.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2018-01-30 00:32:25 +0000
committerEric Fiselier <eric@efcs.ca>2018-01-30 00:32:25 +0000
commit96f8c5c420df383e61fe61bf67fc73a3ef8aab75 (patch)
treeb4d0bce5e948fa587b1f39de691fdeddfac53f01 /clang/lib/Sema/SemaCoroutine.cpp
parent83f056604c5cc2066cace35575ff04e387b36bf5 (diff)
downloadbcm5719-llvm-96f8c5c420df383e61fe61bf67fc73a3ef8aab75.tar.gz
bcm5719-llvm-96f8c5c420df383e61fe61bf67fc73a3ef8aab75.zip
Revert "[coroutines] Fix application of NRVO to Coroutine "Gro" or return object."
This reverts commit r323712. It's causing some test failures on certain machines. Not sure why, will investigate. llvm-svn: 323717
Diffstat (limited to 'clang/lib/Sema/SemaCoroutine.cpp')
-rw-r--r--clang/lib/Sema/SemaCoroutine.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp
index 67c8b9b1a78..f05a94ebe0e 100644
--- a/clang/lib/Sema/SemaCoroutine.cpp
+++ b/clang/lib/Sema/SemaCoroutine.cpp
@@ -1316,6 +1316,10 @@ bool CoroutineStmtBuilder::makeGroDeclAndReturnStmt() {
if (Res.isInvalid())
return false;
+ if (GroType == FnRetType) {
+ GroDecl->setNRVOVariable(true);
+ }
+
S.AddInitializerToDecl(GroDecl, Res.get(),
/*DirectInit=*/false);
@@ -1339,8 +1343,6 @@ bool CoroutineStmtBuilder::makeGroDeclAndReturnStmt() {
noteMemberDeclaredHere(S, ReturnValue, Fn);
return false;
}
- if (cast<clang::ReturnStmt>(ReturnStmt.get())->getNRVOCandidate() == GroDecl)
- GroDecl->setNRVOVariable(true);
this->ReturnStmt = ReturnStmt.get();
return true;
OpenPOWER on IntegriCloud