diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -1401,7 +1401,7 @@ llvm::Expected> objectToAtoms(const NormalizedFile &normalizedFile, StringRef path, bool copyRefs) { - std::unique_ptr file(new MachOFile(path)); + auto file = std::make_unique(path); if (auto ec = normalizedObjectToAtoms(file.get(), normalizedFile, copyRefs)) return std::move(ec); return std::unique_ptr(std::move(file)); @@ -1411,7 +1411,7 @@ dylibToAtoms(const NormalizedFile &normalizedFile, StringRef path, bool copyRefs) { // Instantiate SharedLibraryFile object. - std::unique_ptr file(new MachODylibFile(path)); + auto file = std::make_unique(path); if (auto ec = normalizedDylibToAtoms(file.get(), normalizedFile, copyRefs)) return std::move(ec); return std::unique_ptr(std::move(file));