llvm.org GIT mirror llvm / 201c66c
Remove a trivial use of sys::Path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184455 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 7 years ago
1 changed file(s) with 5 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
652652 // can't handle the grouped positional parameters without a dash.
653653 ArchiveOperation Operation = parseCommandLine();
654654
655 // Check the path name of the archive
656 sys::Path ArchivePath;
657 if (!ArchivePath.set(ArchiveName)) {
658 errs() << argv[0] << ": Archive name invalid: " << ArchiveName << "\n";
659 return 1;
660 }
661
662655 // Create or open the archive object.
663656 bool Exists;
664 if (llvm::sys::fs::exists(ArchivePath.str(), Exists) || !Exists) {
657 if (llvm::sys::fs::exists(ArchiveName, Exists) || !Exists) {
665658 // Produce a warning if we should and we're creating the archive
666659 if (!Create)
667 errs() << argv[0] << ": creating " << ArchivePath.str() << "\n";
668 TheArchive = Archive::CreateEmpty(ArchivePath.str(), Context);
660 errs() << argv[0] << ": creating " << ArchiveName << "\n";
661 TheArchive = Archive::CreateEmpty(ArchiveName, Context);
669662 TheArchive->writeToDisk();
670663 } else {
671664 std::string Error;
672 TheArchive = Archive::OpenAndLoad(ArchivePath.str(), Context, &Error);
665 TheArchive = Archive::OpenAndLoad(ArchiveName, Context, &Error);
673666 if (TheArchive == 0) {
674 errs() << argv[0] << ": error loading '" << ArchivePath.str() << "': "
667 errs() << argv[0] << ": error loading '" << ArchiveName << "': "
675668 << Error << "!\n";
676669 return 1;
677670 }