Re: [go-nuts] CFG for a Go program

2016-12-21 Thread akshanshchahal
Ok, thank you. I will try. On Tuesday, December 20, 2016 at 8:50:39 PM UTC+5:30, Alan Donovan wrote: > > On 20 December 2016 at 10:07, wrote: > >> You mentioned it will be easier to use gc compiler's SSA representation. >> By what commands can I get that SSA

Re: [go-nuts] CFG for a Go program

2016-12-20 Thread 'Alan Donovan' via golang-nuts
On 20 December 2016 at 10:07, wrote: > You mentioned it will be easier to use gc compiler's SSA representation. > By what commands can I get that SSA representation and is there any > documentation about the use of that representation. > The compiler is not structured

Re: [go-nuts] CFG for a Go program

2016-12-20 Thread akshanshchahal
Thank you very much. Those first 2 Github links are very helpful. You mentioned it will be easier to use gc compiler's SSA representation. By what commands can I get that SSA representation and is there any documentation about the use of that representation. On Sunday, December 18, 2016 at

Re: [go-nuts] CFG for a Go program

2016-12-18 Thread 'Alan Donovan' via golang-nuts
On 17 December 2016 at 23:54, wrote: > For each instruction in any BasicBlock I want to know the type of > instruction, the variables used in that instruction. [...] Just one line > of the program corresponds to multiple instructions. Is there some > documentation as

Re: [go-nuts] CFG for a Go program

2016-12-17 Thread akshanshchahal
Hi, Plz help with this problem whenever you are free. For each instruction in any BasicBlock I want to know the type of instruction, the variables used in that instruction. For example I used this program (https://play.golang.org/p/abvgKpPg8e) to get ssa form for the main function. SSA form :

Re: [go-nuts] CFG for a Go program

2016-12-12 Thread akshanshchahal
Thanks Alan for such informative and prompt reply ! I will work on what you suggested, it seems the right way. On Sunday, December 11, 2016 at 11:53:11 PM UTC+5:30, Alan Donovan wrote: > > On 11 December 2016 at 12:21, wrote: > >> I am not sure how to get any starting

Re: [go-nuts] CFG for a Go program

2016-12-11 Thread 'Alan Donovan' via golang-nuts
On 11 December 2016 at 12:21, wrote: > I am not sure how to get any starting node of type BasicBlock ( > ssa#BasicBlock ), so > that I can traverse the Graph using Preds/Succs relation. > An ssa.Program is a

Re: [go-nuts] CFG for a Go program

2016-12-11 Thread akshanshchahal
Hi If you can help with this problem, whenever you are free. I am not sure how to get any starting node of type BasicBlock (ssa#BasicBlock ), so that I can traverse the Graph using Preds/Succs relation. I am able to get ssa/program

Re: [go-nuts] CFG for a Go program

2016-11-30 Thread adonovan via golang-nuts
On Wednesday, 30 November 2016 05:13:15 UTC-5, akshans...@gmail.com wrote: > > Thanks a lot for your valuable suggestions. I think the one using SSA form > will be helpful for my project. > Lest there be any confusion: there are two unrelated SSA forms for Go code, the one used internally by

Re: [go-nuts] CFG for a Go program

2016-11-30 Thread akshanshchahal
Thanks a lot for your valuable suggestions. I think the one using SSA form will be helpful for my project. On Monday, November 28, 2016 at 7:38:13 AM UTC+5:30, adon...@google.com wrote: > > If you're building tools for source code analysis, you may find the > golang.org/x/go/ssa

Re: [go-nuts] CFG for a Go program

2016-11-30 Thread akshanshchahal
Thanks Keith for your suggestion ! On Sunday, November 27, 2016 at 7:24:45 AM UTC+5:30, Keith Randall wrote: > > You can get the CFG (control flow graph) for a function by setting the > environment variable GOSSAFUNC to the function in question when building. > It will generate a file named

Re: [go-nuts] CFG for a Go program

2016-11-28 Thread adonovan via golang-nuts
On Monday, 28 November 2016 09:04:55 UTC-5, atd...@gmail.com wrote: > > > I concur. > > On Monday, November 28, 2016 at 4:35:13 AM UTC+1, Michael Jones wrote: >> >> Details of this would make a great Go Blog post… >> > There is certainly a dearth of documentation on how to make the key design

Re: [go-nuts] CFG for a Go program

2016-11-28 Thread atd...@gmail.com
Sunday, November 27, 2016 at 6:07 PM > *To: *golang-nuts <golan...@googlegroups.com > > *Cc: *<tgula...@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

Re: [go-nuts] CFG for a Go program

2016-11-27 Thread Michael Jones
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> Su

Re: [go-nuts] CFG for a Go program

2016-11-27 Thread adonovan via golang-nuts
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

Re: [go-nuts] CFG for a Go program

2016-11-26 Thread 'Keith Randall' via golang-nuts
You can get the CFG (control flow graph) for a function by setting the environment variable GOSSAFUNC to the function in question when building. It will generate a file named ssa.html in the current directory which you can load into a browser. It doesn't draw the CFG explicitly but the nodes

Re: [go-nuts] CFG for a Go program

2016-11-26 Thread Michael Jones
I had the same reaction. More of a riddle than a question. If CFG means Context Free Grammar, then how could it be something of a program rather than of the language? if CFG means Configuration File, then the programming language would have nothing to do with the quest for the file, which would

[go-nuts] CFG for a Go program

2016-11-25 Thread Tamás Gulácsi
What the hell is a CFG? -- 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

[go-nuts] CFG for a Go program

2016-11-25 Thread akshanshchahal
Hi, I need the CFG for a Golang Program. Any suggestions about which way can I access the CFG. Thank you Akshansh -- 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