aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/Testing/Support/Error.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Testing/Support/Error.cpp')
-rw-r--r--contrib/llvm/lib/Testing/Support/Error.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/contrib/llvm/lib/Testing/Support/Error.cpp b/contrib/llvm/lib/Testing/Support/Error.cpp
index ce0da44da408..5692cdfcdf7b 100644
--- a/contrib/llvm/lib/Testing/Support/Error.cpp
+++ b/contrib/llvm/lib/Testing/Support/Error.cpp
@@ -14,9 +14,10 @@
using namespace llvm;
llvm::detail::ErrorHolder llvm::detail::TakeError(llvm::Error Err) {
- bool Succeeded = !static_cast<bool>(Err);
- std::string Message;
- if (!Succeeded)
- Message = toString(std::move(Err));
- return {Succeeded, Message};
+ std::vector<std::shared_ptr<ErrorInfoBase>> Infos;
+ handleAllErrors(std::move(Err),
+ [&Infos](std::unique_ptr<ErrorInfoBase> Info) {
+ Infos.emplace_back(std::move(Info));
+ });
+ return {std::move(Infos)};
}