on master help sign in
Minor CG changes
758d56aEdwin Brady
src/IRTS/Compiler.hs+3
@@ -144,6 +144,9 @@ instance ToIR (TT Name) where
144 = doForeign env args
144 = doForeign env args
145 | (P _ (UN "unsafePerformIO") _, [_, arg]) <- unApply tm
145 | (P _ (UN "unsafePerformIO") _, [_, arg]) <- unApply tm
146 = ir' env arg
146 = ir' env arg
147+ -- TMP HACK - until we get inlining.
148+ | (P _ (UN "replace") _, [_, _, _, _, _, arg]) <- unApply tm
149+ = ir' env arg
147 | (P _ (UN "lazy") _, [_, arg]) <- unApply tm
150 | (P _ (UN "lazy") _, [_, arg]) <- unApply tm
148 = do arg' <- ir' env arg
151 = do arg' <- ir' env arg
149 return $ LLazyExp arg'
152 return $ LLazyExp arg'
src/Idris/ElabDecls.hs+4−2
@@ -357,7 +357,9 @@ elabClauses info fc opts n_in cs = let n = liftname info n_in in
357 iputStrLn $ show fc ++
357 iputStrLn $ show fc ++
358 ":warning - Unreachable case: " ++
358 ":warning - Unreachable case: " ++
359 show (delab ist x)) xs
359 show (delab ist x)) xs
360+ let knowncovering = pcover && cov
361+
360− tree' <- tclift $ simpleCase tcase pcover RunTime fc pdef'
362+ tree' <- tclift $ simpleCase tcase knowncovering RunTime fc pdef'
361 logLvl 3 (show tree)
363 logLvl 3 (show tree)
362 logLvl 3 $ "Optimised: " ++ show tree'
364 logLvl 3 $ "Optimised: " ++ show tree'
363 ctxt <- getContext
365 ctxt <- getContext
@@ -365,7 +367,7 @@ elabClauses info fc opts n_in cs = let n = liftname info n_in in
365 put (ist { idris_patdefs = addDef n pdef' (idris_patdefs ist) })
367 put (ist { idris_patdefs = addDef n pdef' (idris_patdefs ist) })
366 case lookupTy (namespace info) n ctxt of
368 case lookupTy (namespace info) n ctxt of
367 [ty] -> do updateContext (addCasedef n (inlinable opts)
369 [ty] -> do updateContext (addCasedef n (inlinable opts)
368− tcase pcover pats
370+ tcase knowncovering pats
369 pdef pdef' ty)
371 pdef pdef' ty)
370 addIBC (IBCDef n)
372 addIBC (IBCDef n)
371 setTotality n tot
373 setTotality n tot