[Support] Introduce createStringError helper function

The function in question is copy-pasted lots of times in DWARF-related classes.
Thus it will make sense to place its implementation into the Support library.

Reviewed by: lhames

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337995 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Victor Leschuk
2018-07-26 02:21:40 +00:00
parent a145774c76
commit f4c9d7c0dc
3 changed files with 40 additions and 0 deletions
+4
View File
@@ -112,6 +112,10 @@ std::error_code StringError::convertToErrorCode() const {
return EC;
}
Error createStringError(std::error_code EC, char const *Msg) {
return make_error<StringError>(Msg, EC);
}
void report_fatal_error(Error Err, bool GenCrashDiag) {
assert(Err && "report_fatal_error called with success value");
std::string ErrMsg;