summaryrefslogtreecommitdiff
path: root/ELF/Error.h
diff options
context:
space:
mode:
Diffstat (limited to 'ELF/Error.h')
-rw-r--r--ELF/Error.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/ELF/Error.h b/ELF/Error.h
new file mode 100644
index 0000000000000..b1d2e7a8fc5b9
--- /dev/null
+++ b/ELF/Error.h
@@ -0,0 +1,32 @@
+//===- Error.h --------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Linker
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLD_COFF_ERROR_H
+#define LLD_COFF_ERROR_H
+
+#include "lld/Core/LLVM.h"
+
+namespace lld {
+namespace elf2 {
+
+void warning(const Twine &Msg);
+
+LLVM_ATTRIBUTE_NORETURN void error(const Twine &Msg);
+void error(std::error_code EC, const Twine &Prefix);
+void error(std::error_code EC);
+
+template <typename T> void error(const ErrorOr<T> &V, const Twine &Prefix) {
+ error(V.getError(), Prefix);
+}
+template <typename T> void error(const ErrorOr<T> &V) { error(V.getError()); }
+
+} // namespace elf2
+} // namespace lld
+
+#endif