mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
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
This commit is contained in:
parent
a166926577
commit
9531457813
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
|
#include "llvm/ADT/SetVector.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
@ -47,7 +48,7 @@ class Module {
|
|||||||
public:
|
public:
|
||||||
typedef iplist<GlobalVariable> GlobalListType;
|
typedef iplist<GlobalVariable> GlobalListType;
|
||||||
typedef iplist<Function> FunctionListType;
|
typedef iplist<Function> FunctionListType;
|
||||||
typedef std::vector<std::string> LibraryListType;
|
typedef SetVector<std::string> LibraryListType;
|
||||||
|
|
||||||
// Global Variable iterators...
|
// Global Variable iterators...
|
||||||
typedef GlobalListType::iterator giterator;
|
typedef GlobalListType::iterator giterator;
|
||||||
@ -238,10 +239,10 @@ public:
|
|||||||
inline unsigned lib_size() const { return LibraryList.size(); }
|
inline unsigned lib_size() const { return LibraryList.size(); }
|
||||||
|
|
||||||
/// @brief Add a library to the list of dependent libraries
|
/// @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
|
/// @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
|
/// @brief Get all the libraries
|
||||||
inline const LibraryListType& getLibraries() const { return LibraryList; }
|
inline const LibraryListType& getLibraries() const { return LibraryList; }
|
||||||
|
Loading…
Reference in New Issue
Block a user