From dfcf11cb8d7f28acad505c2785831424c38554b8 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Sat, 27 Apr 2024 21:31:11 -0600 Subject: LIRVisitor Correct Liveness Analysis! --- cfg/CFGNode.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cfg/CFGNode.java') diff --git a/cfg/CFGNode.java b/cfg/CFGNode.java index 5ce39b5..41f2c9c 100644 --- a/cfg/CFGNode.java +++ b/cfg/CFGNode.java @@ -10,13 +10,15 @@ public class CFGNode { private Node instruction; private ArrayList sources; private ArrayList dests; - protected Set reaching; - protected Set liveness; + public Set defs; + public Set reaching; + public Set liveness; public CFGNode(Node instruction) { this.instruction = instruction; this.sources = new ArrayList<>(); this.dests = new ArrayList<>(); + this.defs = new HashSet<>(); this.reaching = new HashSet<>(); this.liveness = new HashSet<>(); } @@ -70,4 +72,8 @@ public class CFGNode { return Collections.unmodifiableSet(this.liveness); } + public Set getDefinitions() { + return Collections.unmodifiableSet(this.defs); + } + } -- cgit v1.2.3