@@ -39,7 +39,7 @@ codegenLLVM :: [(TT.Name, SDecl)] ->
40codegenLLVM defs file outty = withContext $ \context -> do
40codegenLLVM defs file outty = withContext $ \context -> do
41 let ast = codegen arch (map snd defs)
41 let ast = codegen arch (map snd defs)
42− result <- traceShow ast $ M.withModuleFromAST context ast (M.writeBitcodeToFile file)
42+ result <- M.withModuleFromAST context ast (M.writeBitcodeToFile file)
43 case result of
43 case result of
44 Right _ -> return ()
44 Right _ -> return ()
45 Left msg -> ierror msg
45 Left msg -> ierror msg
@@ -59,10 +59,11 @@ codegen tgt defs =
59 Just $ StructureType False
59 Just $ StructureType False
60 [ IntegerType 32
60 [ IntegerType 32
61 , IntegerType 32
61 , IntegerType 32
62− , PointerType (IntegerType 8) (AddrSpace 0) -- Not actually i8, but we don't care
62+ , PointerType intPtr (AddrSpace 0)
64 , GlobalDefinition $ globalVariableDefaults
64 , GlobalDefinition $ globalVariableDefaults
65 { G.name = Name "__idris_intFmtStr"
65 { G.name = Name "__idris_intFmtStr"
66+ , G.linkage = L.Internal
66 , G.isConstant = True
67 , G.isConstant = True
67 , G.hasUnnamedAddr = True
68 , G.hasUnnamedAddr = True
68 , G.type' = ArrayType 5 (IntegerType 8)
69 , G.type' = ArrayType 5 (IntegerType 8)