Skip to content

Instantly share code, notes, and snippets.

/test.hs Secret

Created December 8, 2010 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/44bb32c5c89a75481951 to your computer and use it in GitHub Desktop.
Save anonymous/44bb32c5c89a75481951 to your computer and use it in GitHub Desktop.
[1 of 1] Compiling Main ( test.hs, test.o )
test.hs:13:15:
No instance for (GetElementPtr (Ptr Word8) a n)
arising from a use of `getElementPtr0'
Possible fix:
add an instance declaration for (GetElementPtr (Ptr Word8) a n)
In a stmt of a 'do' expression: arg1 <- getElementPtr0 argv 1
In the expression:
do { entry <- newBasicBlock;
defineBasicBlock entry;
arg1 <- getElementPtr0 argv 1;
ret (0 :: Int32) }
In the second argument of `($)', namely
`\ argc argv
-> do { entry <- newBasicBlock;
defineBasicBlock entry;
.... }'
module Main (main) where
import Data.Int
import Data.Word
import LLVM.Core
bar :: CodeGenModule (Function (Int32 -> Ptr (Ptr Word8) -> IO Int32))
bar = createNamedFunction ExternalLinkage "main" $
\ argc argv -> do
entry <- newBasicBlock
defineBasicBlock entry
-- error: no instance of GetElementPtr for (Ptr a)
arg1 <- getElementPtr0 argv 1
ret (0 :: Int32)
main = return 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment