The following recursive example cannot generate "tail call". It generate "call"
only. Anyone knows how to make "tail call"?
// clang -c 1.c -emit-llvm -o 1.bc
// llvm-dis 1.bc -o -
// File 1.c
int factorial(int x)
{
x--;
if (x <= 0)
return 1;
return x*factorial(x-1);
}
// output
define i32 @factorial(i32 %x) #0 {
...
%call = call i32 @factorial(i32 %sub)
..
}
_______________________________________________
cfe-users mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users