If a method / function returns a StringRef but the
variable is of type const std::string& a temporary string is
created (StringRef has a cast operator to std::string),
which is a suboptimal behavior.
Test plan: make check-all
This cleanup is a continuation of the efforts started
in https://reviews.llvm.org/D34969 and https://reviews.llvm.org/D34970.
The changes are broken up into multiples diffs
to make reviewing / landing / reverting (if necessary) easier.
Test plan: make check-all