[cfe-dev] CABI project

Dave Abrahams dave at boostpro.com
Tue Oct 16 14:24:24 PDT 2012


on Tue Oct 16 2012, John McCall <rjmccall-AT-apple.com> wrote:

> On Oct 16, 2012, at 12:11 PM, Dave Abrahams wrote:
>> on Tue Oct 16 2012, John McCall <rjmccall-AT-apple.com> wrote:
>>> On Oct 16, 2012, at 11:45 AM, Dave Abrahams wrote:
>>>> I'm working on a project to separate from Clang all the logic necessary
>>>> to generate C/C++/ObjC-ABI-compatible code so that other front-ends,
>>>> both C family (e.g. Dragonegg, and in BoostPro's case, EDG) and other
>>>> languages/code generators, can interoperate with C family code.
>>> 
>>> So, specifically, this would be some sort of API where you give it a C
>>> function type and it tells you how to pass those arguments in LLVM IR?
>> 
>> Oh, way more than that.  It has to deal with exception-handling, object
>> layout, vtable layout, yada yada... and probably a few
>> ObjectiveC-specific things I don't know about (not being versed in
>> ObjC).
>
> Oh, uh, that's an enormous project.  

Quite so.

> In what way, precisely, is this not a proposal to reinvent all of
> IR-generation as another level of abstraction?

I'm not sure whether it amounts to that, but I suppose it could
eventually end up there, in the long-term.  Initially I'm interested in
abstracting out enough to handle C, which I think mostly just amounts to
what you said above, i.e. argument passing, (and, I guess, varargs
interpretation).  

A little further out, there's support for C++, but having talked to Doug
a bit more, it's clear to me that EDG has already done quite a few of
these things (e.g. vtables, generation of exception-handling cleanups
and landing pads) in its front-end, so for my particular application
those bits don't have to be abstracted out.

For this library to be fully useful from code generators that aren't
already C++ front-ends, you'd probably want to handle some of these
other things too... but that's way off in the future if it happens.

-- 
Dave Abrahams
BoostPro Computing                  Software Development        Training
http://www.boostpro.com             Clang/LLVM/EDG Compilers  C++  Boost



More information about the cfe-dev mailing list