[LLVMdev] [DragonEgg] Why Fortran's "call flush()" is converted to "call void bitcast (void (...)* @_gfortran_flush_i4 to void (i8*)*)(i8* null) nounwind" ?

Duncan Sands baldrick at free.fr
Tue Jul 17 06:47:16 PDT 2012


Hi Anton,

On 17/07/12 15:35, Anton Korobeynikov wrote:
>> actually there is a different fix, which is to not pay any attention to GCC
>> function types when generating calls (and function prototypes), and instead
>> do everything by querying GCC's CUMULATIVE_ARGS.
> I tried to do this during llvm-gcc times and it turned out that there
> might be different calls with different signatures in single module
> e.g. function with N arguments is called in some cases with N - 1
> first args and since the remaining one is unused everything is fine.
> So, basically the function *is* varargs but it's not possible to
> deduce this from the args...
>
> I don't recall all the details now though...

yes, it is a can of worms, but I'm hopeful it can be made to work anyway.

Ciao, Duncan.



More information about the llvm-dev mailing list