[LLVMdev] Using LLVM for decompiling.

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


Hi,

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

James



More information about the llvm-dev mailing list