DWARF-related classes in lib/DebugInfo/DWARF contained duplicating code for creating StringError instances, like:
template <typename... Ts>
static Error createError(char const *Fmt, const Ts &... Vals) {
std::string Buffer;
raw_string_ostream Stream(Buffer);
Stream << format(Fmt, Vals...);
return make_error<StringError>(Stream.str(), inconvertibleErrorCode());
}Similar function was placed in Support lib in https://reviews.llvm.org/D49824 .
This revision makes DWARF classes use this function instead of their local implementation of it.