From 03295ca4e6c17772d046ec216972c776649d6ad9 Mon Sep 17 00:00:00 2001
From: Bill Wendling
For example, if the function is
i32 f(i8* nest %c, i32 %x, i32 %y) then the resulting function
- pointer has signature i32 (i32, i32)*. It can be created as follows:
+ pointer has signature i32 (i32, i32)*. It can be created as follows:
%tramp = alloca [10 x i8], align 4 ; size and alignment only correct for X86
%tramp1 = getelementptr [10 x i8]* %tramp, i32 0, i32 0
%p = call i8* @llvm.init.trampoline( i8* %tramp1, i8* bitcast (i32 (i8* nest , i32, i32)* @f to i8*), i8* %nval )
%fp = bitcast i8* %p to i32 (i32, i32)*
- The call %val = call i32 %fp( i32 %x, i32 %y ) is then equivalent to
- %val = call i32 %f( i8* %nval, i32 %x, i32 %y ).
-
The call %val = call i32 %fp( i32 %x, i32 %y ) is then equivalent + to %val = call i32 %f( i8* %nval, i32 %x, i32 %y ).