|
|
@ -89,7 +89,8 @@ public class FastExtendedPostdominanceHelper { |
|
|
|
stackPath.add(factory.spawnEmptySet()); |
|
|
|
stackPath.add(factory.spawnEmptySet()); |
|
|
|
|
|
|
|
|
|
|
|
Set<Statement> setVisited = new HashSet<Statement>(); |
|
|
|
Set<Statement> setVisited = new HashSet<Statement>(); |
|
|
|
Set<Statement> setStack = new HashSet<Statement>(); |
|
|
|
|
|
|
|
|
|
|
|
setVisited.add(stack.getFirst()); |
|
|
|
|
|
|
|
|
|
|
|
while (!stack.isEmpty()) { |
|
|
|
while (!stack.isEmpty()) { |
|
|
|
|
|
|
|
|
|
|
@ -104,34 +105,21 @@ public class FastExtendedPostdominanceHelper { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setVisited.add(stat); |
|
|
|
if(!engine.isDominator(stat.id, head)) { |
|
|
|
|
|
|
|
setPostdoms.complement(path); |
|
|
|
int domflag = 0; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
for (Iterator<Integer> it = setPostdoms.iterator(); it.hasNext(); ) { |
|
|
|
|
|
|
|
Integer post = it.next(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!path.contains(post)) { |
|
|
|
|
|
|
|
if (domflag == 0) { |
|
|
|
|
|
|
|
domflag = engine.isDominator(stat.id, head) ? 2 : 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (domflag == 1) { // not a dominator
|
|
|
|
|
|
|
|
it.remove(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (StatEdge edge : stat.getSuccessorEdges(StatEdge.TYPE_REGULAR)) { |
|
|
|
for (StatEdge edge : stat.getSuccessorEdges(StatEdge.TYPE_REGULAR)) { |
|
|
|
|
|
|
|
|
|
|
|
Statement edge_destination = edge.getDestination(); |
|
|
|
Statement edge_destination = edge.getDestination(); |
|
|
|
|
|
|
|
|
|
|
|
if(!setVisited.contains(edge_destination) && !setStack.contains(edge_destination)) { |
|
|
|
if(!setVisited.contains(edge_destination) /*&& !setStack.contains(edge_destination)*/) { |
|
|
|
|
|
|
|
|
|
|
|
stack.add(edge_destination); |
|
|
|
stack.add(edge_destination); |
|
|
|
stackPath.add(path.getCopy()); |
|
|
|
stackPath.add(path.getCopy()); |
|
|
|
|
|
|
|
|
|
|
|
setStack.add(edge_destination); |
|
|
|
setVisited.add(edge_destination); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|