aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Testing/Support/Error.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Testing/Support/Error.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Testing/Support/Error.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/llvm-project/llvm/lib/Testing/Support/Error.cpp b/contrib/llvm-project/llvm/lib/Testing/Support/Error.cpp
new file mode 100644
index 000000000000..657092146cae
--- /dev/null
+++ b/contrib/llvm-project/llvm/lib/Testing/Support/Error.cpp
@@ -0,0 +1,20 @@
+//===- llvm/Testing/Support/Error.cpp -------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Testing/Support/Error.h"
+
+using namespace llvm;
+
+llvm::detail::ErrorHolder llvm::detail::TakeError(llvm::Error Err) {
+ 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)};
+}