This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LLVM as a gcc plugin?


> I'd love to see this, but I can't contribute to it directly. ÂI think the
> plugin interfaces would need small extensions, but there are no specific
> technical issues preventing it from happening. ÂLLVM has certainly
> progressed a lot since that (really old) email went out :)

I can help a bit.

There was some talk about it on #gcc. A plugin should be able to see
all the GCC IL, so it should be able to convert it to LLVM. Keeping
the current llvm-gcc interface would require some hacks

*) The plugin will have to call exit to keep gcc's code generation from running.
*) It will have to remove and recreate the .s file that is being
output. Not sure if this will work.
*) Gcc always produces .o files by calling the assembler, so "-c
-emit-llvm" will not work.
*) The plugis options will be of the form -fplugin-arg-llvm-emit-llvm

One way to avoid these problems is to make llvm-gcc a gcc wrapper that
runs gcc with the llvm plugin, converts command line options and in
the case of -c -emit-llvm calls llvm-as.

Another source of problem will be the early transformations that gcc
does and that are normally disabled in llvm-gcc. The one that I
remember right now is c++ thunk generation.

> -Chris
>

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]