summaryrefslogtreecommitdiffstats
path: root/llvm/tools/obj2yaml/macho2yaml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/obj2yaml/macho2yaml.cpp')
-rw-r--r--llvm/tools/obj2yaml/macho2yaml.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/llvm/tools/obj2yaml/macho2yaml.cpp b/llvm/tools/obj2yaml/macho2yaml.cpp
new file mode 100644
index 00000000000..c3b972dcbe3
--- /dev/null
+++ b/llvm/tools/obj2yaml/macho2yaml.cpp
@@ -0,0 +1,35 @@
+//===------ macho2yaml.cpp - obj2yaml conversion tool -----------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Error.h"
+#include "obj2yaml.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Object/MachOUniversal.h"
+
+using namespace llvm;
+
+std::error_code macho2yaml(raw_ostream &Out,
+ const object::MachOObjectFile &Obj) {
+ return obj2yaml_error::not_implemented;
+}
+
+std::error_code macho2yaml(raw_ostream &Out,
+ const object::MachOUniversalBinary &Obj) {
+ return obj2yaml_error::not_implemented;
+}
+
+std::error_code macho2yaml(raw_ostream &Out, const object::ObjectFile &Obj) {
+ if (const auto *MachOObj = dyn_cast<object::MachOUniversalBinary>(&Obj))
+ return macho2yaml(Out, *MachOObj);
+
+ if (const auto *MachOObj = dyn_cast<object::MachOObjectFile>(&Obj))
+ return macho2yaml(Out, *MachOObj);
+
+ return obj2yaml_error::unsupported_obj_file_format;
+}
OpenPOWER on IntegriCloud