[PATCH] D124940: [AIX] llvm-link support big archive.
Digger Lin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 4 10:00:14 PDT 2022
DiggerLin created this revision.
DiggerLin added reviewers: MaskRay, jhenderson, hubert.reinterpretcast.
Herald added a subscriber: StephenFan.
Herald added a project: All.
DiggerLin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D124940
Files:
llvm/test/tools/llvm-link/archivell.ll
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
@@ -164,11 +164,16 @@
if (Verbose)
errs() << "Reading library archive file '" << ArchiveName
<< "' to memory\n";
- Error Err = Error::success();
- object::Archive Archive(*Buffer, Err);
- ExitOnErr(std::move(Err));
+ Expected<std::unique_ptr<object::Archive>> ArchiveOrError =
+ object::Archive::create(Buffer->getMemBufferRef());
+ if (!ArchiveOrError)
+ ExitOnErr(ArchiveOrError.takeError());
+
+ std::unique_ptr<object::Archive> Archive = std::move(ArchiveOrError.get());
+
Linker L(*Result);
- for (const object::Archive::Child &C : Archive.children(Err)) {
+ Error Err = Error::success();
+ for (const object::Archive::Child &C : Archive->children(Err)) {
Expected<StringRef> Ename = C.getName();
if (Error E = Ename.takeError()) {
errs() << Argv0 << ": ";
Index: llvm/test/tools/llvm-link/archivell.ll
===================================================================
--- llvm/test/tools/llvm-link/archivell.ll
+++ llvm/test/tools/llvm-link/archivell.ll
@@ -1,4 +1,3 @@
-# XFAIL: system-aix
# RUN: llvm-ar cr %t.fg.a %S/Inputs/f.ll %S/Inputs/g.ll
# RUN: not llvm-link %S/Inputs/h.ll %t.fg.a -o %t.linked.bc 2>&1 | FileCheck %s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124940.427049.patch
Type: text/x-patch
Size: 1384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220504/28c776cb/attachment.bin>
More information about the llvm-commits
mailing list