blob: 5692cdfcdf7b704500d8be1276d9c34211296022 [file] [log] [blame]
Zachary Turnercb30e702017-06-14 16:41:50 +00001//===- llvm/Testing/Support/Error.cpp -------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/Testing/Support/Error.h"
11
12#include "llvm/ADT/StringRef.h"
13
14using namespace llvm;
15
16llvm::detail::ErrorHolder llvm::detail::TakeError(llvm::Error Err) {
Pavel Labath510725c2018-04-05 14:32:10 +000017 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));
21 });
22 return {std::move(Infos)};
Zachary Turnercb30e702017-06-14 16:41:50 +000023}