diff options
Diffstat (limited to 'vaporize/library/CFGSimp.java')
| -rw-r--r-- | vaporize/library/CFGSimp.java | 18 | 
1 files changed, 16 insertions, 2 deletions
diff --git a/vaporize/library/CFGSimp.java b/vaporize/library/CFGSimp.java index f85c198..4456d39 100644 --- a/vaporize/library/CFGSimp.java +++ b/vaporize/library/CFGSimp.java @@ -52,6 +52,12 @@ public class CFGSimp extends VInstr.VisitorPR<ControlFlowGraph, String, RuntimeE              for (VInstr s : f.body)                  s.accept(cfg, this); +            MinimalLogger.info(String.format("Spitting out reaching...")); +            for (CFGNode n : cfg.getNodes()) +                MinimalLogger.info(String.format("%d ::: %s", +                                                 n.getLine(), +                                                 n.getReaching())); +              if (this.use_graphviz)                  this.createDotGraph(this.kettle.parseFuncName(f)); @@ -89,6 +95,8 @@ public class CFGSimp extends VInstr.VisitorPR<ControlFlowGraph, String, RuntimeE          CFGNode curr = cfg.getNode(n);          this.dot_format += cfg.addEdge(this.curr, curr);          this.curr = curr; + +        curr.addReaching(n.dest.toString());          ///////////////////////////////////////////////////////////////          MinimalLogger.info(String.format("<-%s (\"%s\":%s)",                                           n.getClass().getSimpleName(), @@ -123,6 +131,8 @@ public class CFGSimp extends VInstr.VisitorPR<ControlFlowGraph, String, RuntimeE          CFGNode curr = cfg.getNode(n);          this.dot_format += cfg.addEdge(this.curr, curr);          this.curr = curr; + +        curr.addReaching(n.dest.toString());          ///////////////////////////////////////////////////////////////          MinimalLogger.info(String.format("<-%s (\"%s\":%s)",                                           n.getClass().getSimpleName(), @@ -163,8 +173,6 @@ public class CFGSimp extends VInstr.VisitorPR<ControlFlowGraph, String, RuntimeE                                         cfg.getNode(new Integer(this.kettle                                                                 .findLabelIndex(n.target.toString())))); -        MinimalLogger.info(String.format("curr is now %s", -                                         this.kettle.get(n).trim()));          this.curr = cfg.getNextNode(curr);          ///////////////////////////////////////////////////////////////          MinimalLogger.info(String.format("<-%s (\"%s\":%s)", @@ -183,6 +191,9 @@ public class CFGSimp extends VInstr.VisitorPR<ControlFlowGraph, String, RuntimeE          CFGNode curr = cfg.getNode(n);          this.dot_format += cfg.addEdge(this.curr, curr);          this.curr = curr; + +        if (n.dest != null) +            curr.addReaching(n.dest.toString());          ///////////////////////////////////////////////////////////////          MinimalLogger.info(String.format("<-%s (\"%s\":%s)",                                           n.getClass().getSimpleName(), @@ -200,6 +211,9 @@ public class CFGSimp extends VInstr.VisitorPR<ControlFlowGraph, String, RuntimeE          CFGNode curr = cfg.getNode(n);          this.dot_format += cfg.addEdge(this.curr, curr);          this.curr = curr; + +        if (n.dest != null) +            curr.addReaching(n.dest.toString());          ///////////////////////////////////////////////////////////////          MinimalLogger.info(String.format("<-%s (\"%s\":%s)",                                           n.getClass().getSimpleName(),  | 
