blob: c3b972dcbe3b1a6e13103218aa275d61a5f11168 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;
}
|