cmd/internal/ssa: utility functions to make Funcs
Adds a more convenient way to define Funcs for testing. For instance, b1: v1 = Arg <mem> [.mem] Plain -> b2 b2: Exit v1 b3: v2 = Const <bool> [true] If v2 -> b3 b2 can be defined as fun :=Fun("entry", Bloc("entry", Valu("mem", OpArg, TypeMem, ".mem"), Goto("exit")), Bloc("exit", Exit("mem")), Bloc("deadblock", Valu("deadval", OpConst, TypeBool, true), If("deadval", "deadblock", "exit"))) Also add an Equiv function to test two Funcs for equivalence. Change-Id: If1633865aeefb8e765e772b6dad19250d93a413a Reviewed-on: https://go-review.googlesource.com/9992Reviewed-by: Keith Randall <khr@golang.org>
Showing
This diff is collapsed.
Please register or sign in to comment