From: Nick Lewycky Date: Sun, 13 Sep 2009 21:07:59 +0000 (+0000) Subject: Storing a set of PATypeHolders is a bad idea because their sort order will X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=6735b1c5c458a388be3a9c6e7f13f4fb63c14a5d;p=oota-llvm.git 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 --- diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index d31e6cb5120..6b70008aba3 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 { + struct Verifier : public FunctionPass, public InstVisitor, + 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 InstsInThisBlock; /// CheckedTypes - keep track of the types that have been checked already. - SmallSet CheckedTypes; + SmallSet 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