on master help sign in
Eliminate unused inputs to erasure analysis
commit7e308ddebdb515e79631336727468f67d56b9038 authorMatus Tejiscak <ziman@functor.sk> dateFri 24 Jan 2014, 12:32 (13 years ago) parent4dc937a
2 files changed+8−3
src/IRTS/Compiler.hs+1−1 src/Idris/Erasure.hs+7−2
src/IRTS/Compiler.hs+1−1
@@ -51,7 +51,7 @@ compile codegen f tm
5151
5252 -- TODO: DEBUG-ONLY, remove
5353 ist <- getIState
54− let depMap = buildDepMap (tt_ctxt ist) (idris_callgraph ist) used
54+ let depMap = buildDepMap (tt_ctxt ist) used
5555 let printCond (ctors, cond) = "if " ++ show (S.toList cond) ++ " -ctors- " ++ show (S.toList ctors)
5656 let printDep (i, conds) = unlines . map (" "++) $ (show i : map printCond (S.toList conds))
5757 let printItem (fn, (deps, depns)) = unlines ((show fn ++ " <- " ++ show (S.toList depns)) : map printDep (IM.toList deps))
src/Idris/Erasure.hs+7−2
@@ -58,8 +58,13 @@ type Vars = Map Name Var
5858type PatVar = Ctors -> Var
5959type PatVars = Map Name PatVar
6060
61−buildDepMap :: Context -> Ctxt CGInfo -> [Name] -> DepMap
62−buildDepMap ctx cg ns = dfs M.empty ns
61+minimalUsage :: DepMap -> UseMap
62+minimalUsage dmap = undefined
63+
64+-- Build the dependency graph,
65+-- starting the depth-first search from a list of Names.
66+buildDepMap :: Context -> [Name] -> DepMap
67+buildDepMap ctx ns = dfs M.empty ns
6368 where
6469 -- perform depth-first search
6570 -- to discover all the names used in the program