Ejemplo n.º 1
0
 private void UpdateDominatorTree(DominatorTree dominatorTree, IfLogicalConstruct theIfConstruct)
 {
     V_0       = new HashSet <ISingleEntrySubGraph>();
     dummyVar0 = V_0.Add(theIfConstruct.get_Condition());
     V_0.UnionWith(theIfConstruct.get_Then().get_Children());
     if (theIfConstruct.get_Else() != null)
     {
         V_0.UnionWith(theIfConstruct.get_Else().get_Children());
     }
     dominatorTree.MergeNodes(V_0, theIfConstruct.get_Condition(), theIfConstruct);
     return;
 }
Ejemplo n.º 2
0
        private void UpdateDominatorTree(DominatorTree dominatorTree, IfLogicalConstruct theIfConstruct)
        {
            HashSet <ISingleEntrySubGraph> ifNodes = new HashSet <ISingleEntrySubGraph>();

            ifNodes.Add(theIfConstruct.Condition);
            ifNodes.UnionWith(theIfConstruct.Then.Children);
            if (theIfConstruct.Else != null)
            {
                ifNodes.UnionWith(theIfConstruct.Else.Children);
            }

            dominatorTree.MergeNodes(ifNodes, theIfConstruct.Condition, theIfConstruct);
        }
Ejemplo n.º 3
0
        private void UpdateDominatorTree(DominatorTree dominatorTree, SwitchLogicalConstruct theSwitchConstruct)
        {
            HashSet <ISingleEntrySubGraph> switchNodes = new HashSet <ISingleEntrySubGraph>();

            switchNodes.Add(theSwitchConstruct.Entry);
            foreach (CaseLogicalConstruct @case in theSwitchConstruct.ConditionCases)
            {
                switchNodes.UnionWith(@case.Children);
            }

            if (theSwitchConstruct.DefaultCase != null)
            {
                switchNodes.UnionWith(theSwitchConstruct.DefaultCase.Children);
            }

            dominatorTree.MergeNodes(switchNodes, theSwitchConstruct.Entry, theSwitchConstruct);
        }
Ejemplo n.º 4
0
        private void UpdateDominatorTree(DominatorTree dominatorTree, LoopLogicalConstruct theLoopConstruct)
        {
            HashSet <ISingleEntrySubGraph> loopNodes = new HashSet <ISingleEntrySubGraph>();

            if (theLoopConstruct.LoopCondition != null)
            {
                loopNodes.Add(theLoopConstruct.LoopCondition);
            }
            if (theLoopConstruct.LoopBodyBlock != null)
            {
                loopNodes.UnionWith(theLoopConstruct.LoopBodyBlock.Children);
            }

            ISingleEntrySubGraph loopEntry = (theLoopConstruct.LoopType == LoopType.PreTestedLoop) ? theLoopConstruct.LoopCondition : theLoopConstruct.LoopBodyBlock.Entry;

            dominatorTree.MergeNodes(loopNodes, loopEntry, theLoopConstruct);
        }
Ejemplo n.º 5
0
 private void UpdateDominatorTree(DominatorTree dominatorTree, SwitchLogicalConstruct theSwitchConstruct)
 {
     V_0       = new HashSet <ISingleEntrySubGraph>();
     dummyVar0 = V_0.Add(theSwitchConstruct.get_Entry());
     V_1       = theSwitchConstruct.get_ConditionCases();
     V_2       = 0;
     while (V_2 < (int)V_1.Length)
     {
         V_0.UnionWith(V_1[V_2].get_Children());
         V_2 = V_2 + 1;
     }
     if (theSwitchConstruct.get_DefaultCase() != null)
     {
         V_0.UnionWith(theSwitchConstruct.get_DefaultCase().get_Children());
     }
     dominatorTree.MergeNodes(V_0, theSwitchConstruct.get_Entry(), theSwitchConstruct);
     return;
 }
Ejemplo n.º 6
0
 private void UpdateDominatorTree(DominatorTree dominatorTree, LoopLogicalConstruct theLoopConstruct)
 {
     V_0 = new HashSet <ISingleEntrySubGraph>();
     if (theLoopConstruct.get_LoopCondition() != null)
     {
         dummyVar0 = V_0.Add(theLoopConstruct.get_LoopCondition());
     }
     if (theLoopConstruct.get_LoopBodyBlock() != null)
     {
         V_0.UnionWith(theLoopConstruct.get_LoopBodyBlock().get_Children());
     }
     if (theLoopConstruct.get_LoopType() == 1)
     {
         stackVariable10 = theLoopConstruct.get_LoopCondition();
     }
     else
     {
         stackVariable10 = theLoopConstruct.get_LoopBodyBlock().get_Entry();
     }
     dominatorTree.MergeNodes(V_0, stackVariable10, theLoopConstruct);
     return;
 }