[llvm-commits] [llvm] r81716 - /llvm/trunk/lib/VMCore/Verifier.cpp

Chris Lattner clattner at apple.com
Sun Sep 13 15:49:49 PDT 2009


On Sep 13, 2009, at 2:07 PM, Nick Lewycky wrote:

> Author: nicholas
> Date: Sun Sep 13 16:07:59 2009
> New Revision: 81716
>
> URL: http://llvm.org/viewvc/llvm-project?rev=81716&view=rev
> Log:
> 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.

Thanks Nicholas,

However, instead of making the Verifier itself an AbstractTypeUser,  
please make a new class that contains the set and is an  
AbstractTypeUser.  The Verifier can then have that object through  
containment.

-Chris

>
> Modified:
>    llvm/trunk/lib/VMCore/Verifier.cpp
>
> Modified: llvm/trunk/lib/VMCore/Verifier.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=81716&r1=81715&r2=81716&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/VMCore/Verifier.cpp (original)
> +++ llvm/trunk/lib/VMCore/Verifier.cpp Sun Sep 13 16:07:59 2009
> @@ -107,7 +107,8 @@
> 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 @@
>     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 @@
>       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
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list