From 7c7aba6e5fef47a01a136be655b0a92cfd7090f6 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 16 Jun 2017 21:03:24 +0000 Subject: Vendor import of llvm trunk r305575: https://llvm.org/svn/llvm-project/llvm/trunk@305575 --- lib/Testing/Support/Error.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lib/Testing/Support/Error.cpp (limited to 'lib/Testing/Support/Error.cpp') diff --git a/lib/Testing/Support/Error.cpp b/lib/Testing/Support/Error.cpp new file mode 100644 index 0000000000000..ce0da44da408b --- /dev/null +++ b/lib/Testing/Support/Error.cpp @@ -0,0 +1,22 @@ +//===- llvm/Testing/Support/Error.cpp -------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/Testing/Support/Error.h" + +#include "llvm/ADT/StringRef.h" + +using namespace llvm; + +llvm::detail::ErrorHolder llvm::detail::TakeError(llvm::Error Err) { + bool Succeeded = !static_cast(Err); + std::string Message; + if (!Succeeded) + Message = toString(std::move(Err)); + return {Succeeded, Message}; +} -- cgit v1.2.3