on master help sign in
Lifted TODO/FIXME from IRTS/Compiler.hs
commitcbb40b15def5119e629fbf78636c79a9931966b3 authorJan de Muijnck-Hughes <jfdm@st-andrews.ac.uk> dateFri 21 Nov 2014, 14:46 (12 years ago) parent6c0b2b9
1 file changed+14−13
src/IRTS/Compiler.hs+14−13
src/IRTS/Compiler.hs+14−13
@@ -62,7 +62,7 @@ compile codegen f tm
6262 -- iputStrLn $ showSep "\n" (map show defs)
6363 -- Inlined top level LDecl made here
6464 let defsInlined = inlineAll defs
65− let defsUniq = map (allocUnique (addAlist defsInlined emptyContext))
65+ let defsUniq = map (allocUnique (addAlist defsInlined emptyContext))
6666 defsInlined
6767
6868 let (nexttag, tagged) = addTags 65536 (liftAll defsUniq)
@@ -91,13 +91,13 @@ compile codegen f tm
9191 iLOG "Building output"
9292
9393 case checked of
94− OK c -> do return $ CodegenInfo f outty triple cpu
94+ OK c -> do return $ CodegenInfo f outty triple cpu
9595 hdrs impdirs objs libs flags
9696 NONE c (toAlist defuns)
9797 tagged
9898-- runIO $ case codegen of
9999-- ViaC -> codegenC cginfo
100−-- ViaJava -> codegenJava cginfo
100+-- ViaJava -> codegenJava cginfo
101101-- ViaJavaScript -> codegenJavaScript cginfo
102102-- ViaNode -> codegenNode cginfo
103103-- ViaLLVM -> codegenLLVM cginfo
@@ -116,10 +116,10 @@ compile codegen f tm
116116 if ex then return f else return h
117117
118118generate :: Codegen -> FilePath -> CodegenInfo -> IO ()
119−generate codegen mainmod ir
119+generate codegen mainmod ir
120120 = case codegen of
121121 -- Built-in code generators (FIXME: lift these out!)
122− Via "c" -> codegenC ir
122+ Via "c" -> codegenC ir
123123 -- Any external code generator
124124 Via cg -> do let cmd = "idris-" ++ cg ++ " " ++ mainmod ++
125125 " -o " ++ outputFile ir
@@ -195,7 +195,7 @@ mkLDecl n (CaseOp ci _ _ _ pats cd)
195195 where
196196 (args, sc) = cases_runtime cd
197197
198− -- Always attempt to inline functions arising from 'case' expressions
198+ -- Always attempt to inline functions arising from 'case' expressions
199199 caseName (SN (CaseN _)) = True
200200 caseName (SN (WithN _ _)) = True
201201 caseName (NS n _) = caseName n
@@ -284,7 +284,7 @@ irTerm vs env tm@(App f a) = case unApply tm of
284284 x' <- irTerm vs env x
285285 t' <- irTerm vs env t
286286 e' <- irTerm vs env e
287− return (LCase Shared x'
287+ return (LCase Shared x'
288288 [LConCase 0 (sNS (sUN "False") ["Bool","Prelude"]) [] e'
289289 ,LConCase 1 (sNS (sUN "True" ) ["Bool","Prelude"]) [] t'
290290 ])
@@ -425,7 +425,7 @@ irTerm vs env (Bind _ _ _) = return $ LNothing
425425
426426irTerm vs env (Proj t (-1)) = do
427427 t' <- irTerm vs env t
428− return $ LOp (LMinus (ATInt ITBig))
428+ return $ LOp (LMinus (ATInt ITBig))
429429 [t', LConst (BI 1)]
430430
431431irTerm vs env (Proj t i) = LProj <$> irTerm vs env t <*> pure i
@@ -458,13 +458,13 @@ doForeign vs env (_ : fgn : args)
458458 | fi == txt "FIntT"
459459 = mkIntIty (str intTy)
460460
461− mkIty' (App (App (P _ (UN ff) _) _) (App (P _ (UN fa) _) (App (P _ (UN io) _) _)))
461+ mkIty' (App (App (P _ (UN ff) _) _) (App (P _ (UN fa) _) (App (P _ (UN io) _) _)))
462462 | ff == txt "FFunction"
463463 , fa == txt "FAny"
464− , io == txt "IO"
464+ , io == txt "IO"
465465 = FFunctionIO
466466
467− mkIty' (App (App (P _ (UN ff) _) _) _)
467+ mkIty' (App (App (P _ (UN ff) _) _) _)
468468 | ff == txt "FFunction"
469469 = FFunction
470470
@@ -472,7 +472,8 @@ doForeign vs env (_ : fgn : args)
472472
473473 -- would be better if these FInt types were evaluated at compile time
474474 -- TODO: add %eval directive for such things
475−
475+ -- Issue #1742 on the issue tracker.
476+ -- https://github.com/idris-lang/Idris-dev/issues/1742
476477 mkIty "FFloat" = FArith ATFloat
477478 mkIty "FInt" = mkIntIty "ITNative"
478479 mkIty "FChar" = mkIntIty "ITChar"
@@ -521,7 +522,7 @@ irSC vs (Case up n [ConCase (UN delay) i [_, _, n'] sc])
521522 | delay == txt "Delay"
522523 = do sc' <- irSC vs $ mkForce n' n sc
523524 return $ LLet n' (LForce (LV (Glob n))) sc'
524−
525+
525526-- There are two transformations in this case:
526527--
527528-- 1. Newtype-case elimination: