Exemplo n.º 1
0
        /// <summary>
        /// Ensures the routine has flow context.
        /// Otherwise it is created and routine is enqueued for analysis.
        /// </summary>
        void EnsureRoutine(SourceRoutineSymbol routine)
        {
            Contract.ThrowIfNull(routine);

            var cfg = routine.ControlFlowGraph;

            if (cfg == null)
            {
                // create initial flow state
                var state  = StateBinder.CreateInitialState(routine);
                var binder = new SemanticsBinder(routine, state.FlowContext);

                // create control flow
                routine.ControlFlowGraph = cfg = new ControlFlowGraph(routine.Statements, binder);

                // enqueue the method for the analysis
                cfg.Start.FlowState = state;
                _worklist.Enqueue(cfg.Start);
            }
        }
 void SetStateBinderWithNodes(List<NodeRef> nodes, StateBinder binder)
 {
     foreach (NodeRef nr in nodes)
     {
         nr.SetStateBinder(binder);
     }
 }
Exemplo n.º 3
0
 public void StateBinder(StateBinder pState)
 {
     pState.UnbindState(m_prog);
 }
Exemplo n.º 4
0
 public void SetStateBinder(StateBinder pBinder)
 {
     m_binders.Add(pBinder);
 }