Tool for gcc GIMPLE modification?

714 views Asked by At

I need to add to gcc support of an OpenMP-like (directive) language. I know it is possible to dump GIMPLE code and then "undump" it and continue compilation. I want to modify the dumped DIMPLE to add calls of my dynamic library, modify variables, and so on. Is there any handy tool to do this?

EDIT: Perhaps LLVM is what I need. Currently I am interested in how to transform GIMPLE to LLVM IR. Also, is there a way to get information what line of source code corresponds to concrete operator of IR?

2

There are 2 answers

2
Amir Gonnen On

Depends on what you exactly need, you might be able to do this using GCC Plugins.

0
Anton Korobeynikov On

GIMPLE => LLVM IR translator is called "llvm-gcc" (or DragonEgg if you want a GCC plugin). The standard way of storing the map between lines of source language and something in LLVM IR is via emission of the debug information.