]> granicus.if.org Git - clang/commit
Rewrite NRVO determination. Track NRVO candidates on the parser Scope and apply the...
authorNick Lewycky <nicholas@mxc.ca>
Sat, 3 May 2014 00:41:18 +0000 (00:41 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sat, 3 May 2014 00:41:18 +0000 (00:41 +0000)
commit130d63a029bc588cb61a6aaea2db6b9ed4c5cc56
tree82f6cce36e08f27042b659e45b9fd5aa93419be3
parent3753e68d0a785dc92ee7317585d521e502f65a95
Rewrite NRVO determination. Track NRVO candidates on the parser Scope and apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal.

Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207890 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Scope.h
include/clang/Sema/Sema.h
lib/Parse/ParseStmt.cpp
lib/Parse/Parser.cpp
lib/Sema/Scope.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaStmt.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
lib/Sema/TreeTransform.h
test/CodeGenCXX/nrvo.cpp