You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit is a refactor (increases readability) and optimization fix.
This is a fixed commit of llvm#76200
First reverthed here: llvm@1ea7a56
The difference is a return type of the lambda.
Original description:
This commit addresses optimization and instrumentation challenges encountered within comma constructors.
1) _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS does not work in comma constructors.
2) Code inside comma constructors is not always correctly optimized. Problematic code examples:
- `: __r_(((__str.__is_long() ? 0 : (__str.__annotate_delete(), 0)), std::move(__str.__r_))) {`
- `: __r_(__r_([&](){ if(!__s.__is_long()) __s.__annotate_delete(); return std::move(__s.__r_);}())) {`
However, lambda with argument seems to be correctly optimized. This patch uses that fact.
Use of lambda based on idea from @ldionne.
0 commit comments