on master help sign in
Updated dependencies and types for Haskell llvm bindings v3.3.8.1.
commited8114ebfa6934953c250ca84c198974c1609572 authorlambdadomain <gigabites2@A853-2.local> dateSat 14 Sep 2013, 22:55 (13 years ago) parent7e1005a
5 files changed+16−13
idris.cabal+1−1 src/IRTS/CodegenLLVM.hs+7−7 src/Idris/AbsSyntax.hs+3−2 src/Idris/AbsSyntaxTree.hs+3−2 src/Idris/REPL.hs+2−1
idris.cabal+1−1
@@ -303,6 +303,6 @@ Executable idris
303303 if flag(LLVM)
304304 other-modules: IRTS.CodegenLLVM
305305 cpp-options: -DIDRIS_LLVM
306− build-depends: llvm-general==3.3.5.*
306+ build-depends: llvm-general==3.3.8.*, llvm-general-pure==3.3.8.*
307307 else
308308 other-modules: Util.LLVMStubs
src/IRTS/CodegenLLVM.hs+7−7
@@ -19,7 +19,7 @@ import LLVM.General.Target ( TargetMachine
1919 , initializeAllTargets, lookupTarget
2020 )
2121import LLVM.General.AST.DataLayout
22−import LLVM.General.PassManager
22+import qualified LLVM.General.PassManager as PM
2323import qualified LLVM.General.Module as M
2424import qualified LLVM.General.AST.IntegerPredicate as IPred
2525import qualified LLVM.General.AST.Linkage as L
@@ -59,7 +59,7 @@ data Target = Target { triple :: String, dataLayout :: DataLayout }
5959codegenLLVM :: [(TT.Name, SDecl)] ->
6060 String -> -- target triple
6161 String -> -- target CPU
62− Int -> -- Optimization degree
62+ Word -> -- Optimization degree
6363 FilePath -> -- output file name
6464 OutputType ->
6565 IO ()
@@ -71,12 +71,12 @@ codegenLLVM defs triple cpu optimize file outty = withContext $ \context -> do
7171 do layout <- getTargetMachineDataLayout tm
7272 let ast = codegen (Target triple layout) (map snd defs)
7373 result <- runErrorT . M.withModuleFromAST context ast $ \m ->
74− do let opts = defaultCuratedPassSetSpec
75− { optLevel = Just optimize
76− , simplifyLibCalls = Just True
77− , useInlinerWithThreshold = Just 225
74+ do let opts = PM.defaultCuratedPassSetSpec
75+ { PM.optLevel = Just optimize
76+ , PM.simplifyLibCalls = Just True
77+ , PM.useInlinerWithThreshold = Just 225
7878 }
79− when (optimize /= 0) $ withPassManager opts $ void . flip runPassManager m
79+ when (optimize /= 0) $ PM.withPassManager opts $ void . flip PM.runPassManager m
8080 outputModule tm file outty m
8181 case result of
8282 Right _ -> return ()
src/Idris/AbsSyntax.hs+3−2
@@ -23,6 +23,7 @@ import Data.List
2323import Data.Char
2424import Data.Either
2525import Data.Maybe
26+import Data.Word (Word)
2627
2728import Debug.Trace
2829
@@ -432,13 +433,13 @@ targetCPU :: Idris String
432433targetCPU = do i <- getIState
433434 return (opt_cpu (idris_options i))
434435
435−setOptLevel :: Int -> Idris ()
436+setOptLevel :: Word -> Idris ()
436437setOptLevel t = do i <- getIState
437438 let opts = idris_options i
438439 opt' = opts { opt_optLevel = t }
439440 putIState $ i { idris_options = opt' }
440441
441−optLevel :: Idris Int
442+optLevel :: Idris Word
442443optLevel = do i <- getIState
443444 return (opt_optLevel (idris_options i))
444445
src/Idris/AbsSyntaxTree.hs+3−2
@@ -24,6 +24,7 @@ import Control.Monad.Trans.State.Strict
2424import Data.List
2525import Data.Char
2626import Data.Either
27+import Data.Word (Word)
2728
2829import Debug.Trace
2930
@@ -42,7 +43,7 @@ data IOption = IOption { opt_logLevel :: Int,
4243 opt_importdirs :: [FilePath],
4344 opt_triple :: String,
4445 opt_cpu :: String,
45− opt_optLevel :: Int,
46+ opt_optLevel :: Word,
4647 opt_cmdline :: [Opt] -- remember whole command line
4748 }
4849 deriving (Show, Eq)
@@ -278,7 +279,7 @@ data Opt = Filename String
278279 | InterpretScript String
279280 | TargetTriple String
280281 | TargetCPU String
281− | OptLevel Int
282+ | OptLevel Word
282283 deriving (Show, Eq)
283284
284285-- Parsed declarations
src/Idris/REPL.hs+2−1
@@ -59,6 +59,7 @@ import Data.Maybe
5959import Data.List
6060import Data.Char
6161import Data.Version
62+import Data.Word (Word)
6263
6364import Debug.Trace
6465
@@ -939,7 +940,7 @@ getCPU :: Opt -> Maybe String
939940getCPU (TargetCPU x) = Just x
940941getCPU _ = Nothing
941942
942−getOptLevel :: Opt -> Maybe Int
943+getOptLevel :: Opt -> Maybe Word
943944getOptLevel (OptLevel x) = Just x
944945getOptLevel _ = Nothing
945946