summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Testing/Support/Error.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Testing/Support/Error.cpp')
-rw-r--r--contrib/llvm/lib/Testing/Support/Error.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/contrib/llvm/lib/Testing/Support/Error.cpp b/contrib/llvm/lib/Testing/Support/Error.cpp
new file mode 100644
index 0000000..ce0da44
--- /dev/null
+++ b/contrib/llvm/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<bool>(Err);
+ std::string Message;
+ if (!Succeeded)
+ Message = toString(std::move(Err));
+ return {Succeeded, Message};
+}
OpenPOWER on IntegriCloud