summaryrefslogtreecommitdiffstats
path: root/llvm/tools/obj2yaml/Error.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-05-12 01:52:33 +0000
committerChris Bieneman <beanz@apple.com>2016-05-12 01:52:33 +0000
commitde60ad33b37e19cbf73b53feed6428886d358f02 (patch)
treedebc8251e5d1c6a43bf33bd502318004fdad07f9 /llvm/tools/obj2yaml/Error.cpp
parent9926a5e31de0834d7a70bf1837777b94a72e5111 (diff)
downloadbcm5719-llvm-de60ad33b37e19cbf73b53feed6428886d358f02.tar.gz
bcm5719-llvm-de60ad33b37e19cbf73b53feed6428886d358f02.zip
[obj2yaml] Adding Error/Expected to macho2yaml
I figure if I'm adding Mach support I may as well use the new fancy Error model. llvm-svn: 269264
Diffstat (limited to 'llvm/tools/obj2yaml/Error.cpp')
-rw-r--r--llvm/tools/obj2yaml/Error.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/tools/obj2yaml/Error.cpp b/llvm/tools/obj2yaml/Error.cpp
index 9eb70c6a47b..9c2aeefef2f 100644
--- a/llvm/tools/obj2yaml/Error.cpp
+++ b/llvm/tools/obj2yaml/Error.cpp
@@ -42,8 +42,18 @@ std::string _obj2yaml_error_category::message(int ev) const {
}
namespace llvm {
- const std::error_category &obj2yaml_category() {
+
+const std::error_category &obj2yaml_category() {
static _obj2yaml_error_category o;
return o;
}
+
+char Obj2YamlError::ID = 0;
+
+void Obj2YamlError::log(raw_ostream &OS) const { OS << ErrMsg << "\n"; }
+
+std::error_code Obj2YamlError::convertToErrorCode() const {
+ return std::error_code(static_cast<int>(Code), obj2yaml_category());
+}
+
} // namespace llvm
OpenPOWER on IntegriCloud