当前位置: 首页>>代码示例>>C#>>正文


C# ControlFlowNode.Dominates方法代码示例

本文整理汇总了C#中ICSharpCode.Decompiler.FlowAnalysis.ControlFlowNode.Dominates方法的典型用法代码示例。如果您正苦于以下问题:C# ControlFlowNode.Dominates方法的具体用法?C# ControlFlowNode.Dominates怎么用?C# ControlFlowNode.Dominates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICSharpCode.Decompiler.FlowAnalysis.ControlFlowNode的用法示例。


在下文中一共展示了ControlFlowNode.Dominates方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindLoopContents

 static void FindLoopContents(HashSet<ControlFlowNode> nodes, HashSet<ControlFlowNode> loopContents, ControlFlowNode loopHead, ControlFlowNode addNode)
 {
     if (nodes.Contains(addNode) && loopHead.Dominates(addNode) && loopContents.Add(addNode)) {
         foreach (var edge in addNode.Incoming) {
             FindLoopContents(nodes, loopContents, loopHead, edge.Source);
         }
     }
 }
开发者ID:FriedWishes,项目名称:ILSpy,代码行数:8,代码来源:ILAstOptimizer.cs

示例2: FindDominatedNodes

        static HashSet<ControlFlowNode> FindDominatedNodes(HashSet<ControlFlowNode> nodes, ControlFlowNode head)
        {
            var exitNodes = head.DominanceFrontier.SelectMany(n => n.Predecessors);
            HashSet<ControlFlowNode> agenda = new HashSet<ControlFlowNode>(exitNodes);
            HashSet<ControlFlowNode> result = new HashSet<ControlFlowNode>();

            while(agenda.Count > 0) {
                ControlFlowNode addNode = agenda.First();
                agenda.Remove(addNode);

                if (nodes.Contains(addNode) && head.Dominates(addNode) && result.Add(addNode)) {
                    foreach (var predecessor in addNode.Predecessors) {
                        agenda.Add(predecessor);
                    }
                }
            }
            if (nodes.Contains(head))
                result.Add(head);

            return result;
        }
开发者ID:FriedWishes,项目名称:ILSpy,代码行数:21,代码来源:ILAstOptimizer.cs

示例3: FindLoopContent

		static HashSet<ControlFlowNode> FindLoopContent(HashSet<ControlFlowNode> scope, ControlFlowNode head)
		{
			var viaBackEdges = head.Predecessors.Where(p => head.Dominates(p));
			HashSet<ControlFlowNode> agenda = new HashSet<ControlFlowNode>(viaBackEdges);
			HashSet<ControlFlowNode> result = new HashSet<ControlFlowNode>();
			
			while(agenda.Count > 0) {
				ControlFlowNode addNode = agenda.First();
				agenda.Remove(addNode);
				
				if (scope.Contains(addNode) && head.Dominates(addNode) && result.Add(addNode)) {
					foreach (var predecessor in addNode.Predecessors) {
						agenda.Add(predecessor);
					}
				}
			}
			if (scope.Contains(head))
				result.Add(head);
			
			return result;
		}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:21,代码来源:LoopsAndConditions.cs

示例4: FindDominatedNodes

		static HashSet<ControlFlowNode> FindDominatedNodes(HashSet<ControlFlowNode> scope, ControlFlowNode head)
		{
			HashSet<ControlFlowNode> agenda = new HashSet<ControlFlowNode>();
			HashSet<ControlFlowNode> result = new HashSet<ControlFlowNode>();
			agenda.Add(head);
			
			while(agenda.Count > 0) {
				ControlFlowNode addNode = agenda.First();
				agenda.Remove(addNode);
				
				if (scope.Contains(addNode) && head.Dominates(addNode) && result.Add(addNode)) {
					foreach (var successor in addNode.Successors) {
						agenda.Add(successor);
					}
				}
			}
			
			return result;
		}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:19,代码来源:LoopsAndConditions.cs

示例5: HasSingleEdgeEnteringBlock

		static bool HasSingleEdgeEnteringBlock(ControlFlowNode node)
		{
			return node.Incoming.Count(edge => !node.Dominates(edge.Source)) == 1;
		}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:4,代码来源:LoopsAndConditions.cs

示例6: FindLoopContent

		static HashSet<ControlFlowNode> FindLoopContent(HashSet<ControlFlowNode> scope, ControlFlowNode head)
		{
			HashSet<ControlFlowNode> agenda = new HashSet<ControlFlowNode>();
			for (int i = 0; i < head.Incoming.Count; i++) {
				var p = head.Incoming[i].Source;
				if (head.Dominates(p))
					agenda.Add(p);
			}
			HashSet<ControlFlowNode> result = new HashSet<ControlFlowNode>();
			
			while(agenda.Count > 0) {
				ControlFlowNode addNode = agenda.First();
				agenda.Remove(addNode);
				
				if (scope.Contains(addNode) && head.Dominates(addNode) && result.Add(addNode)) {
					for (int i = 0; i < addNode.Incoming.Count; i++)
						agenda.Add(addNode.Incoming[i].Source);
				}
			}
			if (scope.Contains(head))
				result.Add(head);
			
			return result;
		}
开发者ID:levisre,项目名称:dnSpy,代码行数:24,代码来源:LoopsAndConditions.cs

示例7: FindDominatedNodes

		static HashSet<ControlFlowNode> FindDominatedNodes(HashSet<ControlFlowNode> scope, ControlFlowNode head)
		{
			HashSet<ControlFlowNode> agenda = new HashSet<ControlFlowNode>();
			HashSet<ControlFlowNode> result = new HashSet<ControlFlowNode>();
			agenda.Add(head);
			
			while(agenda.Count > 0) {
				ControlFlowNode addNode = agenda.First();
				agenda.Remove(addNode);
				
				if (scope.Contains(addNode) && head.Dominates(addNode) && result.Add(addNode)) {
					for (int i = 0; i < addNode.Outgoing.Count; i++) {
						agenda.Add(addNode.Outgoing[i].Target);
					}
				}
			}
			
			return result;
		}
开发者ID:levisre,项目名称:dnSpy,代码行数:19,代码来源:LoopsAndConditions.cs

示例8: FindLoopContents

		static void FindLoopContents(ControlStructure current, HashSet<ControlFlowNode> loopContents, ControlFlowNode loopHead, ControlFlowNode node)
		{
			if (current.AllNodes.Contains(node) && loopHead.Dominates(node) && loopContents.Add(node)) {
				foreach (var edge in node.Incoming) {
					FindLoopContents(current, loopContents, loopHead, edge.Source);
				}
			}
		}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:8,代码来源:ControlStructureDetector.cs


注:本文中的ICSharpCode.Decompiler.FlowAnalysis.ControlFlowNode.Dominates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。