diff options
author | Victor Leschuk <vleschuk@accesssoftek.com> | 2018-07-26 02:21:40 +0000 |
---|---|---|
committer | Victor Leschuk <vleschuk@accesssoftek.com> | 2018-07-26 02:21:40 +0000 |
commit | e58e9907aca25316afad9573df077325f717ef18 (patch) | |
tree | ba0e9e53a6bb6ad0fc782e2377bf5addb40ac3d5 /llvm/lib/Support | |
parent | fdd089aa14d90fcf220d54fb3fbfd2170f89de78 (diff) | |
download | bcm5719-llvm-e58e9907aca25316afad9573df077325f717ef18.tar.gz bcm5719-llvm-e58e9907aca25316afad9573df077325f717ef18.zip |
[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
llvm-svn: 337995
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/Error.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Support/Error.cpp b/llvm/lib/Support/Error.cpp index c43a1fa813e..83345bf6edb 100644 --- a/llvm/lib/Support/Error.cpp +++ b/llvm/lib/Support/Error.cpp @@ -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; |