[LLVMdev] [OT] Control Flow Graph(CFG) into Abstract Syntax Tree(AST)

Carolina Simões Gomes carolina.sgomes at gmail.com
Thu Sep 13 16:10:04 PDT 2012


Yours is a very interesting problem. I am also interested in this, hope
someone can answer.

On Thu, Sep 13, 2012 at 4:58 AM, James Courtier-Dutton <
james.dutton at gmail.com> wrote:

> Hi,
> I know most compilers go from AST to CFG.
> I am writing a decompiler, so I was wondering if anyone knew of any
> documents describing how best to get from CFG to AST.
> The decompiler project is open source.
> https://github.com/jcdutton/libbeauty
> The decompiler already contains a disassembler and a virtual machine
> resulting in an annotated CFG. It uses information gained from using a
> virtual machine to annotate the CFG. Another use of the VM will be to
> help analyze self modifying code.
> The decompiler can output C source code form the CFG, but it is not
> easy to understand the result due to lack of structure such as for {}
> loops.
> I wish to create an AST from the CFG in order to be able to output for
> {}, while {}  and if...then...else structure.
> The CFG to AST step seems a little complicated, so I was looking for
> some pointers to how best to do it to save me re-inventing the wheel.
> Kind Regards
> James
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

[Carolina Simões Gomes]
M.Sc. Student in Computing Science
University of Alberta, Canada
CAS Partner - IBM Toronto
+1 (780) 863-0155
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120913/1b64333c/attachment.html>

More information about the llvm-dev mailing list