diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-15 06:01:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-15 06:01:05 +0000 |
commit | 5077c3876beeaed32280af88244e8050078619a8 (patch) | |
tree | a33c75c7ad2eedc6e0cbd811555fab85c81971fc /lib/Frontend/PCHReaderStmt.cpp | |
parent | f805a6cc00b27ff0bcfc7f821e5d286c32a769ec (diff) |
Implement semantic analysis and an AST representation for the named
return value optimization. Sema marks return statements with their
NRVO candidates (which may or may not end up using the NRVO), then, at
the end of a function body, computes and marks those variables that
can be allocated into the return slot.
I've checked this locally with some debugging statements (not
committed), but there won't be any tests until CodeGen comes along.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReaderStmt.cpp')
-rw-r--r-- | lib/Frontend/PCHReaderStmt.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Frontend/PCHReaderStmt.cpp b/lib/Frontend/PCHReaderStmt.cpp index 7595d03a15..3931adbe8f 100644 --- a/lib/Frontend/PCHReaderStmt.cpp +++ b/lib/Frontend/PCHReaderStmt.cpp @@ -291,6 +291,7 @@ unsigned PCHStmtReader::VisitReturnStmt(ReturnStmt *S) { VisitStmt(S); S->setRetValue(cast_or_null<Expr>(StmtStack.back())); S->setReturnLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + S->setNRVOCandidate(cast_or_null<VarDecl>(Reader.GetDecl(Record[Idx++]))); return 1; } |