X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FAbstractTypeUser.h;h=c1216baabf8fac950ba59fcd29efd55897f0b6aa;hb=a3af370dc12f6d5100da5d614ab0a62da135569a;hp=80656d89b726a20f3d5b954dc50eaa4dd3a35fe1;hpb=793b2e3f6f3975cfa11692af058931b4a0988955;p=oota-llvm.git diff --git a/include/llvm/AbstractTypeUser.h b/include/llvm/AbstractTypeUser.h index 80656d89b72..c1216baabf8 100644 --- a/include/llvm/AbstractTypeUser.h +++ b/include/llvm/AbstractTypeUser.h @@ -137,6 +137,7 @@ public: /// class PATypeHolder { mutable const Type *Ty; + void destroy(); public: PATypeHolder(const Type *ty) : Ty(ty) { addRef(); @@ -145,7 +146,7 @@ public: addRef(); } - ~PATypeHolder() { dropRef(); } + ~PATypeHolder() { if (Ty) dropRef(); } operator Type *() const { return get(); } Type *get() const; @@ -173,6 +174,7 @@ public: private: void addRef(); void dropRef(); + friend class TypeMapBase; }; // simplify_type - Allow clients to treat uses just like values when using