diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-11 12:38:02 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-11 12:38:02 +0000 |
commit | 4d7b3be00ba461a7b4974722165ce5cd2af39cb1 (patch) | |
tree | dea0a98904975d91f933b1788e094c8fc972e196 /llvm/tools/llvm-ar/llvm-ar.cpp | |
parent | 40db06af64570f0c4e627d5c0cd6a3e388ca3ccb (diff) | |
download | bcm5719-llvm-4d7b3be00ba461a7b4974722165ce5cd2af39cb1.tar.gz bcm5719-llvm-4d7b3be00ba461a7b4974722165ce5cd2af39cb1.zip |
Remove support for truncating names in archives.
* All systems we support have some form of long name support.
* The options has different names and semantics in different implementations
('f' on gnu, 'T' on OS X), which makes it unlikely it is normally used on
build systems.
* It was completely untested.
llvm-svn: 186078
Diffstat (limited to 'llvm/tools/llvm-ar/llvm-ar.cpp')
-rw-r--r-- | llvm/tools/llvm-ar/llvm-ar.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp index 9e17853fd51..3d5250ee53b 100644 --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/tools/llvm-ar/llvm-ar.cpp @@ -64,7 +64,6 @@ static cl::extrahelp MoreHelp( "\nMODIFIERS (operation specific):\n" " [a] - put file(s) after [relpos]\n" " [b] - put file(s) before [relpos] (same as [i])\n" - " [f] - truncate inserted file names\n" " [i] - put file(s) before [relpos] (same as [b])\n" " [N] - use instance [count] of name\n" " [o] - preserve original dates\n" @@ -93,7 +92,6 @@ enum ArchiveOperation { bool AddAfter = false; ///< 'a' modifier bool AddBefore = false; ///< 'b' modifier bool Create = false; ///< 'c' modifier -bool TruncateNames = false; ///< 'f' modifier bool InsertBefore = false; ///< 'i' modifier bool UseCount = false; ///< 'N' modifier bool OriginalDates = false; ///< 'o' modifier @@ -213,7 +211,6 @@ ArchiveOperation parseCommandLine() { case 't': ++NumOperations; Operation = DisplayTable; break; case 'x': ++NumOperations; Operation = Extract; break; case 'c': Create = true; break; - case 'f': TruncateNames = true; break; case 'l': /* accepted but unused */ break; case 'o': OriginalDates = true; break; case 's': break; // Ignore for now. @@ -267,9 +264,6 @@ ArchiveOperation parseCommandLine() { } if (OriginalDates && Operation != Extract) show_help("The 'o' modifier is only applicable to the 'x' operation"); - if (TruncateNames && Operation!=QuickAppend && Operation!=ReplaceOrInsert) - show_help("The 'f' modifier is only applicable to the 'q' and 'r' " - "operations"); if (OnlyUpdate && Operation != ReplaceOrInsert) show_help("The 'u' modifier is only applicable to the 'r' operation"); if (Count > 1 && Members.size() > 1) @@ -460,7 +454,7 @@ doDelete(std::string* ErrMsg) { } // We're done editting, reconstruct the archive. - if (TheArchive->writeToDisk(TruncateNames,ErrMsg)) + if (TheArchive->writeToDisk(ErrMsg)) return true; return false; } @@ -513,7 +507,7 @@ doMove(std::string* ErrMsg) { } // We're done editting, reconstruct the archive. - if (TheArchive->writeToDisk(TruncateNames,ErrMsg)) + if (TheArchive->writeToDisk(ErrMsg)) return true; return false; } @@ -536,7 +530,7 @@ doQuickAppend(std::string* ErrMsg) { } // We're done editting, reconstruct the archive. - if (TheArchive->writeToDisk(TruncateNames,ErrMsg)) + if (TheArchive->writeToDisk(ErrMsg)) return true; return false; } @@ -569,18 +563,6 @@ doReplaceOrInsert(std::string* ErrMsg) { for (std::set<std::string>::iterator RI = remaining.begin(), RE = remaining.end(); RI != RE; ++RI ) { std::string compare(sys::path::filename(*RI)); - if (TruncateNames && compare.length() > 15) { - const char* nm = compare.c_str(); - unsigned len = compare.length(); - size_t slashpos = compare.rfind('/'); - if (slashpos != std::string::npos) { - nm += slashpos + 1; - len -= slashpos +1; - } - if (len > 15) - len = 15; - compare.assign(nm,len); - } if (compare == I->getPath().str()) { found = RI; break; @@ -631,7 +613,7 @@ doReplaceOrInsert(std::string* ErrMsg) { } // We're done editting, reconstruct the archive. - if (TheArchive->writeToDisk(TruncateNames,ErrMsg)) + if (TheArchive->writeToDisk(ErrMsg)) return true; return false; } |