[PATCH] D78342: [lld] Add archive file support to Mach-O backend

Kellie Medlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 14 12:31:15 PDT 2020


Ktwu marked an inline comment as done.
Ktwu added inline comments.


================
Comment at: lld/MachO/Driver.cpp:116
+
+    inputFiles.push_back(make<ArchiveFile>(file.release()));
+    break;
----------------
smeenai wrote:
> So we're just leaking the memory for the Archive? That's not ideal.
> 
> LLD ELF has the `unique_ptr<object::Archive>` be a member of `ArchiveFile` and moves the pointer here into the constructor. Can we do the same?
I originally had it so that ArchiveFile owned the input archive, but @int3 mentioned passing around unique_ptr is weird, so I made this change and figured leaking was acceptable given the globals in the linker :(




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78342/new/

https://reviews.llvm.org/D78342





More information about the llvm-commits mailing list