[DWARF] Refactor DWARF classes to use unified error reporting. NFC.
authorVictor Leschuk <vleschuk@accesssoftek.com>
Mon, 20 Aug 2018 09:59:08 +0000 (09:59 +0000)
committerVictor Leschuk <vleschuk@accesssoftek.com>
Mon, 20 Aug 2018 09:59:08 +0000 (09:59 +0000)
commitcba595da825c3a21070b3f9519ae608d8060fb83
tree37611d927ef99175f72073b5a0dea4eead4b3e5c
parentbbd2d15d45bc455e3dda62bb8a194ff7a969df68
[DWARF] Refactor DWARF classes to use unified error reporting. NFC.

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.

Reviewers: aprantl, dblaikie, probinson, wolfgangp, JDevlieghere, jhenderson

Reviewed By: JDevlieghere, jhenderson

Differential Revision: https://reviews.llvm.org/D49964

llvm-svn: 340163
llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
llvm/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp
llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp
llvm/lib/DebugInfo/DWARF/DWARFListTable.cpp
llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp