From 249403f5fa04be3a88a54d6ea1e444ce1c77c44d Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sat, 11 Sep 2004 04:22:14 +0000 Subject: [PATCH] Make the dependent libraries list use a SetVector instead of a regular vector so that duplicate libraries never occur within a module. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16280 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Module.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/llvm/Module.h b/include/llvm/Module.h index 5d527b13be2..b864cce38d7 100644 --- a/include/llvm/Module.h +++ b/include/llvm/Module.h @@ -21,6 +21,7 @@ #include "llvm/Function.h" #include "llvm/GlobalVariable.h" +#include "llvm/ADT/SetVector.h" namespace llvm { @@ -47,7 +48,7 @@ class Module { public: typedef iplist GlobalListType; typedef iplist FunctionListType; - typedef std::vector LibraryListType; + typedef SetVector LibraryListType; // Global Variable iterators... typedef GlobalListType::iterator giterator; @@ -238,10 +239,10 @@ public: 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); } + inline void addLibrary(const std::string& Lib){ LibraryList.insert(Lib); } /// @brief Remove a library from the list of dependent libraries - inline void removeLibrary(const std::string& Lib); + inline void removeLibrary(const std::string& Lib) { LibraryList.remove(Lib); } /// @brief Get all the libraries inline const LibraryListType& getLibraries() const { return LibraryList; }