[LLVMdev] Using LLVM for decompiling.

James Courtier-Dutton james.dutton at gmail.com
Mon May 7 05:47:21 CDT 2012


I am writing a decompiler. I was wondering if some of LLVM could be
used for a decompiler.
There are several stages in the decompiler process.
1) Take binary and create a higher level representation of it. Like RTL.
2) The output is then broken into blocks or nodes, each block ends in
a CALL, JMP, RET, or 2-way or multiway conditional JMP.
3) The blocks or nodes are then analyzed for structure in order to
extract loop information and if...then...else information.
4) Once structure is obtained, data types can be analyzed.
5) Lastly, source code is output in C or C++ or whatever is needed.

I was wondering if LLVM could help with any of these steps.
I am looking at doing step (3) better. Can LLVM help in that area?

Kind Regards


More information about the LLVMdev mailing list