diff options
-rw-r--r-- | llvm/tools/yaml2obj/CMakeLists.txt | 1 | ||||
-rw-r--r-- | llvm/tools/yaml2obj/yaml2macho.cpp | 23 | ||||
-rw-r--r-- | llvm/tools/yaml2obj/yaml2obj.cpp | 6 | ||||
-rw-r--r-- | llvm/tools/yaml2obj/yaml2obj.h | 1 |
4 files changed, 30 insertions, 1 deletions
diff --git a/llvm/tools/yaml2obj/CMakeLists.txt b/llvm/tools/yaml2obj/CMakeLists.txt index ac3fd7765c6..885a69f5d3c 100644 --- a/llvm/tools/yaml2obj/CMakeLists.txt +++ b/llvm/tools/yaml2obj/CMakeLists.txt @@ -9,4 +9,5 @@ add_llvm_tool(yaml2obj yaml2obj.cpp yaml2coff.cpp yaml2elf.cpp + yaml2macho.cpp ) diff --git a/llvm/tools/yaml2obj/yaml2macho.cpp b/llvm/tools/yaml2obj/yaml2macho.cpp new file mode 100644 index 00000000000..09a94ce2a40 --- /dev/null +++ b/llvm/tools/yaml2obj/yaml2macho.cpp @@ -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; +} diff --git a/llvm/tools/yaml2obj/yaml2obj.cpp b/llvm/tools/yaml2obj/yaml2obj.cpp index af4d8689067..cf1c82a26a9 100644 --- a/llvm/tools/yaml2obj/yaml2obj.cpp +++ b/llvm/tools/yaml2obj/yaml2obj.cpp @@ -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; diff --git a/llvm/tools/yaml2obj/yaml2obj.h b/llvm/tools/yaml2obj/yaml2obj.h index 7290a9af2c6..cd9845a7731 100644 --- a/llvm/tools/yaml2obj/yaml2obj.h +++ b/llvm/tools/yaml2obj/yaml2obj.h @@ -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 |