Remove thousands of std::string instances in a helper function that is frequently called. In the common case we don't need to construct an std::string instance when we can just pass the StringRef to TTI.
All of the clang-check tests pass. I discovered this with a Facebook-internal tool.
It might be worth spelling out StringRef here, as the return type is not completely obvious.