-
-
Save anonymous/44bb32c5c89a75481951 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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; | |
.... }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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