diff options
author | Bruno Ricci <riccibrun@gmail.com> | 2018-10-30 14:40:49 +0000 |
---|---|---|
committer | Bruno Ricci <riccibrun@gmail.com> | 2018-10-30 14:40:49 +0000 |
commit | 023b1d19f3de5ed7cec535295bf0d7a9f99ea561 (patch) | |
tree | d64648f8548f834e3bfb961785dcf5e665e832ed /clang/lib/CodeGen | |
parent | 92964e74a55592b8a6d9ee6e6b5edf29ed83233e (diff) | |
download | bcm5719-llvm-023b1d19f3de5ed7cec535295bf0d7a9f99ea561.tar.gz bcm5719-llvm-023b1d19f3de5ed7cec535295bf0d7a9f99ea561.zip |
[AST] Only store data for the NRVO candidate in ReturnStmt if needed
Only store the NRVO candidate if needed in ReturnStmt.
A good chuck of all of the ReturnStmt have no NRVO candidate
(more than half when parsing all of Boost). For all of them
this saves one pointer. This has no impact on children().
Differential Revision: https://reviews.llvm.org/D53716
Reviewed By: rsmith
llvm-svn: 345605
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGObjC.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index c62f40b7906..52bd36460e8 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -883,9 +883,10 @@ CodeGenFunction::generateObjCGetterBody(const ObjCImplementationDecl *classImpl, // If there's a non-trivial 'get' expression, we just have to emit that. if (!hasTrivialGetExpr(propImpl)) { if (!AtomicHelperFn) { - ReturnStmt ret(SourceLocation(), propImpl->getGetterCXXConstructor(), - /*nrvo*/ nullptr); - EmitReturnStmt(ret); + auto *ret = ReturnStmt::Create(getContext(), SourceLocation(), + propImpl->getGetterCXXConstructor(), + /* NRVOCandidate=*/nullptr); + EmitReturnStmt(*ret); } else { ObjCIvarDecl *ivar = propImpl->getPropertyIvarDecl(); |