Rewrite NRVO determination. Track NRVO candidates on the parser Scope and apply…

Description

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.

Details

Committed
nicholasMay 2 2014, 5:41 PM
Parents
rL207889: MS ABI x64: Pass small objects with dtors but no copy ctors directly
Branches
Unknown
Tags
Unknown