Ejemplo n.º 1
0
 private HashSet <ILogicalConstruct> GetIntervalSuccessors(IntervalConstruct interval, ILogicalConstruct startNode)
 {
     V_0 = new HashSet <ILogicalConstruct>();
     if (!interval.get_Children().Contains(startNode))
     {
         return(V_0);
     }
     V_1 = new Queue <ILogicalConstruct>();
     V_1.Enqueue(startNode);
     V_2       = new HashSet <ILogicalConstruct>();
     dummyVar0 = V_2.Add(startNode);
     while (V_1.get_Count() > 0)
     {
         V_3 = V_1.Dequeue().get_SameParentSuccessors().GetEnumerator();
         try
         {
             while (V_3.MoveNext())
             {
                 V_4 = (ILogicalConstruct)V_3.get_Current();
                 if (V_2.Contains(V_4) || !interval.get_Children().Contains(V_4) || !V_0.Add(V_4))
                 {
                     continue;
                 }
                 dummyVar1 = V_2.Add(V_4);
                 V_1.Enqueue(V_4);
             }
         }
         finally
         {
             ((IDisposable)V_3).Dispose();
         }
     }
     return(V_0);
 }
Ejemplo n.º 2
0
        private void RemoveBlockingEdges(List <IntervalConstruct> intervals)
        {
            V_0 = new IntervalConstruct(intervals.get_Item(0));
            V_5 = 1;
            while (V_5 < intervals.get_Count())
            {
                dummyVar0 = V_0.get_Children().Add(intervals.get_Item(V_5));
                V_5       = V_5 + 1;
            }
            V_1 = DFSTBuilder.BuildTree(V_0);
            V_2 = V_1.get_BackEdges().FirstOrDefault <DFSTEdge>();
            if (V_2 == null)
            {
                V_2 = V_1.get_CrossEdges().FirstOrDefault <DFSTEdge>();
            }
            V_3 = V_2.get_Start().get_Construct() as IntervalConstruct;
            V_4 = V_2.get_End().get_Construct() as IntervalConstruct;
            V_6 = V_4.get_Entry().get_SameParentPredecessors().GetEnumerator();
            try
            {
                while (V_6.MoveNext())
                {
                    V_7 = (ILogicalConstruct)V_6.get_Current();
                    if (!V_3.get_Children().Contains(V_7))
                    {
                        continue;
                    }
                    V_8 = V_7;
                    V_9 = V_4.get_Entry() as ILogicalConstruct;
                    if (this.removedEdges.TryGetValue(V_8, out V_10) && V_10.Contains(V_9))
                    {
                        continue;
                    }
                    this.MarkAsGotoEdge(V_8, V_9);
                    goto Label0;
                }
            }
            finally
            {
                ((IDisposable)V_6).Dispose();
            }
Label0:
            return;
        }
Ejemplo n.º 3
0
 private void ExpandLoopBody(IntervalConstruct interval, HashSet <ILogicalConstruct> loopBody, ILogicalConstruct loopSuccessor)
 {
     V_0       = this.GetIntervalSuccessors(interval, loopSuccessor);
     dummyVar0 = V_0.Add(loopSuccessor);
     V_1       = interval.get_Children().GetEnumerator();
     try
     {
         while (V_1.MoveNext())
         {
             V_2 = (LogicalConstructBase)V_1.get_Current();
             if (V_0.Contains(V_2))
             {
                 continue;
             }
             dummyVar1 = loopBody.Add(V_2);
         }
     }
     finally
     {
         ((IDisposable)V_1).Dispose();
     }
     return;
 }
Ejemplo n.º 4
0
        private LoopType DetermineLoopType(HashSet <ILogicalConstruct> loopBody, HashSet <ILogicalConstruct> latchingNodes, IntervalConstruct interval, DominatorTree dominatorTree, out ConditionLogicalConstruct loopCondition)
        {
            V_0       = interval.get_Entry() as ILogicalConstruct;
            V_1       = new HashSet <ILogicalConstruct>(latchingNodes);
            dummyVar0 = V_1.Add(V_0);
            V_2       = DFSTBuilder.BuildTree(V_0.get_Parent() as ILogicalConstruct);
            V_3       = new HashSet <ILogicalConstruct>();
            V_4       = loopBody.GetEnumerator();
            try
            {
                while (V_4.MoveNext())
                {
                    V_5 = V_4.get_Current();
                    V_6 = dominatorTree.GetDominanceFrontier(V_5).GetEnumerator();
                    try
                    {
                        while (V_6.MoveNext())
                        {
                            V_7 = (ILogicalConstruct)V_6.get_Current();
                            if (!interval.get_Children().Contains(V_7) || loopBody.Contains(V_7))
                            {
                                continue;
                            }
                            dummyVar1 = V_3.Add(V_7);
                        }
                    }
                    finally
                    {
                        ((IDisposable)V_6).Dispose();
                    }
                }
            }
            finally
            {
                ((IDisposable)V_4).Dispose();
            }
            if (V_3.get_Count() == 0)
            {
                V_8 = V_2.get_ReversePostOrder().GetEnumerator();
                try
                {
                    while (V_8.MoveNext())
                    {
                        V_9 = V_8.get_Current().get_Construct() as ILogicalConstruct;
                        if (loopBody.Contains(V_9))
                        {
                            continue;
                        }
                        loopCondition = this.GetLoopConditionWithMaxIndex(V_2, loopBody, V_1, V_9);
                        if (loopCondition == null)
                        {
                            continue;
                        }
                        this.ExpandLoopBody(interval, loopBody, V_9);
                        if (loopCondition != V_0)
                        {
                            V_10 = 2;
                            goto Label1;
                        }
                        else
                        {
                            V_10 = 1;
                            goto Label1;
                        }
                    }
                    goto Label0;
                }
                finally
                {
                    ((IDisposable)V_8).Dispose();
                }
Label1:
                return(V_10);
            }
            V_11 = V_2.get_ReversePostOrder().get_Count();
            V_4  = V_3.GetEnumerator();
            try
            {
                while (V_4.MoveNext())
                {
                    V_13 = V_4.get_Current();
                    V_14 = V_2.get_ConstructToNodeMap().get_Item(V_13).get_ReversePostOrderIndex();
                    if (V_14 >= V_11)
                    {
                        continue;
                    }
                    V_11 = V_14;
                }
            }
            finally
            {
                ((IDisposable)V_4).Dispose();
            }
            V_12          = V_2.get_ReversePostOrder().get_Item(V_11).get_Construct() as ILogicalConstruct;
            loopCondition = this.GetLoopConditionWithMaxIndex(V_2, loopBody, V_1, V_12);
            this.ExpandLoopBody(interval, loopBody, V_12);
            if (loopCondition == null)
            {
                return(0);
            }
            if (loopCondition == V_0)
            {
                return(1);
            }
            return(2);

Label0:
            if (!this.CanBeLoopCondition(V_0, loopBody))
            {
                loopCondition = null;
                return(0);
            }
            loopCondition = V_0 as ConditionLogicalConstruct;
            return(1);
        }