[PATCH] D85550: [lld-macho] Implement -force_load
Saleem Abdulrasool via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 10 09:08:20 PDT 2020
compnerd added inline comments.
================
Comment at: lld/MachO/Driver.cpp:268
+ mb.getBufferIdentifier() +
+ ": could not get the buffer for a child of the archive");
+ v.push_back(mbref);
----------------
Can we do any better in terms of diagnostics here? Perhaps stringify the error?
================
Comment at: lld/MachO/Driver.cpp:273
+ fatal(mb.getBufferIdentifier() +
+ ": Archive::children failed: " + toString(std::move(err)));
+
----------------
This seems ... duplicative. The `fatal` is necessary, but Im not sure about printing out a subsequent message.
================
Comment at: lld/MachO/Driver.cpp:285
+ for (MemoryBufferRef memberBuffer : getArchiveMembers(mbref))
+ inputFiles.push_back(make<ObjFile>(memberBuffer));
+}
----------------
Id just cascade this:
```
if (Optional<MemoryBufferRef> archive = readFile(path))
for (MemoryBufferRef member: getArchiveMembers(*archive))
inputFiles.push_back(make<ObjFile>(member));
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85550/new/
https://reviews.llvm.org/D85550
More information about the llvm-commits
mailing list