|
libFirm is not tied to compiling C.
It is a more general intermediate representation library, which provides an API to attach a frontend, e.g. there is one for X10, too.
Further, I doubt that we have enough good C compilers. 1. How exceptions are to be implemented is dictated by the runtime environment.
Support for exceptions in general is currently work in progress. 2. libFirm's register alloctor does not make any restrictions about the calling convention.
If you want to have a call, which passes the first and seventh parameter in %esi and %edx, then you can specify that in the intermediate representation and the register allocator will handle that.
Of course there is no generic mechanism to export this insanity to the frontend, but the backend itself can generate code for that without problem. 3. There is currently no support for GCs, i.e. we do not readily export information, where pointers are.
Though libFirm's type system is strong enough to contain that information, but somebody has to do the work to export this and connect it to a GC.
There was not enough interest and too little manpower available to do this so far.
For all projects, where a GC is used, we use a Boehm GC. 4. Yes, libFirm has a pass for this.
It can even eliminate pseudo-tail calls like 'int fac(int n) { return n == 0 ? 1 : n * fac(n - 1); }'.
This is no proper tail call, because the '' is the last operation, which happens (and not the call to fac()).
Because '' is associative and commutative, we can still transform this into a loop.
And it has many more analyses and transformations: local optimizations (aka "instcombine"), common subexpression elimination, partial redundancy elimination, scalar replacement, reassociation, implicit (due to being dependency-graph based) dead code elimination, Click's combo optimization, bitwise constant information, load-store optimization, control-flow optimization, conditional jump threading, if-conversion, operator strength reduction, division-by-constant optmization, function inlining, register-pressure aware instruction scheduling, block scheduling, belady spiller, SSA-based register allocation and copy coalescing, ... |