aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/AbstractTypeUser.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-03 18:46:24 +0000
committerChris Lattner <sabre@nondot.org>2003-10-03 18:46:24 +0000
commit7685ac8d35a0c74f6d341f9589fdaedcd1564310 (patch)
treeb31bf215cde3f8cd28024c18692f3c26ca58a73c /include/llvm/AbstractTypeUser.h
parent4797826e17d77e2f2aec2695ec3618ca237c463b (diff)
downloadexternal_llvm-7685ac8d35a0c74f6d341f9589fdaedcd1564310.zip
external_llvm-7685ac8d35a0c74f6d341f9589fdaedcd1564310.tar.gz
external_llvm-7685ac8d35a0c74f6d341f9589fdaedcd1564310.tar.bz2
This checkin basically amounts to a complete rewrite of the type-resolution
machinery. This dramatically simplifies how things works, removes irritating little corner cases, and overall improves speed and reliability. Highlights of this change are: 1. The exponential algorithm built into the code is now gone. For example the time to disassemble one bytecode file from the mesa benchmark went from taking 12.5s to taking 0.16s. 2. The linker bugs should be dramatically reduced. The one remaining bug has to do with constant handling, which I actually introduced in "union-find" checkins. 3. The code is much easier to follow, as a result of fewer special cases. It's probably also smaller. yaay. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/AbstractTypeUser.h')
-rw-r--r--include/llvm/AbstractTypeUser.h28
1 files changed, 12 insertions, 16 deletions
diff --git a/include/llvm/AbstractTypeUser.h b/include/llvm/AbstractTypeUser.h
index b9e5f1c..e409678 100644
--- a/include/llvm/AbstractTypeUser.h
+++ b/include/llvm/AbstractTypeUser.h
@@ -38,24 +38,20 @@ protected:
virtual ~AbstractTypeUser() {} // Derive from me
public:
- // refineAbstractType - The callback method invoked when an abstract type
- // has been found to be more concrete. A class must override this method to
- // update its internal state to reference NewType instead of OldType. Soon
- // after this method is invoked, OldType shall be deleted, so referencing it
- // is quite unwise.
- //
- // Another case that is important to consider is when a type is refined, but
- // stays in the same place in memory. In this case OldTy will equal NewTy.
- // This callback just notifies ATU's that the underlying structure of the type
- // has changed... but any previously used properties are still valid.
- //
- // Note that it is possible to refine a type with parameters OldTy==NewTy, and
- // OldTy is no longer abstract. In this case, abstract type users should
- // release their hold on a type, because it went from being abstract to
- // concrete.
- //
+ /// refineAbstractType - The callback method invoked when an abstract type is
+ /// resolved to another type. An object must override this method to update
+ /// its internal state to reference NewType instead of OldType.
+ ///
virtual void refineAbstractType(const DerivedType *OldTy,
const Type *NewTy) = 0;
+
+ /// The other case which AbstractTypeUsers must be aware of is when a type
+ /// makes the transition from being abstract (where it has clients on it's
+ /// AbstractTypeUsers list) to concrete (where it does not). This method
+ /// notifies ATU's when this occurs for a type.
+ ///
+ virtual void typeBecameConcrete(const DerivedType *AbsTy) = 0;
+
// for debugging...
virtual void dump() const = 0;
};