X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FIR%2FLeaksContext.h;h=3e485abdfd18056f370b0ba5f825570fb3bf6e74;hb=822199b9e6867c3fe94bffa6ab57be903014f98a;hp=ea0d2752539273efde5f9959b1bae1d191b5269f;hpb=f3a9eb107c079a407962b34ebe5232a41dbf8146;p=oota-llvm.git diff --git a/lib/IR/LeaksContext.h b/lib/IR/LeaksContext.h index ea0d2752539..3e485abdfd1 100644 --- a/lib/IR/LeaksContext.h +++ b/lib/IR/LeaksContext.h @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_IR_LEAKSCONTEXT_H -#define LLVM_IR_LEAKSCONTEXT_H +#ifndef LLVM_LIB_IR_LEAKSCONTEXT_H +#define LLVM_LIB_IR_LEAKSCONTEXT_H #include "llvm/ADT/SmallPtrSet.h" #include "llvm/IR/Value.h" @@ -34,10 +34,10 @@ struct PrinterTrait { template struct LeakDetectorImpl { explicit LeakDetectorImpl(const char* const name = "") : - Cache(0), Name(name) { } + Cache(nullptr), Name(name) { } void clear() { - Cache = 0; + Cache = nullptr; Ts.clear(); } @@ -61,15 +61,15 @@ struct LeakDetectorImpl { void removeGarbage(const T* o) { if (o == Cache) - Cache = 0; // Cache hit + Cache = nullptr; // Cache hit else Ts.erase(o); } bool hasGarbage(const std::string& Message) { - addGarbage(0); // Flush the Cache + addGarbage(nullptr); // Flush the Cache - assert(Cache == 0 && "No value should be cached anymore!"); + assert(!Cache && "No value should be cached anymore!"); if (!Ts.empty()) { errs() << "Leaked " << Name << " objects found: " << Message << ":\n"; @@ -95,4 +95,4 @@ private: } -#endif // LLVM_IR_LEAKSCONTEXT_H +#endif