Displaying 1 result from an estimated 1 matches for "ptr_function_caller".
2009 Oct 02
1
[LLVMdev] alias analysis and functions
...ls_aliases.c
#include <stdio.h>
typedef int (*PF)();
PF pf01=0;
PF pf2=0;
int pointed_to_function0() {
printf("pointed_to_function0\n");
return 1;
}
int pointed_to_function1() {
pf01 = pointed_to_function1;
printf("pointed_to_function1\n");
return 1;
}
void ptr_function_caller(PF pf) {
printf("ptr_function_caller\n");
pf();
PF lpf0 = pointed_to_function0;
PF lpf1 = pointed_to_function1;
}
int main(int argc, char* argv[]) {
ptr_function_caller(pointed_to_function0);
return 0;
}
-------------
After
llvmgcc -emit-llvm try_calls_aliases.c -c -o try...