llvm icon indicating copy to clipboard operation
llvm copied to clipboard

Global var or global array containing ptr to function

Open artyomszasa opened this issue 13 years ago • 0 comments

In my program in need to create global variables and/or arrays containing pointers to internally linked functions.

As I see from documentation at http://hackage.haskell.org/packages/archive/llvm/0.9.1.2/doc/html/ when defining new global variable/array I need to provide value(s) of type 'ConstValue a', but 'Function a' (which I suppose represents pointer to the function itself) is defined as 'Value (Ptr a)', so it is a non-constant pointer.

Is there any solution for this problem? I think it is valid usecase, as it is possible to do so either when using other bindings to LLVM or when simply writing code in C!

artyomszasa avatar Oct 13 '11 09:10 artyomszasa