[PATCH] D94643: [llvm-link] Improve link time for bitcode archives [NFC]
Sergey Dmitriev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 19 17:42:29 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG233106269db6: [llvm-link] Improve link time for bitcode archives [NFC] (authored by sdmitriev).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94643/new/
https://reviews.llvm.org/D94643
Files:
llvm/tools/llvm-link/llvm-link.cpp
Index: llvm/tools/llvm-link/llvm-link.cpp
===================================================================
--- llvm/tools/llvm-link/llvm-link.cpp
+++ llvm/tools/llvm-link/llvm-link.cpp
@@ -153,6 +153,7 @@
Error Err = Error::success();
object::Archive Archive(*Buffer, Err);
ExitOnErr(std::move(Err));
+ Linker L(*Result);
for (const object::Archive::Child &C : Archive.children(Err)) {
Expected<StringRef> Ename = C.getName();
if (Error E = Ename.takeError()) {
@@ -186,7 +187,12 @@
return nullptr;
}
- std::unique_ptr<Module> M = parseIR(MemBuf.get(), ParseErr, Context);
+ std::unique_ptr<Module> M;
+ if (DisableLazyLoad)
+ M = parseIR(MemBuf.get(), ParseErr, Context);
+ else
+ M = getLazyIRModule(MemoryBuffer::getMemBuffer(MemBuf.get(), false),
+ ParseErr, Context);
if (!M.get()) {
errs() << Argv0 << ": ";
@@ -197,7 +203,7 @@
}
if (Verbose)
errs() << "Linking member '" << ChildName << "' of archive library.\n";
- if (Linker::linkModules(*Result, std::move(M)))
+ if (L.linkInModule(std::move(M)))
return nullptr;
} // end for each child
ExitOnErr(std::move(Err));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94643.317733.patch
Type: text/x-patch
Size: 1211 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210120/4bb9af09/attachment.bin>
More information about the llvm-commits
mailing list