From 641588bb3e7d77a88624d5df10709a07745f1238 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sun, 25 Jul 2004 21:28:19 +0000 Subject: [PATCH] Reduce the footprint of the dependent library interface Document the dependent library interface Constify the std::string& parameters in the dep lib interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15215 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Module.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/include/llvm/Module.h b/include/llvm/Module.h index ab1c0dd7aa1..e2aa33c5626 100644 --- a/include/llvm/Module.h +++ b/include/llvm/Module.h @@ -62,8 +62,7 @@ public: typedef std::reverse_iterator const_reverse_iterator; // Library list iterators - typedef LibraryListType::iterator literator; - typedef LibraryListType::const_iterator const_literator; + typedef LibraryListType::const_iterator lib_iterator; enum Endianness { AnyEndianness, LittleEndian, BigEndian }; enum PointerSize { AnyPointerSize, Pointer32, Pointer64 }; @@ -93,7 +92,7 @@ public: const std::string& getModuleIdentifier() const { return ModuleID; } const std::string& getTargetTriple() const { return TargetTriple; } - void setTargetTriple(std::string& T) { TargetTriple = T; } + void setTargetTriple(const std::string& T) { TargetTriple = T; } /// Target endian information... Endianness getEndianness() const { return Endian; } @@ -226,21 +225,23 @@ public: inline const Function &back() const { return FunctionList.back(); } inline Function &back() { return FunctionList.back(); } - // LibraryList interface - inline literator lbegin() { return LibraryList.begin(); } - inline const_literator lbegin() const { return LibraryList.begin(); } - inline literator lend () { return LibraryList.end(); } - inline const_literator lend () const { return LibraryList.end(); } + //===--------------------------------------------------------------------===// + // List of dependent library access functionsns - inline unsigned lsize() const { return LibraryList.size(); } - inline bool lempty() const { return LibraryList.empty(); } - inline const std::string& lfront() const { return LibraryList.front(); } - inline std::string& lfront() { return LibraryList.front(); } - inline const std::string& lback() const { return LibraryList.back(); } - inline std::string& lback() { return LibraryList.back(); } + /// @brief Get a constant iterator to beginning of dependent library list. + inline lib_iterator lib_begin() const { return LibraryList.begin(); } - inline void linsert(std::string& Lib){ LibraryList.push_back(Lib); } - inline void lremove(std::string& Lib); + /// @brief Get a constant iterator to end of dependent library list. + inline lib_iterator lib_end() const { return LibraryList.end(); } + + /// @brief Returns the number of items in the list of libraries. + inline unsigned lib_size() const { return LibraryList.size(); } + + /// @brief Add a library to the list of dependent libraries + inline void addLibrary(const std::string& Lib){ LibraryList.push_back(Lib); } + + /// @brief Remove a library from the list of dependent libraries + inline void removeLibrary(const std::string& Lib); void print(std::ostream &OS) const { print(OS, 0); } void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;