diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 13:23:48 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 13:23:48 +0000 |
commit | 73dd376467074dffb3a3243985e3b2af10079f3a (patch) | |
tree | 318186ad5ae3eb3cab12c5e7b57922ef5e37a174 /llvm/tools/llvm-ar/llvm-ar.cpp | |
parent | 2a65c32094201fad938137cfbde654ad2820adba (diff) | |
download | bcm5719-llvm-73dd376467074dffb3a3243985e3b2af10079f3a.tar.gz bcm5719-llvm-73dd376467074dffb3a3243985e3b2af10079f3a.zip |
Revert "Don't include directory names in archives."
This reverts commit 184420.
Investigating the bot failures.
llvm-svn: 184421
Diffstat (limited to 'llvm/tools/llvm-ar/llvm-ar.cpp')
-rw-r--r-- | llvm/tools/llvm-ar/llvm-ar.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp index 941b6310804..36bec4206d3 100644 --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/tools/llvm-ar/llvm-ar.cpp @@ -399,6 +399,14 @@ doExtract(std::string* ErrMsg) { if (Paths.empty() || (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) { + // Make sure the intervening directories are created + if (I->hasPath()) { + sys::Path dirs(I->getPath()); + dirs.eraseComponent(); + if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg)) + return true; + } + // Open up a file stream for writing std::ios::openmode io_mode = std::ios::out | std::ios::trunc | std::ios::binary; |