Automated translation from C++ to D

Walter Bright newshound at digitalmars.com
Thu Feb 23 18:37:47 PST 2006


"Aarti" <aarti at interia.pl> wrote in message 
news:dtfs08$2iqg$1 at digitaldaemon.com...
> ...but what about GCC intermediate languages? Documentation on:
> http://gcc.gnu.org/onlinedocs/gccint/Tree-SSA.html#Tree-SSA
> says:
> "GCC uses three main intermediate languages to represent the program 
> during compilation: GENERIC, GIMPLE and RTL. GENERIC is a 
> language-independent representation generated by each front end. It is 
> used to serve as an interface between the parser and optimizer. GENERIC is 
> a common representation that is able to represent programs written in all 
> the languages supported by GCC."
>
> Is GENERIC too low-level language to make it possible to convert it in a 
> sensible way to D?

Let me illustrate by example. I could write an assembler to D translator, 
but the D code emitted would look like:

    add(&flags, &EAX, 6);
    cmp(&flags, EAX, EBX);
    if (jne(&flags))
        goto L1A0;

etc. It would bear no reasonable relation to whatever source code produced 
it. I haven't looked at the gcc intermediate code, but it's more than likely 
too low level. 





More information about the Digitalmars-d mailing list