mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 02:25:01 +00:00
Handle the error of trying to convert a regular archive to a thin one.
While at it, test that we can add to a thin archive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242330 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -436,9 +436,20 @@ static void performReadOperation(ArchiveOperation Operation,
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void addMember(std::vector<NewArchiveIterator> &Members, T I, StringRef Name,
|
||||
void addMember(std::vector<NewArchiveIterator> &Members, StringRef FileName,
|
||||
StringRef Name, int Pos = -1) {
|
||||
NewArchiveIterator NI(FileName, Name);
|
||||
if (Pos == -1)
|
||||
Members.push_back(NI);
|
||||
else
|
||||
Members[Pos] = NI;
|
||||
}
|
||||
|
||||
void addMember(std::vector<NewArchiveIterator> &Members,
|
||||
object::Archive::child_iterator I, StringRef Name,
|
||||
int Pos = -1) {
|
||||
if (Thin && !I->getParent()->isThin())
|
||||
fail("Cannot convert a regular archive to a thin one");
|
||||
NewArchiveIterator NI(I, Name);
|
||||
if (Pos == -1)
|
||||
Members.push_back(NI);
|
||||
|
Reference in New Issue
Block a user