[haskell-llvm] [Haskell-cafe] LLVM, type-level?
nathan.d.howell at gmail.com
Tue Dec 7 20:38:07 EST 2010
On Tue, Dec 7, 2010 at 4:39 PM, Lally Singh <lally.singh at gmail.com> wrote:
> Cool, so how do I:
> - declare main's signature? I'm using createNamedFunction "main"
> - access those arguments inside main's body?
Good question... it looks like getElementPtr does allow indexing into
pointers . It should be possible to either add a GetElementPtr
instance for Ptr or fall back to doing pointer math. This should at
least get you started:
bar :: CodeGenModule (Function (Int32 -> Ptr (Ptr Word8) -> IO Int32))
bar = createNamedFunction ExternalLinkage "main" $
\ argc argv -> do
entry <- newBasicBlock
ret (0 :: Int32)
More information about the Haskell-llvm