Implemented UnusedFunctionReturnParameterPruner

Optimization rule that rewrites functions whose return parameters are not used at callsite.
This commit is contained in:
hrkrshnn
2020-11-20 17:29:02 +01:00
parent 61069ec77d
commit 4553b8c0d5
7 changed files with 382 additions and 38 deletions
+2 -4
View File
@@ -93,10 +93,8 @@ template <class T>
inline std::vector<T> operator+(std::vector<T>&& _a, std::vector<T>&& _b)
{
std::vector<T> ret(std::move(_a));
if (&_a == &_b)
ret += ret;
else
ret += std::move(_b);
assert(&_a != &_b);
ret += std::move(_b);
return ret;
}