From c269bd92325d21011ecc04d062c1044c1f7c1754 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 4 Apr 2002 19:18:00 +0000 Subject: [PATCH] * Add dump() virtual function to AbstractType user to help track down bugs * PATypeHolder is now a nontemplated class, because it was (almost) only ever instantiated with 'Type' as the parameter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2095 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/AbstractTypeUser.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/include/llvm/AbstractTypeUser.h b/include/llvm/AbstractTypeUser.h index 844d465e38f..c995b61cad6 100644 --- a/include/llvm/AbstractTypeUser.h +++ b/include/llvm/AbstractTypeUser.h @@ -47,6 +47,8 @@ public: // virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) = 0; + // for debugging... + virtual void dump() const = 0; }; @@ -119,12 +121,10 @@ public: // as both a handle (as above) and an AbstractTypeUser. It uses the callback to // keep its pointer member updated to the current version of the type. // -template -class PATypeHolder : public AbstractTypeUser, public PATypeHandle { -public: - inline PATypeHolder(const TypeSC *ty) : PATypeHandle(ty, this) {} +struct PATypeHolder : public AbstractTypeUser, public PATypeHandle { + inline PATypeHolder(const Type *ty) : PATypeHandle(ty, this) {} inline PATypeHolder(const PATypeHolder &T) - : AbstractTypeUser(T), PATypeHandle(T, this) {} + : AbstractTypeUser(T), PATypeHandle(T, this) {} // refineAbstractType - All we do is update our PATypeHandle member to point // to the new type. @@ -137,22 +137,23 @@ public: removeUserFromConcrete(); if ((const Type*)OldTy != NewTy) - PATypeHandle::operator=((const TypeSC*)NewTy); + PATypeHandle::operator=(NewTy); } // operator= - Allow assignment to handle - inline const TypeSC *operator=(const TypeSC *ty) { - return PATypeHandle::operator=(ty); + inline const Type *operator=(const Type *ty) { + return PATypeHandle::operator=(ty); } // operator= - Allow assignment to handle - inline const TypeSC *operator=(const PATypeHandle &T) { - return PATypeHandle::operator=(T); + inline const Type *operator=(const PATypeHandle &T) { + return PATypeHandle::operator=(T); } - inline const TypeSC *operator=(const PATypeHolder &H) { - return PATypeHandle::operator=(H); + inline const Type *operator=(const PATypeHolder &H) { + return PATypeHandle::operator=(H); } -}; + void dump() const; +}; #endif -- 2.34.1