On Jun 30, 2011, at 10:05 PM, janarbek wrote:> > Hi All, > I am reposting my question again since i think my question was not clear enough. > I am wondering is it possible to generate Control Data Flow Graph from C using LLVM? or is it possible to get web-like structure of C code using llvm / > > Thanks in advance, > Any comment suggestion would be appreciated. > > Jan Ma. > > > > ==========================================> > > --- On Thu, 6/30/11, janarbek <canarbekmatay at yahoo.com> wrote: > > From: janarbek <canarbekmatay at yahoo.com> > Subject: Generating DFG or CDFG from C code > To: llvmdev at cs.uiuc.edu > Date: Thursday, June 30, 2011, 11:55 AM > > Hi All, > > I am new to LLVM. I want to generate a Dataflow graph or Control Dataflow graph from C code using LLVM. I have no idea how to do it in LLVM. I tried to use analysis and transform passes such as "-dot-cfg" but it doesn't give what I want. I want to generate a node for each operation in C code. > > Thanks in advance. > JM. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdevI don't know if anyone has already done this, but some important pieces are there. See Dataflow.h and GraphWriter.h. I think you'll run into a problem though because the value graph isn't fully connected. You have to walk the instruction stream looking for "roots". -Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110630/302d8087/attachment.html>
Hi Andrew, Thanks for the response. That helps a lot. So that means I have to implement a pass, right ? Sorry for dumb question. I just started LLVM today. =========================================== Phone : 82-42-860-1838 Fax : 82-42-860-6790 Cell Phone: 82-10-7599-1981 ========================================== --- On Thu, 6/30/11, Andrew Trick <atrick at apple.com> wrote: From: Andrew Trick <atrick at apple.com> Subject: Re: [LLVMdev] Generating DFG or CDFG from C code To: "janarbek" <canarbekmatay at yahoo.com> Cc: llvmdev at cs.uiuc.edu Date: Thursday, June 30, 2011, 10:51 PM On Jun 30, 2011, at 10:05 PM, janarbek wrote: Hi All, I am reposting my question again since i think my question was not clear enough. I am wondering is it possible to generate Control Data Flow Graph from C using LLVM? or is it possible to get web-like structure of C code using llvm / Thanks in advance, Any comment suggestion would be appreciated. Jan Ma. ========================================== --- On Thu, 6/30/11, janarbek <canarbekmatay at yahoo.com> wrote: From: janarbek <canarbekmatay at yahoo.com> Subject: Generating DFG or CDFG from C code To: llvmdev at cs.uiuc.edu Date: Thursday, June 30, 2011, 11:55 AM Hi All, I am new to LLVM. I want to generate a Dataflow graph or Control Dataflow graph from C code using LLVM. I have no idea how to do it in LLVM. I tried to use analysis and transform passes such as "-dot-cfg" but it doesn't give what I want. I want to generate a node for each operation in C code. Thanks in advance.JM. _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev I don't know if anyone has already done this, but some important pieces are there. See Dataflow.h and GraphWriter.h. I think you'll run into a problem though because the value graph isn't fully connected. You have to walk the instruction stream looking for "roots". -Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110630/82900035/attachment.html>
Unless someone else responds with "I've already done that" then you need to implement a pass. It's probably something you want to customize to your needs anyway. -Andy On Jun 30, 2011, at 11:50 PM, janarbek wrote:> Hi Andrew, > Thanks for the response. That helps a lot. > > So that means I have to implement a pass, right ? Sorry for dumb question. I just started LLVM today. > > > > ==========================================> > Phone : 82-42-860-1838 > Fax : 82-42-860-6790 > Cell Phone: 82-10-7599-1981 > ==========================================> > > --- On Thu, 6/30/11, Andrew Trick <atrick at apple.com> wrote: > > From: Andrew Trick <atrick at apple.com> > Subject: Re: [LLVMdev] Generating DFG or CDFG from C code > To: "janarbek" <canarbekmatay at yahoo.com> > Cc: llvmdev at cs.uiuc.edu > Date: Thursday, June 30, 2011, 10:51 PM > > > On Jun 30, 2011, at 10:05 PM, janarbek wrote: > >> >> Hi All, >> I am reposting my question again since i think my question was not clear enough. >> I am wondering is it possible to generate Control Data Flow Graph from C using LLVM? or is it possible to get web-like structure of C code using llvm / >> >> Thanks in advance, >> Any comment suggestion would be appreciated. >> >> Jan Ma. >> >> >> >> ==========================================>> >> >> --- On Thu, 6/30/11, janarbek <canarbekmatay at yahoo.com> wrote: >> >> From: janarbek <canarbekmatay at yahoo.com> >> Subject: Generating DFG or CDFG from C code >> To: llvmdev at cs.uiuc.edu >> Date: Thursday, June 30, 2011, 11:55 AM >> >> Hi All, >> >> I am new to LLVM. I want to generate a Dataflow graph or Control Dataflow graph from C code using LLVM. I have no idea how to do it in LLVM. I tried to use analysis and transform passes such as "-dot-cfg" but it doesn't give what I want. I want to generate a node for each operation in C code. >> >> Thanks in advance. >> JM. >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > I don't know if anyone has already done this, but some important pieces are there. See Dataflow.h and GraphWriter.h. > > I think you'll run into a problem though because the value graph isn't fully connected. You have to walk the instruction stream looking for "roots". > > -Andy-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110701/75c281dd/attachment.html>
Apparently Analagous Threads
- [LLVMdev] Generating DFG or CDFG from C code
- [LLVMdev] Generating DFG or CDFG from C code
- [LLVMdev] Generating DFG or CDFG from C code
- [LLVMdev] Generating DFG or CDFG from C code
- [LLVMdev] LLVM build is failed giving Path.inc:714: error: ‘unlink’ was not declared in this scope