mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-28 14:10:41 +00:00
Initial add for MachO support for yaml2obj
Adding the initial files for adding MachO support to yaml2obj. Passing a MachO file will result in an error. I will be implementing obj2yaml and yaml2obj for MachO in parallel so that one can be used to test the other. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269244 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bf924c1084
commit
e05aeff019
@ -9,4 +9,5 @@ add_llvm_tool(yaml2obj
|
||||
yaml2obj.cpp
|
||||
yaml2coff.cpp
|
||||
yaml2elf.cpp
|
||||
yaml2macho.cpp
|
||||
)
|
||||
|
23
tools/yaml2obj/yaml2macho.cpp
Normal file
23
tools/yaml2obj/yaml2macho.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
//===- yaml2macho - Convert YAML to a Mach object file --------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
///
|
||||
/// \file
|
||||
/// \brief The Mach component of yaml2obj.
|
||||
///
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "yaml2obj.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
int yaml2macho(llvm::yaml::Input &YIn, llvm::raw_ostream &Out) {
|
||||
errs() << "yaml2obj: Mach-O not implemented yet!\n";
|
||||
return 1;
|
||||
}
|
@ -42,7 +42,8 @@ static cl::opt<std::string>
|
||||
// library.
|
||||
enum YAMLObjectFormat {
|
||||
YOF_COFF,
|
||||
YOF_ELF
|
||||
YOF_ELF,
|
||||
YOF_MACHO
|
||||
};
|
||||
|
||||
cl::opt<YAMLObjectFormat> Format(
|
||||
@ -51,6 +52,7 @@ cl::opt<YAMLObjectFormat> Format(
|
||||
cl::values(
|
||||
clEnumValN(YOF_COFF, "coff", "COFF object file format"),
|
||||
clEnumValN(YOF_ELF, "elf", "ELF object file format"),
|
||||
clEnumValN(YOF_MACHO, "macho", "Mach-O object file format"),
|
||||
clEnumValEnd));
|
||||
|
||||
cl::opt<unsigned>
|
||||
@ -102,6 +104,8 @@ int main(int argc, char **argv) {
|
||||
Convert = yaml2coff;
|
||||
else if (Format == YOF_ELF)
|
||||
Convert = yaml2elf;
|
||||
else if (Format == YOF_MACHO)
|
||||
Convert = yaml2macho;
|
||||
else {
|
||||
errs() << "Not yet implemented\n";
|
||||
return 1;
|
||||
|
@ -20,5 +20,6 @@ class Input;
|
||||
}
|
||||
int yaml2coff(llvm::yaml::Input &YIn, llvm::raw_ostream &Out);
|
||||
int yaml2elf(llvm::yaml::Input &YIn, llvm::raw_ostream &Out);
|
||||
int yaml2macho(llvm::yaml::Input &YIn, llvm::raw_ostream &Out);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user