Running SSA code

Is it possible to run the SSA code?

Using ssadump -build, we can convert go code to SSA form. After this I want to run the SSA code itself. If I am right, the main go compiler will only switch to using this in 1.7 or 1.8, but is this already there somewhere?

Basically, I want to instrument go code. It would be easiest to modify it at SSA level. Otherwise I would have to work at the AST level.

I don’t think there is anything prebuilt, but the ssa implementation in the 1.7 compiler is informed (I’m not going to say derived, in case that is wrong) by the work of Alan Donovan on his Guru (nee. Oracle) project. I believe the go guru implements a go interpreter which operates on an ssa form. You can find all the bits in the golang.org/x/tools repo.

Good luck!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.