Hi all.
The attached patch replaces the following typical sequence of
assignments, matching the pattern:
[type] <temp_var> = <value1>;
<value1> = <value2>;
<value2> = <temp_var>;
with
std::swap (<value1>, <value2>);
The goal is to improve code readability (at least a little).
Pattern was searched in GCC tree using a script, but all modifications
have been done manually to make sure that removing assignment to
<temp_var> does not modify the behavior of the code. Where possible,
temporary variables were removed or moved to blocks with narrower scope.
I also removed a couple of pre-C++ implementations of swap function and
one implementation of std::reverse.
Bootstrapped/regtested on x86_64 linux (multilib). Test for "broken
builds" currently running. I will also run test on a couple of
simulators (though currently there is a problem with build:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66181).
OK for trunk after complete test?