Fix a typo 'iff' => 'if'
[oota-llvm.git] / include / llvm / Bitcode / Archive.h
index c3c07d8588a36f6f711fb238d0bf4f8cafb3322f..892bfe83142c1ac8db026142137c84f5b839a53d 100644 (file)
@@ -25,7 +25,6 @@
 
 namespace llvm {
   class MemoryBuffer;
-  class raw_ostream;
 
 // Forward declare classes
 class Module;              // From VMCore
@@ -48,14 +47,13 @@ class ArchiveMember : public ilist_node<ArchiveMember> {
     /// 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
     };
 
   /// @}
@@ -110,32 +108,27 @@ class ArchiveMember : public ilist_node<ArchiveMember> {
     /// @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
+    /// @returns true if 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; }
 
-    /// @returns true iff the member is a BSD4.4 (non-LLVM) symbol table
+    /// @returns true if the member is a BSD4.4 (non-LLVM) symbol table
     /// @brief Determine if this member is a BSD4.4 symbol table.
     bool isBSD4SymbolTable() const { return flags&BSD4SymbolTableFlag; }
 
-    /// @returns true iff the archive member is the LLVM symbol table
+    /// @returns true if the archive member is the LLVM symbol table
     /// @brief Determine if this member is the LLVM symbol table.
     bool isLLVMSymbolTable() const { return flags&LLVMSymbolTableFlag; }
 
-    /// @returns true iff the archive member is the ar(1) string table
+    /// @returns true if the archive member is the ar(1) string table
     /// @brief Determine if this member is the ar(1) string table.
     bool isStringTable() const { return flags&StringTableFlag; }
 
-    /// @returns true iff the archive member is a bitcode file.
+    /// @returns true if the archive member is a bitcode file.
     /// @brief Determine if this member is a bitcode file.
     bool isBitcode() const { return flags&BitcodeFlag; }
 
-    /// @returns true iff the file name contains a path (directory) component.
+    /// @returns true if the file name contains a path (directory) component.
     /// @brief Determine if the member has a path
     bool hasPath() const { return flags&HasPathFlag; }
 
@@ -144,7 +137,7 @@ class ArchiveMember : public ilist_node<ArchiveMember> {
     /// separator character (/). To avoid this, a "long format" member name is
     /// allowed that doesn't have this restriction. This method determines if
     /// that "long format" is used for this member.
-    /// @returns true iff the file name uses the long form
+    /// @returns true if the file name uses the long form
     /// @brief Determine if the member has a long file name
     bool hasLongFilename() const { return flags&HasLongFilenameFlag; }
 
@@ -395,7 +388,7 @@ class Archive {
     /// @brief Look up multiple symbols in the archive.
     bool findModulesDefiningSymbols(
       std::set<std::string>& symbols,     ///< Symbols to be sought
-      std::set<Module*>& modules,         ///< The modules matching \p symbols
+      SmallVectorImpl<Module*>& modules,  ///< The modules matching \p symbols
       std::string* ErrMessage             ///< Error msg storage, if non-zero
     );
 
@@ -422,13 +415,12 @@ class Archive {
     /// name will be truncated at 15 characters. If \p Compress is specified,
     /// all archive members will be compressed before being written. If
     /// \p PrintSymTab is true, the symbol table will be printed to std::cout.
-    /// @returns true if an error occurred, \p error set to error message
-    /// @returns false if the writing succeeded.
+    /// @returns true if an error occurred, \p error set to error message;
+    /// returns false if the writing succeeded.
     /// @brief Write (possibly modified) archive contents to disk
     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
     );
 
@@ -436,7 +428,7 @@ class Archive {
     /// to determine just enough information to create an ArchiveMember object
     /// which is then inserted into the Archive object's ilist at the location
     /// given by \p where.
-    /// @returns true if an error occured, false otherwise
+    /// @returns true if an error occurred, false otherwise
     /// @brief Add a file to the archive.
     bool addFileBefore(
       const sys::Path& filename, ///< The file to be added
@@ -483,19 +475,18 @@ class Archive {
     bool loadSymbolTable(std::string* ErrMessage);
 
     /// @brief Write the symbol table to an ofstream.
-    void writeSymbolTable(raw_ostream& ARFile);
+    void writeSymbolTable(std::ofstream& ARFile);
 
     /// Writes one ArchiveMember to an ofstream. If an error occurs, returns
     /// false, otherwise true. If an error occurs and error is non-null then
     /// it will be set to an error message.
-    /// @returns false Writing member succeeded
-    /// @returns true Writing member failed, \p error set to error message
+    /// @returns false if writing member succeeded,
+    /// returns true if writing member failed, \p error set to error message.
     bool writeMember(
       const ArchiveMember& member, ///< The member to be written
-      raw_ostream& ARFile,       ///< The file to write member onto
+      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
     );
 
@@ -536,9 +527,9 @@ class Archive {
   /// @name Hidden
   /// @{
   private:
-    Archive();                          ///< Do not implement
-    Archive(const Archive&);            ///< Do not implement
-    Archive& operator=(const Archive&); ///< Do not implement
+    Archive() LLVM_DELETED_FUNCTION;
+    Archive(const Archive&) LLVM_DELETED_FUNCTION;
+    Archive& operator=(const Archive&) LLVM_DELETED_FUNCTION;
   /// @}
 };