For PR1163:
authorReid Spencer <rspencer@reidspencer.com>
Sun, 4 Feb 2007 00:40:42 +0000 (00:40 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 4 Feb 2007 00:40:42 +0000 (00:40 +0000)
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

include/llvm/Module.h
lib/Transforms/Instrumentation/RSProfiling.h
lib/Transforms/Scalar/InstructionCombining.cpp
lib/Transforms/Scalar/PredicateSimplifier.cpp
lib/Transforms/Utils/LowerInvoke.cpp
lib/VMCore/Module.cpp

index f5cb9f6a136ecf8c88cea7af5557a1917e09d654..7470debcda488c4133335cdc6d929d806ed92164 100644 (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; }
 
index e07db00452394aafb9e374267ad5671ed943d989..747773a87c5476cf418232864ad6839a93717026 100644 (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
index 49a17750478f2bc841522e359945d1714bda8f1a..fe9a003f2fe5314c76cb00863de9c2201a586bc4 100644 (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;
 
index aecd6957bd597f00ecd83f55a79a248b9a791187..a11d5bdfcdff9f3cb4610f3cb967e7daef2f37da 100644 (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"
index a027743bda715bdce5b981d954f613b0c883feeb..62eec75160a38ac2c5dfb586cbf41a7e446685a9 100644 (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");
index d8c7356757eec6680ad0e00d87628744f3edbc47..efa6e6c7c090ba2cb5f9793beee354a8afb7bfff 100644 (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;
+    }
+}
+