Open
Bug 1709710
Opened 4 years ago
Updated 4 years ago
Indicate when C++ return statements are (in)eligible for NRVO (Named Return Value Optimization)
Categories
(Webtools :: Searchfox, enhancement)
Webtools
Searchfox
Tracking
(Not tracked)
NEW
People
(Reporter: asuth, Unassigned)
Details
The Clang AST exposes a getNRVOCandidate getter on the return statement. Sema::computeNRVO does a unification loop where it sets the value to null if any of the returns have a differing NRVO candidate.
Disclaimers:
- I haven't checked when the Sema pass happens relative to our clang indexer plugin.
- I have no reason to believe a non-null NRVO is a guarantee that the optimization definitely happens, but I think there are c++17 things that maybe could require that?
UX-wise, this would probably want to start out life as something in the super navigation panel and not impact the code display. (Although one could imagine some kind of performance lens/overlay in a distant utopian future where it notices from coverage that the return path is potentially hot and an expensive thing is returned that's not NRVO eligible.)
You need to log in
before you can comment on or make changes to this bug.
Description
•