pythonic
pythonic

Reputation: 21685

Converting GCC IR to LLVM IR

I have written an LLVM pass that modifies the Intermediate Representation (IR) code. To increase portability, I also want it to work with a gcc compiler. So I was wondering if there is any tool which can convert some Intermediate Representation (IR) of gcc to LLVM IR.

Upvotes: 9

Views: 2737

Answers (2)

Dan
Dan

Reputation: 13210

It will probably be much easier to simply write another version of your code that works with gcc IR. What you want to do is likely not possible, and if it is possible, it's probably extremely difficult. (More so than writing the LLVM pass in the first place.)

Upvotes: 2

You probably want dragonegg (which is using the GCC front-end to build an LLVM IR).

And if you wanted to work on the GCC internal representations, MELT (a high level domain specific language to extend GCC) is probably the right tool.

Upvotes: 6

Related Questions