[yaml2obj] Move some classes into anonymous namespaces.
[oota-llvm.git] / tools / yaml2obj / yaml2obj.cpp
index a9ac78bce4869863c57ec4adaa7435a10136389f..6d1107c8581240ddadeb5c2b6c970b2aa97f6cd7 100644 (file)
@@ -38,7 +38,8 @@ static cl::opt<std::string>
 // them appropriately requires some work in the YAML parser and the YAMLIO
 // library.
 enum YAMLObjectFormat {
-  YOF_COFF
+  YOF_COFF,
+  YOF_ELF
 };
 
 cl::opt<YAMLObjectFormat> Format(
@@ -46,6 +47,7 @@ cl::opt<YAMLObjectFormat> Format(
   cl::desc("Interpret input as this type of object file"),
   cl::values(
     clEnumValN(YOF_COFF, "coff", "COFF object file format"),
+    clEnumValN(YOF_ELF, "elf", "ELF object file format"),
   clEnumValEnd));
 
 
@@ -60,6 +62,8 @@ int main(int argc, char **argv) {
     return 1;
   if (Format == YOF_COFF) {
     return yaml2coff(outs(), Buf.get());
+  } else if (Format == YOF_ELF) {
+    return yaml2elf(outs(), Buf.get());
   } else {
     errs() << "Not yet implemented\n";
     return 1;