From 64710a5a9dd258bccf39ab1fa4ce607e62507c04 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Sat, 20 Apr 2024 15:33:01 -0600 Subject: Implement liveness tracking in CFG --- vaporize/library/CFGNode.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'vaporize/library/CFGNode.java') diff --git a/vaporize/library/CFGNode.java b/vaporize/library/CFGNode.java index aefcd28..b23ca00 100644 --- a/vaporize/library/CFGNode.java +++ b/vaporize/library/CFGNode.java @@ -12,7 +12,7 @@ class CFGNode { private ArrayList sources; private ArrayList dests; private HashSet reaching; - private ArrayList liveness; + private HashSet liveness; private int line; protected CFGNode(Node instruction) { @@ -20,6 +20,7 @@ class CFGNode { this.sources = new ArrayList<>(); this.dests = new ArrayList<>(); this.reaching = new HashSet<>(); + this.liveness = new HashSet<>(); this.line = this.instruction.sourcePos.line; } @@ -59,7 +60,7 @@ class CFGNode { this.reaching.add(add); } - protected void addLive(String add) { + protected void addLiveness(String add) { MinimalLogger.info(String.format("Use %s at %s", add, this.line)); -- cgit v1.2.3