[obj2yaml] Recognize input file format using llvm::object::ObjectFile
[oota-llvm.git] / tools / obj2yaml / coff2yaml.cpp
index ef709222a1728a2acaaa1a1d2df4f9128206a04e..42b09d312c253d1d76577c9020923ba35ef46743 100644 (file)
@@ -210,10 +210,7 @@ COFFYAML::Object &COFFDumper::getYAMLObj() {
   return YAMLObj;
 }
 
-error_code coff2yaml(raw_ostream &Out, MemoryBuffer *Buff) {
-  error_code ec;
-  object::COFFObjectFile Obj(Buff, ec);
-  check(ec);
+error_code coff2yaml(raw_ostream &Out, const object::COFFObjectFile &Obj) {
   COFFDumper Dumper(Obj);
 
   yaml::Output Yout(Out);