summaryrefslogtreecommitdiff
path: root/vaporize/library/CFGSimp.java
diff options
context:
space:
mode:
Diffstat (limited to 'vaporize/library/CFGSimp.java')
-rw-r--r--vaporize/library/CFGSimp.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/vaporize/library/CFGSimp.java b/vaporize/library/CFGSimp.java
index 4456d39..6aaf0d1 100644
--- a/vaporize/library/CFGSimp.java
+++ b/vaporize/library/CFGSimp.java
@@ -27,9 +27,6 @@ public class CFGSimp extends VInstr.VisitorPR<ControlFlowGraph, String, RuntimeE
for (VFunction f : this.vp.functions) {
ControlFlowGraph cfg = new ControlFlowGraph();
this.dot_format = "";
- // first visit may not find edges; cfg.addEdges will handle
- this.curr = new CFGNode(f.body[0]);
- cfg.setStart(curr);
MinimalLogger.info(String.format("CFGSimp is collecting nodes for %s",
this.kettle.parseFuncName(f)));
@@ -49,6 +46,14 @@ public class CFGSimp extends VInstr.VisitorPR<ControlFlowGraph, String, RuntimeE
MinimalLogger.info(String.format("CFGSimp is collecting edges for %s",
this.kettle.parseFuncName(f)));
+
+ // inital setup
+ // first visit may not find edges; cfg.addEdges will handle
+ this.curr = new CFGNode(f.body[0]);
+ cfg.setStart(curr);
+ // cascades downwards --- cfg.addEdges
+ for (VVarRef.Local l : f.params)
+ this.curr.addReaching(l.ident.toString());
for (VInstr s : f.body)
s.accept(cfg, this);