Try for new getprecontinues method for for detection

This commit is contained in:
Jindra Petřík
2021-01-10 19:00:00 +01:00
parent 6022b27a70
commit 96f3aee198
3 changed files with 456 additions and 221 deletions

View File

@@ -12,12 +12,15 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.graph;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
*
@@ -31,6 +34,8 @@ public class Loop implements Serializable {
public GraphPart loopPreContinue;
public Set<GraphPart> backEdges = new HashSet<>();
public List<GraphPart> breakCandidates = new ArrayList<>();
public List<Integer> breakCandidatesLevels = new ArrayList<>();
@@ -53,7 +58,11 @@ public class Loop implements Serializable {
@Override
public String toString() {
public String toString() {
Set<String> edgesAsStr = new HashSet<>();
for (GraphPart p : backEdges) {
edgesAsStr.add(p.toString());
}
return "loop(id:" + id + (loopPreContinue != null ? ",precontinue:" + loopPreContinue : "") + ",continue:" + loopContinue + ", break:" + loopBreak + ", phase:" + phase + ", backedges: " + String.join(",", edgesAsStr) + ")";
}
@Override