1 //===- llvm/Testing/Support/Error.cpp -------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/Testing/Support/Error.h"
12 #include "llvm/ADT/StringRef.h"
16 llvm::detail::ErrorHolder llvm::detail::TakeError(llvm::Error Err) {
17 std::vector<std::shared_ptr<ErrorInfoBase>> Infos;
18 handleAllErrors(std::move(Err),
19 [&Infos](std::unique_ptr<ErrorInfoBase> Info) {
20 Infos.emplace_back(std::move(Info));
22 return {std::move(Infos)};