public Func <AState, IFixpointInfo <APC, AState> > CreateForward <AState>(IAnalysisDriver <APC, AState, IVisitMSIL <APC, Local, Parameter, Method, Field, Type, int, int, AState, AState>, IStackContext <Field, Method> > analysis)
        {
            var solver = ForwardAnalysisSolver <AState, Type> .Make(stackDecoder, analysis, apcStackPrinter);

            solver.Trace = this.parent.Options.TraceDFA;
            return((initialState) => { solver.Run(initialState); return solver; });
        }
Beispiel #2
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);
        }
        public Func <AnalysisState, IFixpointInfo <APC, AnalysisState> > CreateForward <AnalysisState>(
            IAnalysis <APC, AnalysisState, IVisitMSIL <APC, Local, Parameter, Method, Field, Type, Expression, Variable, AnalysisState, AnalysisState>, EdgeData> analysis,
            DFAOptions options)
        {
            var solver = ForwardAnalysisSolver <AnalysisState, Type, EdgeData> .Make(this.ildecoder, analysis, this.Printer);

            solver.Options = options;
            return((initialState) => { solver.Run(initialState); return solver; });
        }
        public Func <AState, IFixpointInfo <APC, AState> > CreateForward <AState>(IAnalysisDriver <APC, AState, IVisitMSIL <APC, Local, Parameter, Method, Field, Type, Unit, Unit, AState, AState>, IMethodContext <Field, Method> > analysis)
        {
            var solver = ForwardAnalysisSolver <AState, Type> .Make(apcDecoder, analysis, apcRawPrinter);

            solver.Trace = this.parent.Options.TraceDFA;
            solver.TraceTimePerInstruction = this.parent.Options.TraceTimings;

            return((initialState) => { solver.Run(initialState); return solver; });
        }