diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-06 20:33:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-06 20:33:37 +0000 |
commit | f7603f6ca76aec055cbf1644c89ce0dca9fa2c03 (patch) | |
tree | 7ce6e0b030840bec64f2089ce8109ff75c54717d /lib/Sema/SemaDecl.cpp | |
parent | facef2ef39f5468068b60da26f9f9049115a361d (diff) |
Implement the Named Return Value Optimization (NRVO) for Objective-C++
methods. Fixes PR10835 / <rdar://problem/10050178>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index e0b6981424..6a205786d6 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -6700,6 +6700,9 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, DiagnoseUnusedParameters(MD->param_begin(), MD->param_end()); DiagnoseSizeOfParametersAndReturnValue(MD->param_begin(), MD->param_end(), MD->getResultType(), MD); + + if (Body) + ComputeNRVO(Body, getCurFunction()); } if (ObjCShouldCallSuperDealloc) { Diag(MD->getLocEnd(), diag::warn_objc_missing_super_dealloc); |