|
|
@ -746,8 +746,8 @@ namespace ICSharpCode.Decompiler.ILAst |
|
|
|
|
|
|
|
|
|
|
|
static HashSet<ControlFlowNode> FindLoopContent(HashSet<ControlFlowNode> scope, ControlFlowNode head) |
|
|
|
static HashSet<ControlFlowNode> FindLoopContent(HashSet<ControlFlowNode> scope, ControlFlowNode head) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var exitNodes = head.DominanceFrontier.SelectMany(n => n.Predecessors); |
|
|
|
var viaBackEdges = head.Predecessors.Where(p => head.Dominates(p)); |
|
|
|
HashSet<ControlFlowNode> agenda = new HashSet<ControlFlowNode>(exitNodes); |
|
|
|
HashSet<ControlFlowNode> agenda = new HashSet<ControlFlowNode>(viaBackEdges); |
|
|
|
HashSet<ControlFlowNode> result = new HashSet<ControlFlowNode>(); |
|
|
|
HashSet<ControlFlowNode> result = new HashSet<ControlFlowNode>(); |
|
|
|
|
|
|
|
|
|
|
|
while(agenda.Count > 0) { |
|
|
|
while(agenda.Count > 0) { |
|
|
|