]> granicus.if.org Git - llvm/commit
Add flag to ArchiveWriter to test GNU64 format more efficiently
authorJake Ehrlich <jakehehrlich@google.com>
Fri, 1 Dec 2017 00:54:28 +0000 (00:54 +0000)
committerJake Ehrlich <jakehehrlich@google.com>
Fri, 1 Dec 2017 00:54:28 +0000 (00:54 +0000)
commit5c41fe91cd569b7dbae87bd918fdf2acded3b7b8
tree6211bf45ba56c6dddcb7f84fdb887e14dab84b50
parent9a4e15cb762e14a1725847c26b5104845b0f22b2
Add flag to ArchiveWriter to test GNU64 format more efficiently

Even with the sparse file optimizations the SYM64 test can still be painfully
slow. This unnecessarily slows down devs. It's critical that we test that the
switch to the SYM64 format occurs at 4GB but there isn't any better of a way to
fake the size of the file than sparse files. This change introduces a flag that
allows the cutoff to be arbitrarily set to whatever power of two is desired.
The flag is hidden as it really isn't meant to be used outside this one test.
This is unfortunate but appears necessary, at least until the average hard
drive is much faster.

The changes to the test require some explanation. Prior to this change we knew
that the SYM64 format was being used because the file was simply too large to
have validly handled this case if the SYM64 format were not used. To ensure
that the SYM64 format is still being used I am grepping the file for "SYM64".
Without changing the filename however this would be pointless because "SYM64"
would occur in the file either way. So the filename of the test is also changed
in order to avoid this issue.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319507 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Object/ArchiveWriter.cpp
test/Object/archive-GNU64-write.test [moved from test/Object/archive-SYM64-write.test with 77% similarity]