[llvm-commits] CVS: llvm/include/llvm/Bytecode/Archive.h
Reid Spencer
reid at x10sys.com
Mon Nov 15 22:47:06 PST 2004
Changes in directory llvm/include/llvm/Bytecode:
Archive.h updated: 1.5 -> 1.6
---
Log message:
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.
---
Diffs of the changes: (+23 -18)
Index: llvm/include/llvm/Bytecode/Archive.h
diff -u llvm/include/llvm/Bytecode/Archive.h:1.5 llvm/include/llvm/Bytecode/Archive.h:1.6
--- llvm/include/llvm/Bytecode/Archive.h:1.5 Sun Nov 14 15:47:41 2004
+++ llvm/include/llvm/Bytecode/Archive.h Tue Nov 16 00:46:55 2004
@@ -243,7 +243,7 @@
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 @@
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 @@
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 @@
/// @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 @@
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 @@
/// @}
/// @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 @@
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
More information about the llvm-commits
mailing list