[llvm-commits] [llvm] r54785 - /llvm/trunk/lib/VMCore/LeakDetector.cpp

Owen Anderson resistor at mac.com
Thu Aug 14 13:40:13 PDT 2008


Author: resistor
Date: Thu Aug 14 15:40:10 2008
New Revision: 54785

URL: http://llvm.org/viewvc/llvm-project?rev=54785&view=rev
Log:
Have LeakDetector use a SmallPtrSet instead of an std::set.

Modified:
    llvm/trunk/lib/VMCore/LeakDetector.cpp

Modified: llvm/trunk/lib/VMCore/LeakDetector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LeakDetector.cpp?rev=54785&r1=54784&r2=54785&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/LeakDetector.cpp (original)
+++ llvm/trunk/lib/VMCore/LeakDetector.cpp Thu Aug 14 15:40:10 2008
@@ -12,10 +12,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Support/LeakDetector.h"
+#include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/Streams.h"
 #include "llvm/Value.h"
-#include <set>
 using namespace llvm;
 
 namespace {
@@ -60,7 +60,7 @@
 
       if (!Ts.empty()) {
         cerr << "Leaked " << Name << " objects found: " << Message << ":\n";
-        for (typename std::set<const T*>::iterator I = Ts.begin(),
+        for (typename SmallPtrSet<const T*, 8>::iterator I = Ts.begin(),
                E = Ts.end(); I != E; ++I) {
           cerr << "\t";
           PrinterTrait<T>::print(*I);
@@ -74,7 +74,7 @@
     }
 
   private:
-    std::set<const T*> Ts;
+    SmallPtrSet<const T*, 8> Ts;
     const T* Cache;
     const char* const Name;
   };





More information about the llvm-commits mailing list