aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/DerivedTypes.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-02 19:44:23 +0000
committerChris Lattner <sabre@nondot.org>2003-10-02 19:44:23 +0000
commit0dde36c4c70e2c16be7802e978fb7dd34a7125cb (patch)
treeca4ef9d76010ba44f93e0fe0971cb39c1e8ecbc8 /include/llvm/DerivedTypes.h
parentdf0c1a2189c6a1864eca3aaa8031c5c91259e20a (diff)
downloadexternal_llvm-0dde36c4c70e2c16be7802e978fb7dd34a7125cb.zip
external_llvm-0dde36c4c70e2c16be7802e978fb7dd34a7125cb.tar.gz
external_llvm-0dde36c4c70e2c16be7802e978fb7dd34a7125cb.tar.bz2
There is no reason for Value to be an AbstractTypeUser. This just makes things
significantly more complete. Instead, just make DerivedType's AbstractTypeUser's, and make Value contain a PATypeHolder. This will also be more efficient in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8827 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/DerivedTypes.h')
-rw-r--r--include/llvm/DerivedTypes.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h
index f65a2ce..73587b4 100644
--- a/include/llvm/DerivedTypes.h
+++ b/include/llvm/DerivedTypes.h
@@ -19,7 +19,7 @@ class ArrayValType;
class StructValType;
class PointerValType;
-class DerivedType : public Type {
+class DerivedType : public Type, public AbstractTypeUser {
char isRefining; // Used for recursive types
// AbstractTypeUsers - Implement a list of the users that need to be notified
@@ -80,6 +80,8 @@ public:
refineAbstractTypeToInternal(NewType, true);
}
+ void dump() const { Value::dump(); }
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const DerivedType *T) { return true; }
static inline bool classof(const Type *T) {
@@ -149,7 +151,6 @@ public:
const std::vector<const Type*> &Params,
bool isVarArg);
-
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const FunctionType *T) { return true; }
static inline bool classof(const Type *T) {
@@ -410,6 +411,16 @@ public:
return new OpaqueType(); // All opaque types are distinct
}
+ // refineAbstractType - Called when a contained type is found to be more
+ // concrete - this could potentially change us from an abstract type to a
+ // concrete type.
+ //
+ virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) {
+ // This class never uses other types!
+ abort();
+ }
+
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const OpaqueType *T) { return true; }
static inline bool classof(const Type *T) {