llvm.org GIT mirror llvm / 63b8c1f
Make llvm-ar behave like ar, if you create an empty archive, ar creates an empty archive. llvm-ar would not generate an output file in this case git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47733 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Lenharth 11 years ago
2 changed file(s) with 2 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
347347 {
348348 // Make sure they haven't opened up the file, not loaded it,
349349 // but are now trying to write it which would wipe out the file.
350 if (members.empty() && mapfile->size() > 8) {
350 if (members.empty() && mapfile && mapfile->size() > 8) {
351351 if (ErrMsg)
352352 *ErrMsg = "Can't write an archive not opened for writing";
353353 return true;
716716 if (!Create)
717717 std::cerr << argv[0] << ": creating " << ArchivePath.toString() << "\n";
718718 TheArchive = Archive::CreateEmpty(ArchivePath);
719 TheArchive->writeToDisk();
719720 } else {
720721 std::string Error;
721722 TheArchive = Archive::OpenAndLoad(ArchivePath, &Error);