LLVM

Gregor Richards Richards at codu.org
Mon Nov 20 13:12:18 PST 2006


Charlie wrote:
> 
> 
> Gregor Richards wrote:
> 
>> Charlie wrote:
>>
>>> A third D compiler would be very cool, especially if its around when 
>>> D goes 1.0.
>>>
>>> Craig Black wrote:
>>>
>>>>> I have tried it with LLVM's GCC and GDC.  It didn't work 
>>>>> out-of-the-box, but I don't think it would take a whole lot of 
>>>>> hackery.
>>>>>
>>>>>  - Gregor Richards
>>>>
>>>>
>>>>
>>>> How long ago did you try this?  LLVM just released a new 1.9 version 
>>>> that they claim is way better.  I'm not sure what you mean by 
>>>> out-of-the-box. But, like you say, I don't think it would be a 
>>>> massive effort.  It seems that LLVM is pretty well thought out.
>>>>
>>>> -Craig
>>>>
>>
>> LLVM uses GCC, so in all fairness it would hardly be a third D 
>> compiler, it would just be another face of GDC.
>>
>>  - Gregor Richards
 >
 > Hmm, I don't think it uses GCC as a backend.
 >
 >  From the website: We find that LLVM is able to compile C++ into
 > substantially better code than GCC .
 >
 > It says it can use the GCC front-end for its LLVM backend, which I think
 > is the opposite of GDC, which uses DMD front end to produce a tree
 > usable by GCC backend.
 >
 > I think DMD Frontend translated to LLVM backend would be completely
 > independent of GCC, and the more compilers the better!
 >
 > Charlie

)top-post don't please(


Normal GCC (simplified):
[C] code -> GIMPLE -> target ASM

LLVM GCC (simplified):
[C] code -> GIMPLE -> LLVM ASM

Normal GDC (simplified);
D code -> GIMPLE -> target ASM

LLVM GDC (simplified):
D code -> GIMPLE -> LLVM ASM


The same component of GCC (namely, the IR, GIMPLE) is both a backend to 
GDC and a frontend to LLVM.

  - Gregor Richards



More information about the Digitalmars-d mailing list