diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-15 00:13:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-15 00:13:29 +0000 |
commit | 222cf0efbc174528022b6d51300247ae170a8b6d (patch) | |
tree | d15badb9890db68a222bb3bc0f9b8cba2853d19e /clang/lib/Sema/SemaObjCProperty.cpp | |
parent | 36d4d1541c49843e062a5c64d2fd65b9e9b98ac7 (diff) | |
download | bcm5719-llvm-222cf0efbc174528022b6d51300247ae170a8b6d.tar.gz bcm5719-llvm-222cf0efbc174528022b6d51300247ae170a8b6d.zip |
Recognize when the named return value optimization applies in a
"return" statement and mark the corresponding CXXConstructExpr as
elidable. Teach CodeGen that eliding a temporary is different from
eliding an object construction.
This is just a baby step toward NRVO.
llvm-svn: 103849
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index a2aef20f658..002c39b6409 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -445,8 +445,9 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(Scope *S, SelfExpr, true, true); OwningExprResult Res = PerformCopyInitialization(InitializedEntity::InitializeResult( - SourceLocation(), - getterMethod->getResultType()), + SourceLocation(), + getterMethod->getResultType(), + /*NRVO=*/false), SourceLocation(), Owned(IvarRefExpr)); if (!Res.isInvalid()) { |