summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-02 19:08:18 +0000
committerChris Lattner <sabre@nondot.org>2003-10-02 19:08:18 +0000
commitdf0c1a2189c6a1864eca3aaa8031c5c91259e20a (patch)
tree9da7ddd199a48035cb3a532f4b8885f5fac7797f /include
parentce2141f3de61a32169db87c398ff70dbccde9091 (diff)
downloadllvm-df0c1a2189c6a1864eca3aaa8031c5c91259e20a.tar.gz
llvm-df0c1a2189c6a1864eca3aaa8031c5c91259e20a.tar.bz2
llvm-df0c1a2189c6a1864eca3aaa8031c5c91259e20a.tar.xz
There is no reason for the PATypeHolder class to derive from the
PATypeHandle class git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/AbstractTypeUser.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/include/llvm/AbstractTypeUser.h b/include/llvm/AbstractTypeUser.h
index aa42683391..64fcd33a78 100644
--- a/include/llvm/AbstractTypeUser.h
+++ b/include/llvm/AbstractTypeUser.h
@@ -127,10 +127,17 @@ 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.
//
-struct PATypeHolder : public AbstractTypeUser, public PATypeHandle {
- inline PATypeHolder(const Type *ty) : PATypeHandle(ty, this) {}
- inline PATypeHolder(const PATypeHolder &T)
- : AbstractTypeUser(T), PATypeHandle(T, this) {}
+class PATypeHolder : public AbstractTypeUser {
+ PATypeHandle Handle;
+public:
+ PATypeHolder(const Type *ty) : Handle(ty, this) {}
+ PATypeHolder(const PATypeHolder &T) : AbstractTypeUser(), Handle(T, this) {}
+
+ operator const Type *() const { return Handle; }
+ const Type *get() const { return Handle; }
+
+ // operator-> - Allow user to dereference handle naturally...
+ inline const Type *operator->() const { return Handle; }
// refineAbstractType - All we do is update our PATypeHandle member to point
// to the new type.
@@ -140,23 +147,23 @@ struct PATypeHolder : public AbstractTypeUser, public PATypeHandle {
// Check to see if the type just became concrete. If so, we have to
// removeUser to get off its AbstractTypeUser list
- removeUserFromConcrete();
+ Handle.removeUserFromConcrete();
if ((const Type*)OldTy != NewTy)
- PATypeHandle::operator=(NewTy);
+ Handle.operator=(NewTy);
}
// operator= - Allow assignment to handle
- inline const Type *operator=(const Type *ty) {
- return PATypeHandle::operator=(ty);
+ const Type *operator=(const Type *ty) {
+ return Handle = ty;
}
// operator= - Allow assignment to handle
- inline const Type *operator=(const PATypeHandle &T) {
- return PATypeHandle::operator=(T);
+ const Type *operator=(const PATypeHandle &T) {
+ return Handle = T;
}
- inline const Type *operator=(const PATypeHolder &H) {
- return PATypeHandle::operator=(H);
+ const Type *operator=(const PATypeHolder &H) {
+ return Handle = H;
}
void dump() const;