From 7aca34858eb886677bc179658a6fffbb5ae54f66 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Mon, 30 Oct 2023 10:15:49 -0700 Subject: Lots of improvements to graphviz Merging common edges. Phis of same Region align. Phis use greek phi, and have a debug name. Scope carries the debug name. Phis are lightly colored. Common math names for math prims. Parse can optionally show the graph after closing the last scope. --- chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'chapter05/src/test') diff --git a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java index a4bf89ec..cd350db5 100644 --- a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java +++ b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java @@ -51,15 +51,15 @@ return c; @Test public void testChapter5IfMergeB() { - Parser parser = new Parser("int a=arg+1; int b=0; if( arg==1 ) b=a; else b=a+1; return a+b; #showGraph;"); - StopNode ret = parser.parse(); + Parser parser = new Parser("int a=arg+1; int b=0; if( arg==1 ) b=a; else b=a+1; return a+b;"); + StopNode ret = parser.parse(true); assertEquals("return ((arg*2)+Phi(Region20,2,3));", ret.toString()); } @Test public void testChapter5IfMerge2() { - Parser parser = new Parser("int a=arg+1; int b=arg+2; if( arg==1 ) b=b+a; else a=b+1; return a+b; #showGraph;"); - StopNode ret = parser.parse(); + Parser parser = new Parser("int a=arg+1; int b=arg+2; if( arg==1 ) b=b+a; else a=b+1; return a+b;"); + StopNode ret = parser.parse(true); assertEquals("return ((Phi(Region31,(arg*2),arg)+arg)+Phi(Region31,4,5));", ret.toString()); } -- cgit v1.2.3