aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Error.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Error.cpp')
-rw-r--r--llvm/lib/Support/Error.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Support/Error.cpp b/llvm/lib/Support/Error.cpp
index 34ec31e..93481ca 100644
--- a/llvm/lib/Support/Error.cpp
+++ b/llvm/lib/Support/Error.cpp
@@ -82,6 +82,14 @@ std::string toString(Error E) {
return join(Errors.begin(), Errors.end(), "\n");
}
+std::string toStringWithoutConsuming(const Error &E) {
+ SmallVector<std::string, 2> Errors;
+ visitErrors(E, [&Errors](const ErrorInfoBase &EI) {
+ Errors.push_back(EI.message());
+ });
+ return join(Errors.begin(), Errors.end(), "\n");
+}
+
std::error_code ErrorList::convertToErrorCode() const {
return std::error_code(static_cast<int>(ErrorErrorCode::MultipleErrors),
getErrorErrorCat());