[llvm-commits] [llvm] r161651 - in /llvm/trunk: docs/CommandGuide/llvm-ar.rst include/llvm/Bitcode/Archive.h lib/Archive/ArchiveReader.cpp lib/Archive/ArchiveWriter.cpp tools/llvm-ar/llvm-ar.cpp tools/llvm-ranlib/llvm-ranlib.cpp

Rafael Espindola rafael.espindola at gmail.com
Thu Aug 9 18:57:53 PDT 2012


Author: rafael
Date: Thu Aug  9 20:57:52 2012
New Revision: 161651

URL: http://llvm.org/viewvc/llvm-project?rev=161651&view=rev
Log:
Remove references to compression in llvm-ar. It has been a long time since we
switched from a bytecode+bzip2 to the current bitcode.

Modified:
    llvm/trunk/docs/CommandGuide/llvm-ar.rst
    llvm/trunk/include/llvm/Bitcode/Archive.h
    llvm/trunk/lib/Archive/ArchiveReader.cpp
    llvm/trunk/lib/Archive/ArchiveWriter.cpp
    llvm/trunk/tools/llvm-ar/llvm-ar.cpp
    llvm/trunk/tools/llvm-ranlib/llvm-ranlib.cpp

Modified: llvm/trunk/docs/CommandGuide/llvm-ar.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-ar.rst?rev=161651&r1=161650&r2=161651&view=diff
==============================================================================
--- llvm/trunk/docs/CommandGuide/llvm-ar.rst (original)
+++ llvm/trunk/docs/CommandGuide/llvm-ar.rst Thu Aug  9 20:57:52 2012
@@ -6,7 +6,7 @@
 --------
 
 
-**llvm-ar** [-]{dmpqrtx}[Rabfikouz] [relpos] [count] <archive> [files...]
+**llvm-ar** [-]{dmpqrtx}[Rabfikou] [relpos] [count] <archive> [files...]
 
 
 DESCRIPTION
@@ -63,16 +63,6 @@
 
 
 
-*Compression*
-
- **llvm-ar** can compress the members of an archive to save space. The
- compression used depends on what's available on the platform and what choices
- the LLVM Compressor utility makes. It generally favors bzip2 but will select
- between "no compression" or bzip2 depending on what makes sense for the
- file's content.
-
-
-
 *Directory Recursion*
 
  Most ``ar`` implementations do not recurse through directories but simply
@@ -86,9 +76,8 @@
 
  When **llvm-ar** prints out the verbose table of contents (``tv`` option), it
  precedes the usual output with a character indicating the basic kind of
- content in the file. A blank means the file is a regular file. A 'Z' means
- the file is compressed. A 'B' means the file is an LLVM bitcode file. An
- 'S' means the file is the symbol table.
+ content in the file. A blank means the file is a regular file. A 'B' means
+ the file is an LLVM bitcode file. An 'S' means the file is the symbol table.
 
 
 
@@ -98,7 +87,7 @@
 
 
 The options to **llvm-ar** are compatible with other ``ar`` implementations.
-However, there are a few modifiers (*zR*) that are not found in other ``ar``
+However, there are a few modifiers (*R*) that are not found in other ``ar``
 implementations. The options to **llvm-ar** specify a single basic operation to
 perform on the archive, a variety of modifiers for that operation, the name of
 the archive file, and an optional list of file names. These options are used to
@@ -145,9 +134,9 @@
 
 
 
-q[Rfz]
+q[Rf]
 
- Quickly append files to the end of the archive. The *R*, *f*, and *z*
+ Quickly append files to the end of the archive. The *R*, and *f*
  modifiers apply to this operation.  This operation quickly adds the
  *files* to the archive without checking for duplicates that should be
  removed first. If no *files* are specified, the archive is not modified.
@@ -156,9 +145,9 @@
 
 
 
-r[Rabfuz]
+r[Rabfu]
 
- Replace or insert file members. The *R*, *a*, *b*, *f*, *u*, and *z*
+ Replace or insert file members. The *R*, *a*, *b*, *f*, and *u*
  modifiers apply to this operation. This operation will replace existing
  *files* or insert them at the end of the archive if they do not exist. If no
  *files* are specified, the archive is not modified.
@@ -169,7 +158,7 @@
 
  Print the table of contents. Without any modifiers, this operation just prints
  the names of the members to the standard output. With the *v* modifier,
- **llvm-ar** also prints out the file type (B=bitcode, Z=compressed, S=symbol
+ **llvm-ar** also prints out the file type (B=bitcode, S=symbol
  table, blank=regular file), the permission mode, the owner and group, the
  size, and the date. If any *files* are specified, the listing is only for
  those files. If no *files* are specified, the table of contents for the
@@ -273,15 +262,6 @@
 
 
 
-[z]
-
- When inserting or replacing any file in the archive, compress the file first.
- This
- modifier is safe to use when (previously) compressed bitcode files are added to
- the archive; the compressed bitcode files will not be doubly compressed.
-
-
-
 
 Modifiers (generic)
 ~~~~~~~~~~~~~~~~~~~
@@ -410,11 +390,7 @@
 size - char[10]
 
  This field provides the size of the file, in bytes, encoded as a decimal ASCII
- string. If the size field is negative (starts with a minus sign, 0x02D), then
- the archive member is stored in compressed form. The first byte of the archive
- member's data indicates the compression type used. A value of 0 (0x30) indicates
- that no compression was used. A value of 2 (0x32) indicates that bzip2
- compression was used.
+ string.
 
 
 

Modified: llvm/trunk/include/llvm/Bitcode/Archive.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Archive.h?rev=161651&r1=161650&r2=161651&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/Archive.h (original)
+++ llvm/trunk/include/llvm/Bitcode/Archive.h Thu Aug  9 20:57:52 2012
@@ -47,14 +47,13 @@
     /// characteristics of the member. The various "is" methods below provide
     /// access to the flags. The flags are not user settable.
     enum Flags {
-      CompressedFlag = 1,          ///< Member is a normal compressed file
-      SVR4SymbolTableFlag = 2,     ///< Member is a SVR4 symbol table
-      BSD4SymbolTableFlag = 4,     ///< Member is a BSD4 symbol table
-      LLVMSymbolTableFlag = 8,     ///< Member is an LLVM symbol table
-      BitcodeFlag = 16,            ///< Member is bitcode
-      HasPathFlag = 64,            ///< Member has a full or partial path
-      HasLongFilenameFlag = 128,   ///< Member uses the long filename syntax
-      StringTableFlag = 256        ///< Member is an ar(1) format string table
+      SVR4SymbolTableFlag = 1,     ///< Member is a SVR4 symbol table
+      BSD4SymbolTableFlag = 2,     ///< Member is a BSD4 symbol table
+      LLVMSymbolTableFlag = 4,     ///< Member is an LLVM symbol table
+      BitcodeFlag = 8,             ///< Member is bitcode
+      HasPathFlag = 16,            ///< Member has a full or partial path
+      HasLongFilenameFlag = 32,    ///< Member uses the long filename syntax
+      StringTableFlag = 64         ///< Member is an ar(1) format string table
     };
 
   /// @}
@@ -109,11 +108,6 @@
     /// @brief Get the data content of the archive member
     const char* getData() const { return data; }
 
-    /// This method determines if the member is a regular compressed file.
-    /// @returns true iff the archive member is a compressed regular file.
-    /// @brief Determine if the member is a compressed regular file.
-    bool isCompressed() const { return flags&CompressedFlag; }
-
     /// @returns true iff the member is a SVR4 (non-LLVM) symbol table
     /// @brief Determine if this member is a SVR4 symbol table.
     bool isSVR4SymbolTable() const { return flags&SVR4SymbolTableFlag; }
@@ -427,7 +421,6 @@
     bool writeToDisk(
       bool CreateSymbolTable=false,   ///< Create Symbol table
       bool TruncateNames=false,       ///< Truncate the filename to 15 chars
-      bool Compress=false,            ///< Compress files
       std::string* ErrMessage=0       ///< If non-null, where error msg is set
     );
 
@@ -494,7 +487,6 @@
       std::ofstream& ARFile,       ///< The file to write member onto
       bool CreateSymbolTable,      ///< Should symbol table be created?
       bool TruncateNames,          ///< Should names be truncated to 11 chars?
-      bool ShouldCompress,         ///< Should the member be compressed?
       std::string* ErrMessage      ///< If non-null, place were error msg is set
     );
 

Modified: llvm/trunk/lib/Archive/ArchiveReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveReader.cpp?rev=161651&r1=161650&r2=161651&view=diff
==============================================================================
--- llvm/trunk/lib/Archive/ArchiveReader.cpp (original)
+++ llvm/trunk/lib/Archive/ArchiveReader.cpp Thu Aug  9 20:57:52 2012
@@ -82,14 +82,9 @@
   ArchiveMemberHeader* Hdr = (ArchiveMemberHeader*)At;
   At += sizeof(ArchiveMemberHeader);
 
-  // Extract the size and determine if the file is
-  // compressed or not (negative length).
   int flags = 0;
   int MemberSize = atoi(Hdr->size);
-  if (MemberSize < 0) {
-    flags |= ArchiveMember::CompressedFlag;
-    MemberSize = -MemberSize;
-  }
+  assert(MemberSize >= 0);
 
   // Check the size of the member for sanity
   if (At + MemberSize > End) {

Modified: llvm/trunk/lib/Archive/ArchiveWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveWriter.cpp?rev=161651&r1=161650&r2=161651&view=diff
==============================================================================
--- llvm/trunk/lib/Archive/ArchiveWriter.cpp (original)
+++ llvm/trunk/lib/Archive/ArchiveWriter.cpp Thu Aug  9 20:57:52 2012
@@ -204,7 +204,6 @@
   std::ofstream& ARFile,
   bool CreateSymbolTable,
   bool TruncateNames,
-  bool ShouldCompress,
   std::string* ErrMsg
 ) {
 
@@ -349,7 +348,7 @@
 // table, flattening the file names (no directories, 15 chars max) and
 // compressing each archive member.
 bool
-Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
+Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames,
                      std::string* ErrMsg)
 {
   // Make sure they haven't opened up the file, not loaded it,
@@ -394,7 +393,7 @@
   // builds the symbol table, symTab.
   for (MembersList::iterator I = begin(), E = end(); I != E; ++I) {
     if (writeMember(*I, ArchiveFile, CreateSymbolTable,
-                     TruncateNames, Compress, ErrMsg)) {
+                     TruncateNames, ErrMsg)) {
       TmpArchive.eraseFromDisk();
       ArchiveFile.close();
       return true;
@@ -446,7 +445,7 @@
     // compatibility with other ar(1) implementations as well as allowing the
     // archive to store both native .o and LLVM .bc files, both indexed.
     if (foreignST) {
-      if (writeMember(*foreignST, FinalFile, false, false, false, ErrMsg)) {
+      if (writeMember(*foreignST, FinalFile, false, false, ErrMsg)) {
         FinalFile.close();
         TmpArchive.eraseFromDisk();
         return true;

Modified: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/llvm-ar.cpp?rev=161651&r1=161650&r2=161651&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
+++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Thu Aug  9 20:57:52 2012
@@ -50,7 +50,7 @@
   "  m[abiSs]     - move file(s) in the archive\n"
   "  p[kN]        - print file(s) found in the archive\n"
   "  q[ufsS]      - quick append file(s) to the archive\n"
-  "  r[abfiuzRsS] - replace or insert file(s) into the archive\n"
+  "  r[abfiuRsS]  - replace or insert file(s) into the archive\n"
   "  t            - display contents of archive\n"
   "  x[No]        - extract file(s) from the archive\n"
   "\nMODIFIERS (operation specific):\n"
@@ -66,7 +66,6 @@
   "  [s] - create an archive index (cf. ranlib)\n"
   "  [S] - do not build a symbol table\n"
   "  [u] - update only files newer than archive contents\n"
-  "  [z] - compress files before inserting/extracting\n"
   "\nMODIFIERS (generic):\n"
   "  [c] - do not warn if the library had to be created\n"
   "  [v] - be verbose about actions taken\n"
@@ -101,7 +100,6 @@
 bool OnlyUpdate = false;         ///< 'u' modifier
 bool Verbose = false;            ///< 'v' modifier
 bool ReallyVerbose = false;      ///< 'V' modifier
-bool Compression = false;        ///< 'z' modifier
 
 // Relative Positional Argument (for insert/move). This variable holds
 // the name of the archive member to which the 'a', 'b' or 'i' modifier
@@ -208,7 +206,6 @@
     case 'u': OnlyUpdate = true; break;
     case 'v': Verbose = true; break;
     case 'V': Verbose = ReallyVerbose = true; break;
-    case 'z': Compression = true; break;
     case 'a':
       getRelPos();
       AddAfter = true;
@@ -260,8 +257,6 @@
     throw "The 'f' modifier is only applicable to the 'q' and 'r' operations";
   if (OnlyUpdate && Operation != ReplaceOrInsert)
     throw "The 'u' modifier is only applicable to the 'r' operation";
-  if (Compression && Operation!=ReplaceOrInsert && Operation!=Extract)
-    throw "The 'z' modifier is only applicable to the 'r' and 'x' operations";
   if (Count > 1 && Members.size() > 1)
     throw "Only one member name may be specified with the 'N' modifier";
 
@@ -413,8 +408,6 @@
         // Zrw-r--r--  500/ 500    525 Nov  8 17:42 2004 Makefile
         if (I->isBitcode())
           outs() << "b";
-        else if (I->isCompressed())
-          outs() << "Z";
         else
           outs() << " ";
         unsigned mode = I->getMode();
@@ -437,7 +430,7 @@
 }
 
 // doExtract - Implement the 'x' operation. This function extracts files back to
-// the file system, making sure to uncompress any that were compressed
+// the file system.
 bool
 doExtract(std::string* ErrMsg) {
   if (buildPaths(false, ErrMsg))
@@ -503,7 +496,7 @@
   }
 
   // We're done editting, reconstruct the archive.
-  if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg))
+  if (TheArchive->writeToDisk(SymTable,TruncateNames,ErrMsg))
     return true;
   if (ReallyVerbose)
     printSymbolTable();
@@ -558,7 +551,7 @@
   }
 
   // We're done editting, reconstruct the archive.
-  if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg))
+  if (TheArchive->writeToDisk(SymTable,TruncateNames,ErrMsg))
     return true;
   if (ReallyVerbose)
     printSymbolTable();
@@ -583,7 +576,7 @@
   }
 
   // We're done editting, reconstruct the archive.
-  if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg))
+  if (TheArchive->writeToDisk(SymTable,TruncateNames,ErrMsg))
     return true;
   if (ReallyVerbose)
     printSymbolTable();
@@ -681,7 +674,7 @@
   }
 
   // We're done editting, reconstruct the archive.
-  if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg))
+  if (TheArchive->writeToDisk(SymTable,TruncateNames,ErrMsg))
     return true;
   if (ReallyVerbose)
     printSymbolTable();

Modified: llvm/trunk/tools/llvm-ranlib/llvm-ranlib.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ranlib/llvm-ranlib.cpp?rev=161651&r1=161650&r2=161651&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ranlib/llvm-ranlib.cpp (original)
+++ llvm/trunk/tools/llvm-ranlib/llvm-ranlib.cpp Thu Aug  9 20:57:52 2012
@@ -81,7 +81,7 @@
     if (!TheArchive)
       throw err_msg;
 
-    if (TheArchive->writeToDisk(true, false, false, &err_msg ))
+    if (TheArchive->writeToDisk(true, false, &err_msg ))
       throw err_msg;
 
     if (Verbose)





More information about the llvm-commits mailing list