[haskell-llvm] Generating a structure at runtime

Henning Thielemann schlepptop at henning-thielemann.de
Fri Jul 8 16:44:10 BST 2011


On 08.07.2011 17:39, Nathan Howell wrote:

> To make it easier, I added a new function "unsafeGetElementPtr" which
> doesn't enforce type safety at compile time. This is fine for my
> application. The change is here:
>
> https://github.com/alphaHeavy/llvm/commit/8840ccbb39b4788b70dc859154b5fa3634aee634
>
> Which allows me to do this:
>
> val :: Value (Ptr Double) <- unsafeGetElementPtr c [0::Int32, 0]
>
> val' <- load val

The Haskell-llvm package is concerned with generating compilable LLVM 
bitcode. unsafeGetElementPtr cannot warrant this. unsafeGetElementPtr is 
unnecessary if you cast the pointers. I would prefer this way.



More information about the Haskell-llvm mailing list