diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-11-16 06:46:55 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-11-16 06:46:55 +0000 |
commit | 60f1758f7cb66dc76064aec375875a4378a4d7f8 (patch) | |
tree | 3ded6df77540439174768a336c88d4291c163ad0 /include/llvm/Bytecode/Archive.h | |
parent | 242e525edcb965d54c73d016ccdaa4baaa9f083c (diff) |
Per code review:\
* Use STL names for STL operations \
* Do not have Archive doing symbol table printing \
* Avoid compiler warnings about only having private constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17881 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Bytecode/Archive.h')
-rw-r--r-- | include/llvm/Bytecode/Archive.h | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/include/llvm/Bytecode/Archive.h b/include/llvm/Bytecode/Archive.h index 623ffab609..67615b3bef 100644 --- a/include/llvm/Bytecode/Archive.h +++ b/include/llvm/Bytecode/Archive.h @@ -243,7 +243,7 @@ class Archive { typedef std::map<std::string,unsigned> SymTabType; /// @} - /// @name ilist interface methods + /// @name ilist accessor methods /// @{ public: inline iterator begin() { return members.begin(); } @@ -264,6 +264,23 @@ class Archive { inline ArchiveMember& back() { return members.back(); } /// @} + /// @name ilist mutator methods + /// @{ + public: + /// This method splices a \p src member from an archive (possibly \p this), + /// to a position just before the member given by \p dest in \p this. When + /// the archive is written, \p src will be written in its new location. + /// @brief Move a member to a new location + inline void splice(iterator dest, Archive& arch, iterator src) + { return members.splice(dest,arch.members,src); } + + /// This method erases a \p target member from the archive. When the + /// archive is written, it will no longer contain \p target. The associated + /// ArchiveMember is deleted. + /// @brief Erase a member. + inline iterator erase(iterator target) { return members.erase(target); } + + /// @} /// @name Constructors /// @{ public: @@ -405,8 +422,7 @@ class Archive { void writeToDisk( bool CreateSymbolTable=false, ///< Create Symbol table bool TruncateNames=false, ///< Truncate the filename to 15 chars - bool Compress=false, ///< Compress files - bool PrintSymTab=false ///< Dump symtab to std::out if created + bool Compress=false ///< Compress files ); /// This method adds a new file to the archive. The \p filename is examined @@ -418,22 +434,10 @@ class Archive { /// @brief Add a file to the archive. void addFileBefore(const sys::Path& filename, iterator where); - /// This method moves a \p target member to a new location in the archive, - /// just before the member given by \p iterator. When the archive is - /// written, \p target will be written in its new location. - /// @brief Move a member to a new location - void moveMemberBefore(iterator target, iterator where); - - /// This method removes a \p target member from the archive. When the - /// archive is written, it will no longer contain \p target. The associated - /// ArchiveMember is deleted. - /// @brief Remove a member. - void remove(iterator target); - /// @} /// @name Implementation /// @{ - private: + protected: /// @brief Construct an Archive for \p filename and optionally map it /// into memory. Archive(const sys::Path& filename, bool map = false ); @@ -454,7 +458,7 @@ class Archive { void loadSymbolTable(); /// @brief Write the symbol table to an ofstream. - void writeSymbolTable(std::ofstream& ARFile,bool PrintSymTab); + void writeSymbolTable(std::ofstream& ARFile); /// @brief Write one ArchiveMember to an ofstream. void writeMember(const ArchiveMember& member, std::ofstream& ARFile, @@ -474,7 +478,7 @@ class Archive { /// @} /// @name Data /// @{ - private: + protected: sys::Path archPath; ///< Path to the archive file we read/write MembersList members; ///< The ilist of ArchiveMember sys::MappedFile* mapfile; ///< Raw Archive contents mapped into memory @@ -484,6 +488,7 @@ class Archive { unsigned symTabSize; ///< Size in bytes of symbol table unsigned firstFileOffset; ///< Offset to first normal file. ModuleMap modules; ///< The modules loaded via symbol lookup. + ArchiveMember* foreignST; ///< This holds the foreign symbol table. /// @} /// @name Hidden |