X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FLeaksContext.h;h=b9e59d46b7ad62791449180931fd20aacf30017c;hb=b6777eae58392cb5e19282622996e81c72b72a3e;hp=bd10a479ae2a0804c0d3c049eaa6f241474adbed;hpb=c4775e4b973aaf6695dc00a3403b8b64f5257568;p=oota-llvm.git diff --git a/lib/VMCore/LeaksContext.h b/lib/VMCore/LeaksContext.h index bd10a479ae2..b9e59d46b7a 100644 --- a/lib/VMCore/LeaksContext.h +++ b/lib/VMCore/LeaksContext.h @@ -14,7 +14,8 @@ #include "llvm/Value.h" #include "llvm/ADT/SmallPtrSet.h" -using namespace llvm; + +namespace llvm { template struct PrinterTrait { @@ -46,8 +47,9 @@ struct LeakDetectorImpl { // immediately, it is added to the CachedValue Value. If it is // immediately removed, no set search need be performed. void addGarbage(const T* o) { + assert(Ts.count(o) == 0 && "Object already in set!"); if (Cache) { - assert(Ts.count(Cache) == 0 && "Object already in set!"); + assert(Cache != o && "Object already in set!"); Ts.insert(Cache); } Cache = o; @@ -86,3 +88,5 @@ private: const T* Cache; const char* Name; }; + +}