summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-09-11 04:22:14 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-09-11 04:22:14 +0000
commita529d4eaa73ec1f27c65be74b8e37e7ca56afa25 (patch)
treeb9b9f7d1bd1fd2b8c20d35e42b822c10acc9c86b /llvm
parent886fc070d539e68cefa403c8c483a9262ddb1fd5 (diff)
downloadbcm5719-llvm-a529d4eaa73ec1f27c65be74b8e37e7ca56afa25.tar.gz
bcm5719-llvm-a529d4eaa73ec1f27c65be74b8e37e7ca56afa25.zip
Make the dependent libraries list use a SetVector instead of a regular
vector so that duplicate libraries never occur within a module. llvm-svn: 16280
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Module.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/include/llvm/Module.h b/llvm/include/llvm/Module.h
index 5d527b13be2..b864cce38d7 100644
--- a/llvm/include/llvm/Module.h
+++ b/llvm/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<GlobalVariable> GlobalListType;
typedef iplist<Function> FunctionListType;
- typedef std::vector<std::string> LibraryListType;
+ typedef SetVector<std::string> 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; }
OpenPOWER on IntegriCloud