diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-09-13 21:07:59 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-09-13 21:07:59 +0000 |
commit | 6735b1c5c458a388be3a9c6e7f13f4fb63c14a5d (patch) | |
tree | bfde4755f4676f4f2e865120f956e59b33c1d63a /lib | |
parent | 762ccea600158bb317dcccdff3303e942426cb71 (diff) | |
download | llvm-6735b1c5c458a388be3a9c6e7f13f4fb63c14a5d.tar.gz llvm-6735b1c5c458a388be3a9c6e7f13f4fb63c14a5d.tar.bz2 llvm-6735b1c5c458a388be3a9c6e7f13f4fb63c14a5d.tar.xz |
Storing a set of PATypeHolders is a bad idea because their sort order will
change as types are refined. Remove abstract types from CheckedTypes when they
we're informed that they have been refined. The only way types get refined in
the verifier is when later function passes start optimizing. Fixes PR4970.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index d31e6cb512..6b70008aba 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -107,7 +107,8 @@ PreVer("preverify", "Preliminary module verification"); static const PassInfo *const PreVerifyID = &PreVer; namespace { - struct Verifier : public FunctionPass, public InstVisitor<Verifier> { + struct Verifier : public FunctionPass, public InstVisitor<Verifier>, + public AbstractTypeUser { static char ID; // Pass ID, replacement for typeid bool Broken; // Is this module found to be broken? bool RealPass; // Are we not being run by a PassManager? @@ -126,7 +127,7 @@ namespace { SmallPtrSet<Instruction*, 16> InstsInThisBlock; /// CheckedTypes - keep track of the types that have been checked already. - SmallSet<PATypeHolder, 16> CheckedTypes; + SmallSet<const Type *, 16> CheckedTypes; Verifier() : FunctionPass(&ID), @@ -336,6 +337,13 @@ namespace { WriteType(T3); Broken = true; } + + // Abstract type user interface. + void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { + CheckedTypes.erase(OldTy); + } + void typeBecameConcrete(const DerivedType *AbsTy) {} + void dump() const {} }; } // End anonymous namespace |