[LLVMdev] dragon egg + llvm for fortran to c translation

Duncan Sands baldrick at free.fr
Fri Mar 1 07:58:15 PST 2013

Hi Philipp,

> I would like to know if it is feasible to use the dragon egg gcc plugin to
> automatically convert fortran code to c. Having found that it is possible to
> output llvm byte code back to c (at least something like this gave me this
> impression/hope: llc -march=c -o test.c) I am hoping to use dragon egg to
> generate the byte code from fortran 90 which than output to c.
> Does this seem feasible at all? How much in terms of variable names etc. could
> be retained in this manner?

some people have already been doing this.  There were some minor issues but on
the whole it seems it worked OK.  The big problem is that LLVM's C backend has
been removed, so you would have to use an old version of LLVM (or help out with
bringing the C backend back to life).

Ciao, Duncan.

More information about the llvm-dev mailing list