[PATCH] D62919: [llvm-ar] Create thin archives with MRI scripts
Owen Reynolds via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 6 06:18:45 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL362704: [llvm-ar] Create thin archives with MRI scripts (authored by gbreynoo, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D62919?vs=203325&id=203342#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62919/new/
https://reviews.llvm.org/D62919
Files:
llvm/trunk/test/tools/llvm-ar/mri-thin-archive.test
llvm/trunk/tools/llvm-ar/llvm-ar.cpp
Index: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
===================================================================
--- llvm/trunk/tools/llvm-ar/llvm-ar.cpp
+++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp
@@ -952,7 +952,7 @@
}
static void runMRIScript() {
- enum class MRICommand { AddLib, AddMod, Create, Delete, Save, End, Invalid };
+ enum class MRICommand { AddLib, AddMod, Create, CreateThin, Delete, Save, End, Invalid };
ErrorOr<std::unique_ptr<MemoryBuffer>> Buf = MemoryBuffer::getSTDIN();
failIfError(Buf.getError());
@@ -976,6 +976,7 @@
.Case("addlib", MRICommand::AddLib)
.Case("addmod", MRICommand::AddMod)
.Case("create", MRICommand::Create)
+ .Case("createthin", MRICommand::CreateThin)
.Case("delete", MRICommand::Delete)
.Case("save", MRICommand::Save)
.Case("end", MRICommand::End)
@@ -995,6 +996,9 @@
case MRICommand::AddMod:
addMember(NewMembers, Rest);
break;
+ case MRICommand::CreateThin:
+ Thin = true;
+ LLVM_FALLTHROUGH;
case MRICommand::Create:
Create = true;
if (!ArchiveName.empty())
Index: llvm/trunk/test/tools/llvm-ar/mri-thin-archive.test
===================================================================
--- llvm/trunk/test/tools/llvm-ar/mri-thin-archive.test
+++ llvm/trunk/test/tools/llvm-ar/mri-thin-archive.test
@@ -0,0 +1,23 @@
+RUN: rm -rf %t && mkdir -p %t/addlib/
+
+RUN: yaml2obj %S/Inputs/elf.yaml -o %t/elf.o
+RUN: cp %t/elf.o %t/addlib/elf.o
+RUN: cp %t/elf.o %t/delete.o
+
+RUN: cd %t && llvm-ar rTc addlib/addlib.ar addlib/elf.o
+
+RUN: echo "createthin %t/archive.ar" > %t/mri.script
+RUN: echo "addmod elf.o" >> %t/mri.script
+RUN: echo "addlib addlib/addlib.ar" >> %t/mri.script
+RUN: echo "addmod delete.o" >> %t/mri.script
+RUN: echo "delete delete.o" >> %t/mri.script
+RUN: echo "save" >> %t/mri.script
+RUN: echo "end" >> %t/mri.script
+
+RUN: cd %t && llvm-ar -M < mri.script
+RUN: FileCheck -input-file=%t/archive.ar %s
+
+CHECK: !<thin>
+CHECK: elf.o
+CHECK-NEXT: addlib/elf.o/
+CHECK-NOT: delete.o
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62919.203342.patch
Type: text/x-patch
Size: 2179 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190606/34e3be1a/attachment.bin>
More information about the llvm-commits
mailing list