Dear LLVM,<br><br>This is probably a question for Fortran/DragonEGG experts:<br><br>Why Fortran's "call flush()" is converted to "call void bitcast (void (...)* @_gfortran_flush_i4 to void (i8*)*)(i8* null) nounwind" ? Why it needs bitcast?<br>
<br>I'm expecting something like "call void @_gfortran_flush_i4(i8* null)". Otherwise, we will need to teach our call parsers to digg into bitcasts, which is an undesired extra complexity.<br><br>Below is a test case (dragonegg/llvm as of r156703):<br>
<br>> cat flush.f90<br>program test<br><br>call flush()<br><br>end program test<br><br>> kernelgen-dragonegg flush.f90 -o- | opt -O3 -S -o -<br>; ModuleID = '<stdin>'<br>target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"<br>
target triple = "x86_64-unknown-linux-gnu"<br><br>@options.0.1537 = internal constant [8 x i32] [i32 68, i32 511, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1], align 32<br><br>declare void @_gfortran_flush_i4(...)<br>
<br>define i32 @main(i32 %argc, i8** %argv) nounwind uwtable {<br>entry:<br> tail call void @_gfortran_set_args(i32 %argc, i8** %argv) nounwind<br> tail call void @_gfortran_set_options(i32 8, i32* getelementptr inbounds ([8 x i32]* @options.0.1537, i64 0, i64 0)) nounwind<br>
tail call void bitcast (void (...)* @_gfortran_flush_i4 to void (i8*)*)(i8* null) nounwind<br> ret i32 0<br>}<br><br>declare void @_gfortran_set_args(i32, i8**)<br><br>declare void @_gfortran_set_options(i32, i32*)<br>
<br>--<br>Thanks,<br>- Dima.<br><br>