void ObjectFile::parse() { // Parse a memory buffer as a COFF file. std::unique_ptr<Binary> Bin = check(createBinary(MB), "failed to parse object file"); if (auto *Obj = dyn_cast<COFFObjectFile>(Bin.get())) { Bin.release(); COFFObj.reset(Obj); } else { fatal(getName() + " is not a COFF file"); } // Read section and symbol tables. initializeChunks(); initializeSymbols(); initializeSEH(); }
void ObjectFile::parse() { // Parse a memory buffer as a COFF file. auto BinOrErr = createBinary(MB); error(BinOrErr, "Failed to parse object file"); std::unique_ptr<Binary> Bin = std::move(*BinOrErr); if (auto *Obj = dyn_cast<COFFObjectFile>(Bin.get())) { Bin.release(); COFFObj.reset(Obj); } else { error(Twine(getName()) + " is not a COFF file."); } // Read section and symbol tables. initializeChunks(); initializeSymbols(); initializeSEH(); }