[haskell-llvm] Generating a structure at runtime
Nathan Howell
nathan.d.howell at gmail.com
Fri Jul 8 17:25:49 BST 2011
On Fri, Jul 8, 2011 at 9:02 AM, Henning Thielemann <
lemming at henning-thielemann.de> wrote:
> Cast my struct to a char* and calculate the alignment and layout manually?
>
> I see, this is the problem. But you have to construct the Struct at
> run-time somehow, right? Then you should also be able to construct the right
> type for the struct-pointer that you pass to (unsafe)getElementPtr.
>
Yes, exactly. In this case I'll generate functions to initialize, update and
free the structure safely from Haskell.
Overall it's much, much nicer to do LLVM development in Haskell but this is
one of the few times that I'm willing to accept runtime type safety
(asserts) over a build break.
thanks,
-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://projects.haskell.org/pipermail/haskell-llvm/attachments/20110708/687e42b4/attachment.htm>
More information about the Haskell-llvm
mailing list