on master help sign in
Merge pull request #485 from lambdadomain/master

Updated dependencies and types for Haskell llvm bindings v3.3.8.1.

commit39bc4c4a1676039a62086bc60c0ab4e30a2fa794 authorEdwin Brady <edwin.brady@gmail.com> dateSat 21 Sep 2013, 05:21 (13 years ago) parent6c723d2ed8114e
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
@@ -435,13 +436,13 @@ targetCPU :: Idris String
435436targetCPU = do i <- getIState
436437 return (opt_cpu (idris_options i))
437438
438−setOptLevel :: Int -> Idris ()
439+setOptLevel :: Word -> Idris ()
439440setOptLevel t = do i <- getIState
440441 let opts = idris_options i
441442 opt' = opts { opt_optLevel = t }
442443 putIState $ i { idris_options = opt' }
443444
444−optLevel :: Idris Int
445+optLevel :: Idris Word
445446optLevel = do i <- getIState
446447 return (opt_optLevel (idris_options i))
447448
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
@@ -943,7 +944,7 @@ getCPU :: Opt -> Maybe String
943944getCPU (TargetCPU x) = Just x
944945getCPU _ = Nothing
945946
946−getOptLevel :: Opt -> Maybe Int
947+getOptLevel :: Opt -> Maybe Word
947948getOptLevel (OptLevel x) = Just x
948949getOptLevel _ = Nothing
949950