summaryrefslogtreecommitdiff
path: root/vaporize/library/CFGNode.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-20 15:33:01 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-20 15:33:01 -0600
commit64710a5a9dd258bccf39ab1fa4ce607e62507c04 (patch)
tree01a9fc406802e04a1d46ff9d57abb1a63bb6635c /vaporize/library/CFGNode.java
parent543cff69f2e2d5c96140149f994299791005a420 (diff)
Implement liveness tracking in CFG
Diffstat (limited to 'vaporize/library/CFGNode.java')
-rw-r--r--vaporize/library/CFGNode.java5
1 files changed, 3 insertions, 2 deletions
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<CFGNode> sources;
private ArrayList<CFGNode> dests;
private HashSet<String> reaching;
- private ArrayList<String> liveness;
+ private HashSet<String> 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));