bos/llvm — Issue #22: Global var or global array containing ptr to function
Author: artyomszasa
Created: 2011-10-13 09:56:47+00:00
State: open

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!