Only computeRelativePath() on new members
authorDavid Callahan <dcallahan@fb.com>
Wed, 30 Nov 2016 22:32:58 +0000 (22:32 +0000)
committerDavid Callahan <dcallahan@fb.com>
Wed, 30 Nov 2016 22:32:58 +0000 (22:32 +0000)
commit5cb34077e879c03d460dedad7aaa421bd2bd08a3
treed3677f3af106f0e2c59bd218bf6cb51d4a953d11
parent75818bc8f76b317ae79fdf69428ee6a2e1630fb2
Only computeRelativePath() on new members

Summary:
When using thin archives, and processing the same archive multiple times, we were mangling existing entries.  The root cause is that we were calling computeRelativePath() more than once.   Here, we only call it when adding new members to an archive.

Note that D27218 changes the way thin archives are printed, and will break the new unit test included here.  Depending on which one lands first, the other will need to be slightly modified.

Reviewers: rafael, davide

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D27217

llvm-svn: 288280
llvm/include/llvm/Object/ArchiveWriter.h
llvm/lib/Object/ArchiveWriter.cpp
llvm/test/Object/archive-thin-create.test [new file with mode: 0644]