summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.h
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
commit6fd1b1802f5e748d2e8dfabeb03b62c0d65340ab (patch)
treea4e9b7b4cdad61d7785a9661b734f8311a9539c3 /clang/lib/Sema/Sema.h
parent6625c7028e5e8c301fdd6e9153c403970f1b8075 (diff)
downloadbcm5719-llvm-6fd1b1802f5e748d2e8dfabeb03b62c0d65340ab.tar.gz
bcm5719-llvm-6fd1b1802f5e748d2e8dfabeb03b62c0d65340ab.zip
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. llvm-svn: 103865
Diffstat (limited to 'clang/lib/Sema/Sema.h')
-rw-r--r--clang/lib/Sema/Sema.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index d97dc676823..3e143bb3b00 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/lib/Sema/Sema.h
@@ -134,6 +134,11 @@ struct FunctionScopeInfo {
/// block.
llvm::SmallVector<SwitchStmt*, 8> SwitchStack;
+ /// \brief The list of return statements that occur within the function or
+ /// block, if there is any chance of applying the named return value
+ /// optimization.
+ llvm::SmallVector<ReturnStmt *, 4> Returns;
+
FunctionScopeInfo(unsigned NumErrors)
: IsBlockInfo(false), NeedsScopeChecking(false),
NumErrorsAtStartOfFunction(NumErrors) { }
OpenPOWER on IntegriCloud