- // Process the input file
- OwningPtr<MemoryBuffer> buf;
-
- // TODO: If this is an archive, then burst it and dump each entry
- if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, buf)) {
- errs() << "Error: '" << ec.message() << "' opening file '" << InputFilename
- << "'\n";
- } else {
- ec = coff2yaml(outs(), buf.take());
- if (ec)
- errs() << "Error: " << ec.message() << " dumping COFF file\n";
+ if (std::error_code EC = dumpInput(InputFilename)) {
+ errs() << "Error: '" << EC.message() << "'\n";
+ return 1;