Start refactoring task 1 and 2
This commit is contained in:
@@ -11,7 +11,7 @@ import cfg_build
|
||||
import lib.console as cnsl
|
||||
import syntax
|
||||
import triplayacc as yacc
|
||||
from cfa.analysis_dot import analysis_to_dot, run_all_analyses
|
||||
from cfa.to_dot import analysis_to_dot, run_all_analyses
|
||||
from cfg.CFG import CFG
|
||||
from vistram.tram import *
|
||||
from vistram.vistram import MachineUI
|
||||
@@ -81,10 +81,10 @@ def print_analysis_reports(cfg, analyses: dict, ru_edges: dict[int, list[int]]):
|
||||
|
||||
print("\nLive Variables Report")
|
||||
print("---------------------")
|
||||
node_ids = sorted(set(lv.in_sets.keys()) | set(lv.out_sets.keys()))
|
||||
node_ids = sorted(set(lv.incoming.keys()) | set(lv.outgoing.keys()))
|
||||
for nid in node_ids:
|
||||
in_set = sorted(lv.in_sets.get(nid, set()))
|
||||
out_set = sorted(lv.out_sets.get(nid, set()))
|
||||
in_set = sorted(lv.incoming.get(nid, set()))
|
||||
out_set = sorted(lv.outgoing.get(nid, set()))
|
||||
if not in_set and not out_set:
|
||||
continue
|
||||
print(f"n{nid} [{node_text(nid)}]: In={in_set} Out={out_set}")
|
||||
|
||||
Reference in New Issue
Block a user