[LLVMdev] [RFC] Resurrecting the C back-end

Sebastian Redl sebastian.redl at getdesigned.at
Tue Aug 28 02:34:51 PDT 2012


On 28.08.2012 11:14, Roel Jordans wrote:
> Possibly yes, compiling C++ to C would require support for things like 
> exception handling which require more work to be represented in C. I 
> expect that LLVM has routines to translate exception handling to more 
> C compatible structures for usage in the other backends.
Not really. We have IR representation of stack unwinding, which doesn't 
translate well to C. You could probably implement a very expensive SJLJ 
mechanism.
> However, this approach would probably limit the exception handling to 
> work in a specific way when translated to C which might not be what 
> the user of a C++ to C compilation flow would like.
A combination of setjmp/longjmp might work, but would be costly on the 
non-exceptional path. Anyway, this was a big limitation of the old C 
backend.

Sebastian



More information about the llvm-dev mailing list