For PR1163:

Make the Module's dependent library use a std::vector instead of SetVector
adjust #includes in .cpp files because SetVector.h is no longer included.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33855 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2007-02-04 00:40:42 +00:00
parent 5fcaf3ed14
commit 6734b57d1b
6 changed files with 24 additions and 5 deletions

View File

@ -16,7 +16,6 @@
#include "llvm/Function.h"
#include "llvm/GlobalVariable.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Support/DataTypes.h"
namespace llvm {
@ -63,7 +62,7 @@ public:
typedef iplist<Function> FunctionListType;
/// The type for the list of dependent libraries.
typedef SetVector<std::string> LibraryListType;
typedef std::vector<std::string> LibraryListType;
/// The Global Variable iterator.
typedef GlobalListType::iterator global_iterator;
@ -290,9 +289,9 @@ public:
/// @brief Returns the number of items in the list of libraries.
inline size_t lib_size() const { return LibraryList.size(); }
/// @brief Add a library to the list of dependent libraries
inline void addLibrary(const std::string& Lib){ LibraryList.insert(Lib); }
void addLibrary(const std::string& Lib);
/// @brief Remove a library from the list of dependent libraries
inline void removeLibrary(const std::string& Lib) { LibraryList.remove(Lib); }
void removeLibrary(const std::string& Lib);
/// @brief Get all the libraries
inline const LibraryListType& getLibraries() const { return LibraryList; }

View File

@ -11,6 +11,7 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/RSProfiling.h"
#include <set>
namespace llvm {
/// RSProfilers_std - a simple support class for profilers that handles most

View File

@ -54,6 +54,7 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
#include <algorithm>
#include <set>
using namespace llvm;
using namespace llvm::PatternMatch;

View File

@ -76,7 +76,7 @@
#include "llvm/Pass.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Analysis/Dominators.h"

View File

@ -48,6 +48,7 @@
#include "llvm/Support/Compiler.h"
#include "llvm/Target/TargetLowering.h"
#include <csetjmp>
#include <set>
using namespace llvm;
STATISTIC(NumInvokes, "Number of invokes replaced");

View File

@ -360,3 +360,20 @@ void Module::dropAllReferences() {
I->dropAllReferences();
}
void Module::addLibrary(const std::string& Lib) {
for (Module::lib_iterator I = lib_begin(), E = lib_end(); I != E; ++I)
if (*I == Lib)
return;
LibraryList.push_back(Lib);
}
void Module::removeLibrary(const std::string& Lib) {
LibraryListType::iterator I = LibraryList.begin();
LibraryListType::iterator E = LibraryList.end();
for (;I != E; ++I)
if (*I == Lib) {
LibraryList.erase(I);
return;
}
}