Esempio n. 1
0
        public static ForwardAnalysisSolver <AState, Type, EdgeData> Make <Local, Parameter, Method, Field, Source, Dest, Context>(
            IDecodeMSIL <APC, Local, Parameter, Method, Field, Type, Source, Dest, Context, EdgeData> decoder,
            IAnalysis <APC, AState, IVisitMSIL <APC, Local, Parameter, Method, Field, Type, Source, Dest, AState, AState>, EdgeData> driver,
            ILPrinter <APC> printer
            )
            where Context : IMethodContext <Field, Method>
        {
            Contract.Requires(decoder != null);
            Contract.Requires(driver != null);

            IVisitMSIL <APC, Local, Parameter, Method, Field, Type, Source, Dest, AState, AState> visitor = driver.Visitor();
            var result = new ForwardAnalysisSolver <AState, Type, EdgeData>(
                decoder.Context.MethodContext.CFG,
                delegate(APC pc, AState state) { return(decoder.ForwardDecode <AState, AState, IVisitMSIL <APC, Local, Parameter, Method, Field, Type, Source, Dest, AState, AState> >(pc, visitor, state)); },
                driver.EdgeConversion,
                driver.Join,
                driver.ImmutableVersion,
                driver.MutableVersion,
                driver.Dump,
                delegate(APC pc, AState state) { return(decoder.IsUnreachable(pc) || driver.IsBottom(pc, state)); },
                delegate(APC pc, AState state) { return(driver.IsTop(pc, state)); },
                printer,
                decoder.Display,
                decoder.EdgeData
                );

            result.CachePolicy = driver.CacheStates(result);
            return(result);
        }
Esempio n. 2
0
 public Transformer <int, Data, Result> CacheForwardDecoder <Data, Result>(IVisitMSIL <int, Local, Parameter, Method, Field, Type, Unit, Unit, Data, Result> visitor)
 {
     return(delegate(int lab, Data data) { return this.ForwardDecode <Data, Result, IVisitMSIL <int, Local, Parameter, Method, Field, Type, Unit, Unit, Data, Result> >(lab, visitor, data); });
 }