[InstCombine] Signed saturation tests. NFC
[llvm-complete.git] / lib / Testing / Support / Error.cpp
bloba5f8f9b47b3f62ddf1f27193cc9ef6fb26fa8377
1 //===- llvm/Testing/Support/Error.cpp -------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "llvm/Testing/Support/Error.h"
11 #include "llvm/ADT/StringRef.h"
13 using namespace llvm;
15 llvm::detail::ErrorHolder llvm::detail::TakeError(llvm::Error Err) {
16 std::vector<std::shared_ptr<ErrorInfoBase>> Infos;
17 handleAllErrors(std::move(Err),
18 [&Infos](std::unique_ptr<ErrorInfoBase> Info) {
19 Infos.emplace_back(std::move(Info));
20 });
21 return {std::move(Infos)};