aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriterStmt.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-15 06:01:05 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-15 06:01:05 +0000
commit5077c3876beeaed32280af88244e8050078619a8 (patch)
treea33c75c7ad2eedc6e0cbd811555fab85c81971fc /lib/Frontend/PCHWriterStmt.cpp
parentf805a6cc00b27ff0bcfc7f821e5d286c32a769ec (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/PCHWriterStmt.cpp')
-rw-r--r--lib/Frontend/PCHWriterStmt.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Frontend/PCHWriterStmt.cpp b/lib/Frontend/PCHWriterStmt.cpp
index a7f73a17fa..a9ee43527c 100644
--- a/lib/Frontend/PCHWriterStmt.cpp
+++ b/lib/Frontend/PCHWriterStmt.cpp
@@ -275,6 +275,7 @@ void PCHStmtWriter::VisitReturnStmt(ReturnStmt *S) {
VisitStmt(S);
Writer.WriteSubStmt(S->getRetValue());
Writer.AddSourceLocation(S->getReturnLoc(), Record);
+ Writer.AddDeclRef(S->getNRVOCandidate(), Record);
Code = pch::STMT_RETURN;
}