Displaying 5 results from an estimated 5 matches for "pt2function".
Did you mean:
pfunction
2004 Apr 02
2
[LLVMdev] Function pointers
..._kernelPTR = getelementptr %kernel* %theKernel, long 1, ubyte 0
store int ()* %puts_kernel, int ()** %puts_kernelPTR
ret int 0
}
I want to learn how to achieve the mechanisms in this C code:
#include <stdio.h>
int DoIt(void);
int DoIt(void){
return 0;
}
int main()
{
int (*pt2Function) ();
int a = DoIt();
printf("a is: %i\n", a);
pt2Function = DoIt;
int b = pt2Function();
printf("b is: %i\n", b);
}
Grateful for hints!
Anders
-----Original Message-----
From: Chris Lattner <sabre at nondot.org>
To: llvm...
2004 Apr 02
0
[LLVMdev] Function pointers
...nt ()* %puts_kernel, int ()** %puts_kernelPTR
>
> ret int 0
> }
>
> I want to learn how to achieve the mechanisms in this C code:
>
> #include <stdio.h>
>
> int DoIt(void);
> int DoIt(void){
> return 0;
> }
>
> int main()
> {
> int (*pt2Function) ();
>
> int a = DoIt();
> printf("a is: %i\n", a);
>
> pt2Function = DoIt;
>
> int b = pt2Function();
> printf("b is: %i\n", b);
> }
>
> Grateful for hints!
>
> Anders
>
>
>
> -----Origin...
2004 Apr 02
0
[LLVMdev] Function pointers
..._kernelPTR = getelementptr %kernel* %theKernel, long 1, ubyte 0
store int ()* %puts_kernel, int ()** %puts_kernelPTR
ret int 0
}
I want to learn how to achieve the mechanisms in this C code:
#include <stdio.h>
int DoIt(void);
int DoIt(void){
return 0;
}
int main()
{
int (*pt2Function) ();
int a = DoIt();
printf("a is: %i\n", a);
pt2Function = DoIt;
int b = pt2Function();
printf("b is: %i\n", b);
}
Grateful for hints!
Anders
-----Original Message-----
From: Chris Lattner <sabre at nondot.org>
To: llvm...
2004 Apr 02
0
[LLVMdev] Function pointers
..._kernelPTR = getelementptr %kernel* %theKernel, long 1, ubyte 0
store int ()* %puts_kernel, int ()** %puts_kernelPTR
ret int 0
}
I want to learn how to achieve the mechanisms in this C code:
#include <stdio.h>
int DoIt(void);
int DoIt(void){
return 0;
}
int main()
{
int (*pt2Function) ();
int a = DoIt();
printf("a is: %i\n", a);
pt2Function = DoIt;
int b = pt2Function();
printf("b is: %i\n", b);
}
Grateful for hints!
Anders
-----Original Message-----
From: Chris Lattner <sabre at nondot.org>
To: llvm...
2008 Feb 25
0
[LLVMdev] Calling functions
.... It it happens again I'll use another e-mail.
Thanks for your reply, Benjamin.
I've tried that approach to the c++ function calls. I ended up with this code:
#######
float test( float input )
{
return 0.0;
}
[...]
typedef float (*P_FUNCTION) ( float );
P_FUNCTION pt2Function = &test;
intptr_t functionInt = (intptr_t)pt2Function;
Constant *functionConstant = ConstantInt::get( APInt( sizeof(intptr_t), functionInt) );
const Type *ArgTy = Type::FloatTy;
PointerType* arg = PointerType::get( ArgTy, 0 );
functionConstant = ConstantExpr::getIntToPtr( function...