2

I want to compile a C/C++ code into a three address code, which is also a legal C/C++ code.

I'm doing an experiment, in which I have to analyze the three address code and add some C codes into the generated three address code. The modified three address code will be compiled into an executable file.

I have tried gimple with gcc, but gimple is just a C-like presentation. Is there any useful tool? Thank you ~

MyID
  • 21
  • 2
  • 2
    `clang`'s intermediate representation is SSA, it should be possible to dump that as code that conforms to the C grammar. – Ben Voigt Dec 24 '14 at 04:41
  • 1
    For people like me who didn't know what is a three address code: http://en.wikipedia.org/wiki/Three_address_code – Drax Dec 24 '14 at 09:43
  • @BenVoigt However, LLVM IR is not exclusively three-address, and historically the C backend was a lot of work and bug-ridden (so much that it has been removed). So what you suggest amounts to a pretty large amount of work. –  Dec 24 '14 at 12:12

0 Answers0