diff options
| author | JF Bastien <jfbastien@apple.com> | 2019-07-31 21:09:53 +0000 |
|---|---|---|
| committer | JF Bastien <jfbastien@apple.com> | 2019-07-31 21:09:53 +0000 |
| commit | 04bdb25046e275613e2194eedbe39552e4638955 (patch) | |
| tree | 2e81343a9f2cbdff664c666144cf5060595ae892 | |
| parent | 27a73dd02c26fe4dd5b499b05b6f029e41d4c400 (diff) | |
| download | bcm5719-llvm-04bdb25046e275613e2194eedbe39552e4638955.tar.gz bcm5719-llvm-04bdb25046e275613e2194eedbe39552e4638955.zip | |
[NFC] allow creating error strings from a Twine
It's useful when no format needs to happen, only the Twine needs to be put together.
llvm-svn: 367484
| -rw-r--r-- | llvm/include/llvm/Support/Error.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/Error.h b/llvm/include/llvm/Support/Error.h index 299fce7a136..1e3da7d49e1 100644 --- a/llvm/include/llvm/Support/Error.h +++ b/llvm/include/llvm/Support/Error.h @@ -1170,6 +1170,10 @@ inline Error createStringError(std::error_code EC, char const *Fmt, Error createStringError(std::error_code EC, char const *Msg); +static inline Error createStringError(std::error_code EC, const Twine &S) { + return createStringError(EC, S.str().c_str()); +} + template <typename... Ts> inline Error createStringError(std::errc EC, char const *Fmt, const Ts &... Vals) { |

