Details of this would make a great Go Blog post…

 

From: adonovan via golang-nuts <golang-nuts@googlegroups.com>
Reply-To: <adono...@google.com>
Date: Sunday, November 27, 2016 at 6:07 PM
To: golang-nuts <golang-nuts@googlegroups.com>
Cc: <tgulacs...@gmail.com>
Subject: Re: [go-nuts] CFG for a Go program

 

If you're building tools for source code analysis, you may find the 
golang.org/x/go/ssa representation easier to work with than the internals of 
the compiler.  Build and run this command to see an example:

 

  $ go get golang.org/x/tools/cmd/ssadump

  $ ssadump -build=F fmt

 

Alternatively, the cmd/vet tool in the standard library has an internal 
subpackage that constructs the control-flow graph of a function.  In this 
representation, each block contains a sequence of Go statements and 
expressions, not low-level SSA instructions.

 

Which of these forms of control-flow graph is most appropriate depends on the 
(unmentioned) problem you're trying to solve.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to