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.
Although having an inconvertibleErrorCode (as per Lang's comment in the other diff) prevents conversion between errors and error codes, I'm not convinced it's actually needed here. If we don't need the conversion in libDebugInfo (which I think we don't) I'd rather have an inconvertible one instead of whichever is close enough.